Renew an API token
import requests
url = "https://platform.ankra.app/api/v1/org/account/tokens/{token_id}/rotate"
payload = { "overlap_hours": 24 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({overlap_hours: 24})
};
fetch('https://platform.ankra.app/api/v1/org/account/tokens/{token_id}/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/account/tokens/{token_id}/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"overlap_hours": 24
}
'{
"expires_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"old_token_valid_until": "2023-11-07T05:31:56Z",
"replaced_token_id": "<string>",
"token": "<string>",
"scopes": [
"<string>"
],
"type": "Bearer"
}Account Tokens
Renew an API token
Mints a replacement for one of the calling user’s API tokens with the same name, scopes, project pin and lifetime, returns the new value once, and keeps the old token valid for overlap_hours (default 24, 0 to 168) before it stops by itself. The old token is renamed with a -replaced- suffix. Its expiry notices close.
POST
/
api
/
v1
/
org
/
account
/
tokens
/
{token_id}
/
rotate
Renew an API token
import requests
url = "https://platform.ankra.app/api/v1/org/account/tokens/{token_id}/rotate"
payload = { "overlap_hours": 24 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({overlap_hours: 24})
};
fetch('https://platform.ankra.app/api/v1/org/account/tokens/{token_id}/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/account/tokens/{token_id}/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"overlap_hours": 24
}
'{
"expires_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"old_token_valid_until": "2023-11-07T05:31:56Z",
"replaced_token_id": "<string>",
"token": "<string>",
"scopes": [
"<string>"
],
"type": "Bearer"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Required range:
0 <= x <= 168