Skip to main content
POST
Exchange an authorization code for a grant

Authorizations

Authorization
string
header
required

OAuth 2.0 client credentials. Request a token from the token endpoint of the identity provider's domain (https://{cognito-domain}/oauth2/token, with HTTP Basic client authentication) and send it as a Bearer token. Production uses auth.mypilotindex.com. The sandbox uses the dev environment's Cognito domain, which is given to the partner with its sandbox credential. A token carries only the scopes the partner was approved for.

Body

application/json

Maximum 4096 bytes. Exactly code, code_verifier and redirect_uri, every one a string; unknown or repeated members are rejected.

code
string
required

The code the consent appended to the redirect URI.

code_verifier
string
required

The PKCE verifier whose S256 challenge the partner sent with the consent request.

Required string length: 43 - 128
redirect_uri
string
required

The redirect URI of the consent request, exactly.

Response

The grant the code opened.

grant_id
string<uuid>
required

The grant every later call names.

pilot
object
required

The pilot. id is his pairwise id at this partner. name, username and avatar_url are present only with the profile scope, each null when he has none.

scopes
enum<string>[]
required

The scopes the pilot granted, sorted.

A scope the pilot granted, without the partner/ prefix of the token's scopes.

Available options:
profile,
score,
hours.read,
hours.write,
licenses,
applications