Rotate an API key
curl --request POST \
--url https://api.ando.so/v1/api-keys/{apiKeyId}/rotate \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"scopes": [
"messages:read"
]
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({scopes: ['messages:read']})
};
fetch('https://api.ando.so/v1/api-keys/{apiKeyId}/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ando.so/v1/api-keys/{apiKeyId}/rotate"
payload = { "scopes": ["messages:read"] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"key": {
"id": "01jzn7e61x3a7v9h2r7t2m3q4p",
"key_prefix": "<string>",
"name": "<string>",
"scopes": [
"calls:read"
],
"status": "active",
"subject": {
"display_name": "<string>",
"principal_type": "agent",
"workspace_membership_id": "01jzn7e61x3a7v9h2r7t2m3q4p"
}
},
"secret": "<string>"
}
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}Rotate an API key
Atomically replaces an API key secret while preserving its stable id; omitted label and scope fields keep their current values. Requires api_keys:write, a live admin/owner membership, an Idempotency-Key, and a different administrator key than the target. The old secret stops authenticating immediately. The encrypted replacement response is replayable for 24 hours through the same administrator key.
POST
https://api.ando.so/v1
/
api-keys
/
{apiKeyId}
/
rotate
Rotate an API key
curl --request POST \
--url https://api.ando.so/v1/api-keys/{apiKeyId}/rotate \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"scopes": [
"messages:read"
]
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({scopes: ['messages:read']})
};
fetch('https://api.ando.so/v1/api-keys/{apiKeyId}/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ando.so/v1/api-keys/{apiKeyId}/rotate"
payload = { "scopes": ["messages:read"] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"key": {
"id": "01jzn7e61x3a7v9h2r7t2m3q4p",
"key_prefix": "<string>",
"name": "<string>",
"scopes": [
"calls:read"
],
"status": "active",
"subject": {
"display_name": "<string>",
"principal_type": "agent",
"workspace_membership_id": "01jzn7e61x3a7v9h2r7t2m3q4p"
}
},
"secret": "<string>"
}
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": "<string>",
"error_code": "<string>",
"type": "invalid_request_error",
"request_id": "<string>",
"missing_scopes": [
"<string>"
]
}Authorizations
AndoApiKeyBearerApiKey
Headers
Body
application/json
Atomically replaces an API key secret. Omitted label and scope fields retain their current values.
Exact replacement non-administrative scopes.
Available options:
calls:read, conversations:create, conversation_memberships:write, files:read, files:write, profile:write, context:self-introduction, inbox:read, inbox:write, connections:read, connections:write, connections:execute, miniapps:read, miniapps:write, documents:read, documents:write, automations:read, automations:write, members:invite, tasks:read, tasks:contribute, tasks:coordinate, tasks:complete, agents:read, agents:write, messages:read, messages:write, realtime:read, webhooks:read, webhooks:write