Check an address

Works on
  • iMessage

Deprecated: use Check reachability with registered=true

POST/v1/handle-check

Deprecated: use GET /v1/reachability with registered=true

GET /v1/reachability with registered=true asks the channel the same question and answers it as registered.

Asks the channel behind a line whether an address can receive on its channel — on an iMessage line, Apple's directory. Use it to avoid sending to an address that cannot receive: a number that is Android-only, or an Apple ID that does not exist. On a WhatsApp line the answer is usually available: null: WhatsApp does not let a business check whether a number uses WhatsApp before writing to it.

Unlike commands, this is a synchronous read. The answer is in the HTTP response; nothing arrives on the stream. A check is not a send: it does not pin the address to a line or count against a line's limit of people.

Request

Prop

Type

curl https://api.mapier.ai/v1/handle-check \
  -H "Authorization: Bearer $MAPIER_API_KEY" \
  -H "x-mapier-version: 2026-12-01" \
  -H "Content-Type: application/json" \
  -d '{ "address": "+14155550100", "channel": "imessage" }'

Response

200 — reachable
{ "address": "+14155550100", "channel": "imessage", "available": true, "reason": null }
200 — not reachable
{ "address": "+14155550100", "channel": "imessage", "available": false, "reason": "not_reachable" }

On an iMessage line, available: false means Apple's directory said the address is not on iMessage. When Apple's lookup cannot give an answer for the address, the check does not answer false: it fails with 503 line_unavailable — see When the check cannot run.

Prop

Type

When the check cannot run

A 503 line_unavailable carries details.reason. None of these reasons says whether the address can receive: the question either never reached the channel or came back unusable. Mapier's reasons are listed under Error codes; on an iMessage line the channel may send its own, which reach you as details.reason unchanged:

503
{
  "error": { "code": "line_unavailable", "message": "…", "details": { "reason": "read_in_flight" } }
}

On an iMessage line, when Apple's directory has no current answer for an address, Mapier looks it up again. If that lookup still gives no answer, the check fails with details.reason: "read_failed" rather than answering available: false. Ask again later.

Reads run one at a time per line, so read_in_flight is common under concurrency. Check addresses serially, or cache the result — reachability rarely changes.

Errors

StatusCodeCause
400bad_requestThe body is not JSON, or the channel refused the request as malformed (details.reason is its word); or, with 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_foundThe channel answered not found, with its reason in details.reason; a project with no line to ask is the 503 no_line below
404unsupported_commandreason: shared_line: the line is a test line on a shared number, which does not answer this check
409project_archivedThe project is archived
413payload_too_largeBody over 65,536 bytes
422validation_failedaddress is missing or not a form the channel accepts
429rate_limited30 requests per minute, per key; the Retry-After header says how long to wait (a channel's own rate limit may give the same seconds in details.retryAfter too)
500internal_errorMapier failed on its side; give requestId to support
503no_line · line_unavailable · upstream_unavailableNo line, the line cannot ask right now (see When the check cannot run), or the channel did not answer
503service_busyMapier is busy and did nothing; wait details.retryAfter seconds and call again

Guide