Start a sign-in from a terminal
Get a code a person approves in the console; no credential needed
Starts a sign-in for a command-line tool. It takes no credential and reads no
x-mapier-version. Show the person userCode and verificationUrl, or open
verificationUrlComplete, which has the code filled in. They sign in to the
console, choose an organization and approve. Meanwhile, poll
POST /v1/cli/logins/token with deviceCode
every interval seconds.
The login works once, for 10 minutes. Keep deviceCode inside the tool and
never show it: whoever holds it receives the token once the person approves.
Body
The body is optional. deviceName is what to call this machine: the token is
named CLI on <deviceName>, or CLI without one. It keeps letters, digits,
spaces and . - _ ( ) @ ', at most 64 characters, and drops anything else. The
person approving sees it marked as sent by this request, not checked.
Example request
curl -X POST https://api.mapier.ai/v1/cli/logins \
-H "Content-Type: application/json" \
-d '{ "deviceName": "build-box" }'Response
{
"deviceCode": "mp_cli_example-not-a-real-device-code",
"userCode": "KQ7M-2PXD",
"verificationUrl": "https://convo.mapier.ai/app/cli",
"verificationUrlComplete": "https://convo.mapier.ai/app/cli?code=KQ7M-2PXD",
"expiresAt": "2026-09-02T14:20:00.000Z",
"expiresIn": 600,
"interval": 5
}Errors
| Status | Code | Reason | When | Channels |
|---|---|---|---|---|
| 400 | bad_request | The body is not valid JSON, the channel rejected the request as malformed, or a header the call needs is missing. | All | |
| 413 | payload_too_large | The body is over 65,536 bytes. | All | |
| 422 | validation_failed | A field is wrong, and details names each one at its path. | All | |
| 429 | rate_limited | Too many requests for this route's budget. | All | |
| 500 | internal_error | Mapier failed on its side, and has been alerted. | All | |
| 503 | service_busy | Mapier is busy and did nothing with this request. details.retryAfter says how many seconds to wait. | All | |
| 503 | upstream_unavailable | The channel did not take the command, or gave no answer Mapier could use. | All |