Check a command
Ask whether a command would be accepted now, without sending it
Would POST /v1/commands/{type} with this same body and these same headers be
accepted now? The check runs every rule the send runs, in the same order, and
sends nothing, writes nothing and never uses up the Idempotency-Key. Use it to
decide before you send: which line a send would use, whether the person can be
reached on it, and what options.degrade: "adapt" would change.
The answer is always 200. accepted: false carries refusal, the exact error
body the send would answer with, so one handler reads both. A media link is not
fetched, so a link the send cannot fetch is accepted here and refused by the
send. A check spends the project's command budget as a send does.
Example request
curl -X POST https://api.mapier.ai/v1/commands/message.send/check \
-H "Authorization: Bearer $MAPIER_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-4821-shipped" \
-H "x-mapier-version: 2026-12-01" \
-d '{"target": {"conversationId": "a0000000-0000-4000-8000-000000000001"}, "payload": {"text": "Your order shipped."}}'Response
{
"accepted": true,
"line": {
"id": "0192a7b0-3e4f-7051-8c6d-7e8f9a0b1c2d",
"selection": "reused_active_chat"
},
"channel": "imessage",
"adaptations": []
}A refused check names the refusal the send would answer with:
{
"accepted": false,
"refusal": {
"error": {
"code": "recipient_not_allowed",
"message": "That person replied STOP. They opt back in by texting START or writing to this project again; until then this project cannot message them.",
"details": { "reason": "opted_out", "channel": "imessage" },
"requestId": "0192c4e1-8b3c-7d4e-9f50-6a7b8c9d0e1f",
"docUrl": "https://docs.mapier.ai/convo/api/errors#recipient_not_allowed.opted_out",
"retryable": false
}
},
"line": null,
"channel": null
}Only a refusal of the check itself is an error status: a key that is not
valid, a body over the size limit, an unknown version, a key without
messages:send, or a spent command budget.
Errors
| Status | Code | Cause |
|---|---|---|
400 | bad_request | With a personal access token, no x-mapier-project header |
401 | invalid_credentials | No key, or one that is unknown, revoked or expired |
403 | forbidden | A personal access token not made for this environment, or whose owner's role no longer allows this |
403 | insufficient_scope | The key does not carry the messages:send scope |
404 | not_found | With a personal access token, an x-mapier-project it cannot reach |
409 | project_archived | The project is archived |
413 | payload_too_large | The body is over 65,536 bytes |
422 | validation_failed | An x-mapier-version that is not a published version — the body's own refusals come back as accepted: false |
429 | rate_limited | Over this route's budget; the Retry-After header says how long to wait |
500 | internal_error | An unexpected error on Mapier's side; quote the error's requestId to support |
503 | service_busy | Mapier was too busy to take the request and did nothing; wait details.retryAfter seconds and call again |
503 | upstream_unavailable | A service behind Mapier did not answer; check again |