portal
Exchange portal code
Exchange a short-lived code for a long-lived portal access token.
This endpoint is unauthenticated. The code itself serves as proof of authorization. Each code can only be redeemed once; subsequent attempts return 401.
The returned access token is valid for 24 hours and should be stored as an httpOnly cookie or used in the Authorization header for subsequent API calls.
post/v2/portal.exchangeCode
Request body
Example request
{
"code": "pst_abc123def456"
}Response
Code exchanged successfully. Use the returned access token for subsequent API calls.
Example response
{
"meta": {
"requestId": "req_123"
},
"data": {
"accessToken": "pat_xyz789abc123",
"expiresAt": 1711386400000
}
}