Rotate API key
curl --request POST \
--url https://api.social-api.ai/v1/keys/{id}/rotate \
--header 'Authorization: <api-key>'const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.social-api.ai/v1/keys/{id}/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/keys/{id}/rotate"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"brand_ids": [
"<string>"
],
"id": "<string>",
"message": "Store this key securely. It will not be shown again.",
"name": "<string>",
"raw_key": "sapi_key_...",
"scopes": [
"posts:write",
"inbox:read"
]
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}API Keys
Rotate API key
Issues a new secret for an existing key, keeping its id, name, scopes, and brand restrictions. The old key value stops working immediately. The new raw key is shown once. Requires a full-access key or the dashboard.
POST
/
keys
/
{id}
/
rotate
Rotate API key
curl --request POST \
--url https://api.social-api.ai/v1/keys/{id}/rotate \
--header 'Authorization: <api-key>'const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.social-api.ai/v1/keys/{id}/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/keys/{id}/rotate"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"brand_ids": [
"<string>"
],
"id": "<string>",
"message": "Store this key securely. It will not be shown again.",
"name": "<string>",
"raw_key": "sapi_key_...",
"scopes": [
"posts:write",
"inbox:read"
]
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
},
"request_id": "01HZ9X3Q4R5M6N7P8V2K0W1J"
}Authorizations
Prefix your API key with "Bearer ". Example: Authorization: Bearer sapi_key_...
Path Parameters
API key ID