Update an inbound route

Change the expression, actions, priority, enabled flag, name or description of an inbound route; actions are replaced as a whole.

Every field is optional; only the fields you send change. actions replaces the whole list. A forward action’s secret is write-only: a forward action that omits secret keeps the secret already stored for a forward action with the same url; "secret": null removes it; a new string replaces it. To have the server generate a secret, call POST /v3/routes/{id}/secret — it returns the new secret once. Validation and error codes are the same as Create an inbound route.

PUT /v3/routes/{id}

Request body

ParameterTypeRequiredDescription
expressionstringOptionalNew match expression (match_recipient, match_header or catch_all).
actionsobject[]OptionalNew ordered action list, 1–5 entries. Replaces the existing list; a forward action without secret keeps the stored secret of the same URL, "secret": null removes it.
priorityintegerOptionalEvaluation priority, lower runs first.
enabledbooleanOptionalfalse pauses the route without deleting it.
namestring | nullOptionalDisplay name (1–100 characters); null clears it.
descriptionstring | nullOptionalFree-text note (≤ 500 characters); null clears it.

Requires a full_access key.

Responses

StatusDescription
200OK. The updated route.
400validation_error — a forward url that is not a public HTTPS address.
401Missing or invalid API key.
403insufficient_scope — route writes need a full_access key.
404No such route on your workspace.
422invalid_expression / invalid_actions — see the create page.

Code examples

cURL
# Pause a route without deleting it
curl -X PUT https://api.wemail.io/v3/routes/0b7e4c2d-9a1f-4e6b-8c3d-5f2a1b9e7d40 \
  -H "Authorization: Bearer afn_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": false }'
Node.js
const res = await fetch("https://api.wemail.io/v3/routes/0b7e4c2d-9a1f-4e6b-8c3d-5f2a1b9e7d40", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`,
    "Content-Type": "application/json",
  },
  // actions replaces the whole list — a forward action without "secret" keeps the stored secret of the same URL
  body: JSON.stringify({
    actions: [
      { type: "store" },
      { type: "forward", url: "https://app.example.com/inbound-v2", secret: "whsec_replace_me_1234" },
    ],
  }),
});
const route = await res.json();
Python
import os, requests

r = requests.put(
    "https://api.wemail.io/v3/routes/0b7e4c2d-9a1f-4e6b-8c3d-5f2a1b9e7d40",
    headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
    json={"enabled": False},
)
route = r.json()
Go
client, _ := wemail.NewClient(os.Getenv("WEMAIL_API_KEY"))
ctx := context.WithValue(context.Background(), wemail.ContextAccessToken, os.Getenv("WEMAIL_API_KEY"))
req := wemail.UpdateInboundRouteRequest{}
req.SetEnabled(false)
route, _, err := client.API.RoutesAPI.UpdateInboundRoute(ctx, "0b7e4c2d-9a1f-4e6b-8c3d-5f2a1b9e7d40").
    UpdateInboundRouteRequest(req).Execute()
ResponseExample response
{
  "id": "0b7e4c2d-9a1f-4e6b-8c3d-5f2a1b9e7d40",
  "account_id": "acc_01HBYD3M…",
  "expression": "match_recipient(\".*@leads\\\\.example\\\\.com\")",
  "actions": [
    { "type": "store" },
    { "type": "forward", "url": "https://app.example.com/inbound", "has_secret": true }
  ],
  "priority": 10,
  "enabled": false,
  "created_at": "2026-11-03T07:59:30.000Z"
}