Refresh an access token
POST
/partner/authorization/token/refresh
const url = 'https://client-api.abi.ai/partner/authorization/token/refresh';const options = { method: 'POST', headers: { 'refresh-token': 'Bearer eyJhbGciOi...', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"subPartnerName":"partner_test"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://client-api.abi.ai/partner/authorization/token/refresh \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'refresh-token: Bearer eyJhbGciOi...' \ --data '{ "subPartnerName": "partner_test" }'Exchange the refresh token for a new access token. Send the refresh token in the refresh-token header using the Bearer scheme. Include subPartnerName in the optional JSON body only when the refreshed token must be scoped to a configured sub-partner.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”refresh-token
required
string format: password
Refresh token sent as a Bearer token.
Example
Bearer eyJhbGciOi...Request Body
Section titled “Request Body”Media typeapplication/json
Optional body used to scope the refreshed token to a configured sub-partner. The refresh token is sent in the refresh-token header, not in this body.
object
subPartnerName
Exact registered sub-partner name to scope the refreshed token.
string
Example
partner_testResponses
Section titled “Responses”Access and refresh tokens renewed.
Media typeapplication/json
object
access_token
Bearer token for authenticated API requests.
string
token_type
string
refresh_token
Token used to obtain a replacement access token.
string
Example
{ "access_token": "your_access_token", "token_type": "Bearer", "refresh_token": "your_refresh_token"}Request could not be completed.
Media typeapplication/json
object
code
Short machine-readable error code.
string
message
Human-readable explanation of the error.
string
Examplegenerated
{ "code": "example", "message": "example"}