Create a route (match, action, destination).
HTTP: POST /api/routes
| Field | Type | Required | Description |
|---|---|---|---|
match |
string | ✓ | Address pattern: exact, @domain, addr+@domain, or /regex/. |
action |
string | What to do with matching mail. Defaults to webhook. | |
destination |
string | Required for action webhook (URL) or forward (address). | |
agentPrompt |
string | Required for action agent — instructions for the inbox agent. | |
agentForwardTo |
array | For action agent: addresses the inbox agent's forward tool may send to. The agent can… | |
agentContext |
string | For action agent: how much mail the agent may read once the sender is verified (they… |
any
res = mk.createRoute({
"match": "*@app.mailkite.dev",
"action": "webhook",
"destination": "https://app.com/hooks",
})