Auto-forward rules

Create an auto-forward rule

POST/auto-forward-rules

Forwards every incoming email matching the condition to forwardTo.

A rule makes email leave the workspace: creating, changing or deleting one requires allowOutboundSend on the key, like sending does. A key with write alone gets 403 OUTBOUND_SEND_NOT_ALLOWED.

Authorization

apiKey
AuthorizationBearer <token>

Send your key as Authorization: Bearer mk_…. Session cookies are never accepted on this surface.

In: header

Header Parameters

Idempotency-Key?string

A unique value per operation, such as a UUID. Replays the stored response for 24h. Reusing a key with a different body returns 409.

Lengthlength <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/auto-forward-rules" \  -H "Authorization: Bearer $MAYLEE_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "conditionField": "label",    "conditionValue": "Invoices",    "forwardTo": "accounting@your-company.com",    "mode": "normal"  }'
{  "rule": {    "conditionField": "label",    "conditionValue": "Invoices",    "createdAt": "2026-08-01T09:00:00.000Z",    "forwardTo": "accounting@your-company.com",    "id": "cmaf1a2b3c4d5e6f7g8h9i0j",    "isActive": true,    "mode": "normal",    "updatedAt": "2026-08-01T09:00:00.000Z"  }}