Exchange a refresh token for a new ID token
curl --request POST \
--url https://web-api.dev.soxai.site/api/refreshToken \
--header 'Content-Type: application/json' \
--data '"<string>"'import requests
url = "https://web-api.dev.soxai.site/api/refreshToken"
payload = "<string>"
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify('<string>')
};
fetch('https://web-api.dev.soxai.site/api/refreshToken', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id_token": "<idToken>",
"refresh_token": "<refreshToken>",
"expires_in": "3600",
"user_id": "user123",
"token_type": "Bearer"
}{
"error": "bad-request",
"error_msg": "Invalid refresh token"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}Authentication
Exchange a refresh token for a new ID token
Not part of the Sandbox
A Sandbox key does not authenticate this endpoint and a Sandbox identity cannot complete it, because it issues or exposes credentials. It is published here because the Sandbox runs the same build. See Sandbox.
Exchange the refreshToken from POST /api/login for a fresh
idToken, without asking for the password again.
An idToken expires in about one hour and a refreshToken in about a month, so a
long-running client refreshes rather than signing in repeatedly.
Parameters
- Body: the refresh token, sent as a bare JSON value.
Response
200returns SOXAI Authentication’s answer, which carriesid_token,refresh_tokenandexpires_in.
Errors
| Status | Condition |
|---|---|
| 400 | The refresh token is invalid or has expired. Sign in again |
Authorization
- No authentication. The refresh token is the credential.
POST
/
api
/
refreshToken
Exchange a refresh token for a new ID token
curl --request POST \
--url https://web-api.dev.soxai.site/api/refreshToken \
--header 'Content-Type: application/json' \
--data '"<string>"'import requests
url = "https://web-api.dev.soxai.site/api/refreshToken"
payload = "<string>"
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify('<string>')
};
fetch('https://web-api.dev.soxai.site/api/refreshToken', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id_token": "<idToken>",
"refresh_token": "<refreshToken>",
"expires_in": "3600",
"user_id": "user123",
"token_type": "Bearer"
}{
"error": "bad-request",
"error_msg": "Invalid refresh token"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}Body
application/json
The body is of type string.
Response
SOXAI Authentication's answer, carrying a fresh id_token and the refresh_token to use next time. Send id_token as Authorization: Bearer .