List inbound routes
List the inbound routes of your workspace in evaluation order — priority ascending, then creation time — with their actions and secrets redacted.
Returns your inbound routes in the order the receiver evaluates them: priority ascending, ties by creation time. Each item carries expression, the ordered actions (store, forward with its url and has_secret, stop), priority, enabled and created_at. Forward secrets are never returned. Page-numbered like the other list endpoints (page, per_page ≤ 100).
GET /v3/routes
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | Optional | Page number (1-based). Default 1. |
per_page | integer | Optional | Items per page, 1–100. Default 25. |
Requires a full_access or read_only key — a send_only key is denied. See the overview for the expression grammar and action semantics.
Responses
| Status | Description |
|---|---|
200 | OK. { items, pagination } in evaluation order. |
401 | Missing or invalid API key. |
403 | insufficient_scope — a send_only key cannot read routes. |
Code examples
cURL
curl -G https://api.wemail.io/v3/routes \
-H "Authorization: Bearer afn_live_…" \
--data-urlencode "per_page=50"Node.js
const res = await fetch("https://api.wemail.io/v3/routes?per_page=50", {
headers: { Authorization: `Bearer ${process.env.WEMAIL_API_KEY}` },
});
const { items } = await res.json();
for (const r of items) console.log(r.priority, r.expression, r.actions);Python
import os, requests
r = requests.get(
"https://api.wemail.io/v3/routes",
headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
params={"per_page": 50},
)
for route in r.json()["items"]:
print(route["priority"], route["expression"], route["actions"])Go
client, _ := wemail.NewClient(os.Getenv("WEMAIL_API_KEY"))
ctx := context.WithValue(context.Background(), wemail.ContextAccessToken, os.Getenv("WEMAIL_API_KEY"))
page, _, err := client.API.RoutesAPI.ListInboundRoutes(ctx).PerPage(50).Execute()ResponseExample response
{
"items": [
{
"id": "0b7e4c2d-9a1f-4e6b-8c3d-5f2a1b9e7d40",
"account_id": "acc_01HBYD3M…",
"expression": "match_header(\"auto-submitted\", \"auto-replied\")",
"actions": [{ "type": "stop" }],
"priority": 0,
"enabled": true,
"created_at": "2026-11-03T07:58:02.000Z"
},
{
"id": "3d9a1f6e-2b7c-4c8d-9e0f-7a1b2c3d4e5f",
"account_id": "acc_01HBYD3M…",
"expression": "match_recipient(\"kostas@leads.example.com\")",
"actions": [
{ "type": "store" },
{ "type": "forward", "url": "https://app.example.com/inbound", "has_secret": true }
],
"priority": 10,
"enabled": true,
"created_at": "2026-11-03T07:59:30.000Z"
}
],
"pagination": { "page": 1, "per_page": 25, "total_count": 2, "total_pages": 1 }
}