Create Rule
Request, response and authentication details for your Mailat instance.
/api/v1/rulesCreateRule creates a new email rule POST /api/v1/rules Compatibility API synchronized with SES inbox filters. Prefer /inbox/filters. Unsupported legacy actions are rejected; migrated incompatible rules are disabled with migrationWarning.
Authentication & compatibility
Use a scoped bearer API key with email:manage. The key is bound to its user and organization.
SES email workflow and its stored mailbox/configuration data. Provider actions require configured AWS permissions and verified owned domains; receiving is opt-in.
Contract 2026-10-04. Your running instance's /api/v1/openapi.json is authoritative for its deployed release.
Request
Set MAILAT_BASE_URL to your instance origin (without /api/v1) and MAILAT_TOKEN to an appropriate credential. Replace path placeholders and example data before running. These examples do not execute in this page.
curl --request POST "$MAILAT_BASE_URL/api/v1/rules" \
--header "Authorization: Bearer $MAILAT_TOKEN" \
--header 'Content-Type: application/json' \
--data @request.jsonBuild the request from the schema below; request.json and upload paths are local placeholders.
Request body (required)
application/json
bodyobjectrequiredFields · service.CreateEmailRuleInput
actionsarrayEach itemobjectFields · service.RuleAction
typestringmove_to_folder, add_label, mark_read, mark_starred, forward, delete, auto_reply, stop_processing
valuestringFolder name, label name, forward address, etc.
activebooleanconditionLogicstringconditionsarrayEach itemobjectFields · service.RuleCondition
caseSensitivebooleanfieldstringfrom, to, subject, body, header
headerNamestringOnly for field="header"
operatorstringcontains, equals, matches, starts_with, ends_with, not_contains, not_equals
valuestringdescriptionstringidentityIdsarrayEach iteminteger (int64)namestringpriorityinteger (int64)Responses
HTTP statuses and body shapes below come from the pinned contract. Not every shared error applies to every request. Retain the original idempotency key when retrying a send.
200 · Success
Header: X-RateLimit-RemainingintegerRemaining requests in this API key's current minute window (present for API-key authentication).
minimum: 0
application/json
responseobjectFields
codeintegerrequireddataall of · nullableVariant 1objectFields · service.EmailRule
actionsarrayEach itemobjectFields · service.RuleAction
typestringmove_to_folder, add_label, mark_read, mark_starred, forward, delete, auto_reply, stop_processing
valuestringFolder name, label name, forward address, etc.
activebooleanconditionLogicstring"all" or "any"
conditionsarrayEach itemobjectFields · service.RuleCondition
caseSensitivebooleanfieldstringfrom, to, subject, body, header
headerNamestringOnly for field="header"
operatorstringcontains, equals, matches, starts_with, ends_with, not_contains, not_equals
valuestringcreatedAtstring (date-time)descriptionstringidinteger (int64)identityIdsarrayEach iteminteger (int64)lastMatchedAtall of · nullableVariant 1string (date-time)matchCountinteger (int64)migrationWarningstringnamestringorgIdinteger (int64)priorityinteger (int64)updatedAtstring (date-time)userIdinteger (int64)uuidstringmessagestringrequired400 · Invalid input
application/json
responseobjectFields
codeintegerrequiredmessagestringrequired401 · Missing, expired or revoked authentication
application/json
responseobjectFields
codeintegerrequiredmessagestringrequired403 · Insufficient permission
application/json
responseobjectFields
codeintegerrequiredmessagestringrequired404 · Resource not found
application/json
responseobjectFields
codeintegerrequiredmessagestringrequired409 · Conflict or changed idempotency payload
application/json
responseobjectFields
codeintegerrequiredmessagestringrequired410 · Recovery cursor expired; resynchronize
application/json
responseobjectFields
codeintegerrequiredmessagestringrequired429 · Rate limit exceeded; respect Retry-After
Header: Retry-AfterintegerSeconds until the next fixed-minute request window.
minimum: 1
application/json
responseobjectFields
codeintegerrequiredmessagestringrequired500 · Internal failure; retain the idempotency key
application/json
responseobjectFields
codeintegerrequiredmessagestringrequired