Check a command

Ask whether a command would be accepted now, without sending it

POST/v1/commands/{type}/check

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

200 OK
{
  "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:

200 OK
{
  "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

StatusCodeCause
400bad_requestWith a personal access token, no x-mapier-project header
401invalid_credentialsNo key, or one that is unknown, revoked or expired
403forbiddenA personal access token not made for this environment, or whose owner's role no longer allows this
403insufficient_scopeThe key does not carry the messages:send scope
404not_foundWith a personal access token, an x-mapier-project it cannot reach
409project_archivedThe project is archived
413payload_too_largeThe body is over 65,536 bytes
422validation_failedAn x-mapier-version that is not a published version — the body's own refusals come back as accepted: false
429rate_limitedOver this route's budget; the Retry-After header says how long to wait
500internal_errorAn unexpected error on Mapier's side; quote the error's requestId to support
503service_busyMapier was too busy to take the request and did nothing; wait details.retryAfter seconds and call again
503upstream_unavailableA service behind Mapier did not answer; check again

Guide