Create API key
curl --request POST \
--url https://api.social-api.ai/v1/keys \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"brand_ids": [
"<string>"
],
"name": "My App",
"scopes": [
"posts:write",
"inbox:read"
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({brand_ids: ['<string>'], name: 'My App', scopes: ['posts:write', 'inbox:read']})
};
fetch('https://api.social-api.ai/v1/keys', 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"
payload = {
"brand_ids": ["<string>"],
"name": "My App",
"scopes": ["posts:write", "inbox:read"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, 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
Create API key
Generates a new API key for the authenticated user. Optionally restrict it to a set of scopes (see GET /keys/scopes) and/or brands. Empty scopes or brand_ids mean unrestricted.
POST
/
keys
Create API key
curl --request POST \
--url https://api.social-api.ai/v1/keys \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"brand_ids": [
"<string>"
],
"name": "My App",
"scopes": [
"posts:write",
"inbox:read"
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({brand_ids: ['<string>'], name: 'My App', scopes: ['posts:write', 'inbox:read']})
};
fetch('https://api.social-api.ai/v1/keys', 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"
payload = {
"brand_ids": ["<string>"],
"name": "My App",
"scopes": ["posts:write", "inbox:read"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, 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_...
Body
application/json
Key name and optional restrictions