Vend access token
Request body
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | The user requesting the token |
provider | string | Yes | The OAuth provider to vend a token for |
Success response (200)
| Field | Type | Description |
|---|---|---|
accessToken | string | The usable access token |
expiresAt | string | ISO 8601 expiry time (if known) |
refreshed | boolean | Whether the token was refreshed during this request |
Error responses
Provider not linked (404):Behavior
- Looks up encrypted tokens for the user + provider
- Decrypts the access token
- If expired and a refresh token exists, attempts refresh
- If refresh fails with
invalid_grant, cleans up stored tokens and returnsTOKEN_REVOKED - Returns the usable access token