AI label rules

Classify existing emails with the AI label rules

POST/ai-label-rules/backfill

Rules only apply to emails synchronized after their creation. This queues one background job per active mailbox (or the given one) that classifies the limit most recent INBOX emails with every rule of the workspace.

Labels land asynchronously: they appear in the tags of each email once it is classified. A backfill applies labels and nothing else: no auto-forward, auto-draft or auto-reply is triggered. Each classified email costs one model call.

Authorization

apiKey
AuthorizationBearer <token>

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

In: header

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

application/json

curl -X POST "https://example.com/ai-label-rules/backfill" \  -H "Authorization: Bearer $MAYLEE_KEY" \  -H "Content-Type: application/json" \  -d '{    "limit": 200  }'
{  "jobs": 1,  "mailboxIds": [    "cmbx1a2b3c4d5e6f7g8h9i0j"  ]}