Update an AI label rule
/ai-label-rules/{ruleId}Renames the label, changes the condition, or configures auto-draft and auto-reply. Setting autoReplyEnabled: true requires allowOutboundSend on the key.
Authorization
apiKey Send your key as Authorization: Bearer mk_…. Session cookies are never accepted on this surface.
In: header
Path Parameters
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
application/json
curl -X PATCH "https://example.com/ai-label-rules/string" \ -H "Authorization: Bearer $MAYLEE_KEY" \ -H "Content-Type: application/json" \ -d '{ "autoDraftEnabled": true }'{ "rule": { "autoDraftEnabled": true, "autoReplyConfidenceThreshold": 85, "autoReplyDelayMinutes": 0, "autoReplyEnabled": false, "autoReplyNotifyOnSend": true, "condition": "The sender asks about pricing, a quote or a demo of our product.", "createdAt": "2026-06-03T08:00:00.000Z", "hideFromInbox": false, "id": "cmrl1a2b3c4d5e6f7g8h9i0j", "label": { "color": "Blue", "id": "cmtgai1b2c3d4e5f6g7h8i9j", "isAiLabel": true, "name": "Sales" }, "updatedAt": "2026-08-20T16:40:00.000Z" }}Classify existing emails with the AI label rules POST
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.
Delete an AI label rule DELETE
Deletes the rule and its label, and removes the label from every email that carried it.