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

Authorizations

x-paygent-connect-app-key
string
header
required

A Connect app key (pgc_app_…), identifying the registered third-party app. Always presented together with connectGrant — the pair is one credential, and either half alone is refused. Accepted on the /connect/* surface only.

Body

application/json
code
string
required
Maximum string length: 256
redirectUri
string
required

The same URI the code was issued for. Compared byte for byte.

Maximum string length: 2048

Response

The grant. Its token is on this response only.

id
string<uuid>
required
appId
string<uuid>
required
deploymentId
string<uuid>
required
scopes
string[]
required

Checked on every Connect route, even while there is only one.

grantTokenMasked
string
required

Enough to recognise the token, never enough to use it.

createdAt
string<date-time>
required
expiresAt
string<date-time>
required

Grants age out at ninety days, like every other credential here.

grantToken
string
required

The plaintext pgc_grant_… token, on this response only. Present it together with the app key on every Connect call.

environment
enum<string>
required

The app's world, restated where the credential is handed over so an integration can assert it is holding the kind of key it thinks it is. Here and not on the base grant shape: the consumer console's grant lists have no use for it.

Available options:
sandbox,
live
lastUsedAt
string<date-time> | null
revokedAt
string<date-time> | null