Classify existing emails with the AI label rules
/ai-label-rules/backfillRules 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 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" ]}Create an AI label rule POST
Creates the AI label and the natural-language condition that applies it, in one call. Setting `autoReplyEnabled: true` lets Maylee send replies on your behalf: it requires `allowOutboundSend` on the key, like sending an email does.
Update an AI label rule PATCH
Renames the label, changes the condition, or configures auto-draft and auto-reply. Setting `autoReplyEnabled: true` requires `allowOutboundSend` on the key.