Skip to content

Identity and sign-in

Who a credential belongs to, the CLI's device sign-in and handoff links.

On this page

Concepts: Agents and MCP

Endpoint summaries come from the OpenAPI document.

GET/v1/me

Identity behind the credential: team key (team, role, permissions) or project key (its project)

Operation (MCP tool)
getMe
Authentication
API key (pfa_…)OAuth token (pfo_…)Project key (pfc_…)

Responses

Responses
StatusDescriptionBody
200OKMe
401ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

POST/v1/auth/device

Start a device sign-in (RFC 8628); the user approves at verificationUri

Operation (MCP tool)
startDeviceAuthorization
Authentication
No credentials

Request body

application/jsonobjectOptional

Request body
NameTypeDescription
clientNameOptionalstringmax length 80
accessOptionalAccessProfile

Responses

Responses
StatusDescriptionBody
201CreatedDeviceAuthorization
400ProblemProblem (RFC 9457)
429ProblemProblem (RFC 9457)
503ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

POST/v1/auth/device/token

Exchange an approved device code for a CLI API key (once). 400 authorization_pending | slow_down | access_denied | expired_token

Operation (MCP tool)
pollDeviceAuthorization
Authentication
No credentials

Request body

application/jsonobjectRequired

Request body
NameTypeDescription
deviceCodeRequiredstring

Responses

Responses
StatusDescriptionBody
200ApprovedDeviceToken
400ProblemProblem (RFC 9457)
429ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

POST/v1/auth/handoff

Exchange a one-time handoff link (pfh_…) for an agent key limited to one project

Operation (MCP tool)
exchangeHandoff
Authentication
No credentials

Request body

application/jsonobjectRequired

Request body
NameTypeDescription
tokenRequiredstringThe handoff link or its pfh_… token

Responses

Responses
StatusDescriptionBody
200Key issuedDeviceToken
400ProblemProblem (RFC 9457)
429ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

POST/v1/auth/logout

Revoke the calling API key

Operation (MCP tool)
logout
Authentication
API key (pfa_…)OAuth token (pfo_…)

Responses

Responses
StatusDescriptionBody
204RevokedNo content
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.