Draft or rewrite a message with AI

POST/api/v1/mailbox/ai/compose
Requires amailbox token— it acts as one mailbox holder, not as the organization.

503 error_code ai_not_configured when no endpoint is set; 403 org_policy_blocked / not_entitled / consent_required / terms_version_stale when a Maya gate fails; 429 ai_quota_exhausted when the monthly allowance is spent. Responses carry ai_calls_remaining.

Request body

Request

POST/api/v1/mailbox/ai/compose
curl -X POST 'https://app.mailyte.com/api/v1/mailbox/ai/compose' \
  -H 'Authorization: Bearer MAILBOX_TOKEN'
The key names its own organization, so no X-Organization-ID header is needed.

Response

Successful Response

Returned inside the standard envelope.

Errors

StatusWhen
422Validation Error

Every status, with what causes it and what to do, is on the error reference.