Renew a service token
import requests
url = "https://platform.ankra.app/api/v1/org/organisation/service-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/organisation/service-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/organisation/service-tokens/{token_id}/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"overlap_hours": 24
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token": "<string>",
"name": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_name": "<string>",
"label": "<string>",
"role_slug": "<string>",
"expires_at": "<string>",
"type": "<string>",
"scopes": [
"<string>"
],
"replaced_token_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"old_token_valid_until": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Organisation IAM
Renew a service token
Mints a replacement with the same account, role, scopes and pin and returns its secret once; the old token keeps working for overlap_hours (default 24, at most 168). The body is optional. Requires members.manage.
POST
/
api
/
v1
/
org
/
organisation
/
service-tokens
/
{token_id}
/
rotate
Renew a service token
import requests
url = "https://platform.ankra.app/api/v1/org/organisation/service-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/organisation/service-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/organisation/service-tokens/{token_id}/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"overlap_hours": 24
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token": "<string>",
"name": "<string>",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_name": "<string>",
"label": "<string>",
"role_slug": "<string>",
"expires_at": "<string>",
"type": "<string>",
"scopes": [
"<string>"
],
"replaced_token_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"old_token_valid_until": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Required range:
0 <= x <= 168Response
The replacement token
The replacement secret, returned only this once.