GET /v1/whoami

What the key you call it with is — its project, its environment, the lines it can send from, and the command ceiling it spends.

GET /v1/whoami

The first call a new integration makes, and the one that answers "did I paste the live key or the test one?" without sending anything to anybody. It takes no body and no query parameters, and it spends no rate-limit budget of its own.

curl https://api.mapier.ai/v1/whoami \
  -H "Authorization: Bearer $MAPIER_API_KEY"
200 OK
{
  "projectId": "0192a7b0-1c2d-7e3f-8a4b-5c6d7e8f9a0b",
  "environment": "test",
  "keyId": "0192a7b0-2d3e-7f40-9b5c-6d7e8f9a0b1c",
  "lines": [
    {
      "id": "0192a7b0-3e4f-7051-8c6d-7e8f9a0b1c2d",
      "channel": "imessage",
      "address": "+19995550142",
      "status": "active",
      "capabilities": [
        "message.send.text",
        "reaction.tapback",
        "name_photo.share",
        "group.create",
        "group.update",
        "handle_check",
        "attachments",
        "receipts",
        "events.delivered",
        "events.read"
      ],
      "mode": null
    }
  ],
  "limits": { "commandsPerMinute": 600 },
  "relayAccountId": null
}

The response

Prop

Type

lines[] item

Prop

Type

limits

Prop

Type

Feature-detect on capabilities

A command type the API documents is one the platform knows, not one this line can carry. lines[].capabilities is the list to branch on: read it once at start-up, and again after a line changes, rather than trying a command to find out. A command type the line's channel never carries is refused before anything is queued (404 unsupported_command, details.reason: "not_on_channel"); one the channel carries and this line cannot is accepted and settles failed on the stream. See Capabilities.

A test line lists group.create and group.update, because its channel carries them, but the sandbox cannot perform either: both are accepted and settle failed / unsupported_capability.

lines excludes released lines: a released line has been retired from the project and cannot carry a message. A paused line is listed, and sends through it are refused until it is resumed.

The command ceiling

limits.commandsPerMinute is the ceiling your key's project spends in your key's environment: one budget for every key of the project, and one each for live and test. Read it rather than hard-coding a figure — it is your project's own ceiling when Mapier has set one, and the platform default otherwise. See Rate limits.

Errors

StatusCodeCause
401invalid_credentialsNo key, or one that is unknown, revoked or expired
409project_archivedThe project is archived
422validation_failedAn x-mapier-version this build does not answer to; details lists the ones it does in supported
429rate_limitedToo many failed authentications from your calling address — this route spends no budget of the key's own
500internal_errorAn unhandled failure, reported; details.requestId names the log line when present
503upstream_unavailableThe service could not answer right now
503service_busyThe platform had no database connection free in time and did nothing; wait details.retryAfter seconds and ask again

On this page