Ask for a sign-in link, as an AI assistant without a browser
OpenAPI JSONconst url = 'https://api.eu.apigami.com/v1/device/code';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"agent_name":"AI agent"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.eu.apigami.com/v1/device/code \ --header 'Content-Type: application/json' \ --data '{ "agent_name": "AI agent" }'Opens an agent sign-in: the words of RFC 8628, without its grant. Give the person verification_uri_complete and tell them to choose match_number there; they sign in on https://app.apigami.com/agent, from any device, pick that number among three, and approve. Another number denies the request. Then poll POST /v1/device/token with device_code. The body is read as JSON, even without a Content-Type, or as a form; grant_type and client_id are ignored. Guide, with a polling loop and the settings of each MCP client: https://www.apigami.com/docs/mcp/#agent-sign-in
Request Body
Section titled “Request Body”object
How the person will recognise you on the page and in their account: “. _ ( ) -, never a domain nor the word Apigami.
Responses
Section titled “Responses”The link to give the person, and what to poll with.
object
What you poll with. Keep it to yourself: whoever holds it collects the token once the person approved.
Eight letters in two groups, carried by the link. Typed by the person only when they open verification_uri without it.
The link to give the person.
The number to give the person with the link: the page offers it among three, and another one denies the request.
Seconds the person has to decide: 900.
Seconds to wait between two polls.
What to do next, in English.
Example
{ "device_code": "p3Qx…", "user_code": "WDJB-MJHT", "verification_uri": "https://app.apigami.com/agent", "verification_uri_complete": "https://app.apigami.com/agent?code=WDJB-MJHT", "match_number": 25, "expires_in": 900, "interval": 5, "message": "Give the user this link and tell them to choose 25 on the page. …"}agent_name breaks the rule the description states.
object
What to do next, in English.
With authorization_pending and slow_down: the seconds to wait before polling again.
Example
{ "error": "invalid_request", "error_description": "agent_name takes 1 to 60 characters among letters, digits, space and . _ ( ) -, and names neither a domain nor Apigami: use \"<client> on <machine or project>\", for example \"Claude Code on ada-laptop\"."}Too many requests from this network, with Retry-After. Keep polling the request you already have instead of opening another.
object
What to do next, in English.
With authorization_pending and slow_down: the seconds to wait before polling again.
Example
{ "error": "too_many_requests", "error_description": "Too many agent sign-in requests from this network. Retry after 60 s. Meanwhile keep polling the request you already have instead of opening a new one."}