Delete an inbound route

Delete an inbound route; messages it already matched keep their history and queued forwards still complete.

Removes the route from evaluation. Messages it already matched stay stored (their route_id becomes null), and forward attempts already queued still run to completion. To pause a route instead, update it with "enabled": false.

DELETE /v3/routes/{id}

Requires a full_access key. A second call, or an id of another workspace, answers 404 not_found.

Responses

StatusDescription
204Deleted. No body.
401Missing or invalid API key.
403insufficient_scope — route writes need a full_access key.
404No such route on your workspace.

Code examples

cURL
curl -X DELETE https://api.wemail.io/v3/routes/0b7e4c2d-9a1f-4e6b-8c3d-5f2a1b9e7d40 \
  -H "Authorization: Bearer afn_live_…"
# 204 No Content
Node.js
const res = await fetch("https://api.wemail.io/v3/routes/0b7e4c2d-9a1f-4e6b-8c3d-5f2a1b9e7d40", {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.WEMAIL_API_KEY}` },
});
console.log(res.status); // 204
Python
import os, requests

r = requests.delete(
    "https://api.wemail.io/v3/routes/0b7e4c2d-9a1f-4e6b-8c3d-5f2a1b9e7d40",
    headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
)
print(r.status_code)  # 204
Go
client, _ := wemail.NewClient(os.Getenv("WEMAIL_API_KEY"))
ctx := context.WithValue(context.Background(), wemail.ContextAccessToken, os.Getenv("WEMAIL_API_KEY"))
_, err := client.API.RoutesAPI.DeleteInboundRoute(ctx, "0b7e4c2d-9a1f-4e6b-8c3d-5f2a1b9e7d40").Execute()