AI label rules

Create an AI label rule

POST/ai-label-rules

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.

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

application/json

curl -X POST "https://example.com/ai-label-rules" \  -H "Authorization: Bearer $MAYLEE_KEY" \  -H "Idempotency-Key: $(uuidgen)" \  -H "Content-Type: application/json" \  -d '{    "color": "Green",    "condition": "The email is an invoice, a receipt or a payment confirmation from a supplier.",    "hideFromInbox": true,    "name": "Invoices"  }'
{  "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"  }}