curl --request PATCH \
--url https://api.social-api.ai/v1/accounts/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
"comments.read",
"comments.write"
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({permissions: ['comments.read', 'comments.write']})
};
fetch('https://api.social-api.ai/v1/accounts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/accounts/{id}"
payload = { "permissions": ["comments.read", "comments.write"] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"bio": "<string>",
"brand_id": "<string>",
"connection_type": "profile",
"effective_permissions": [
"<string>"
],
"id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"login_id": "<string>",
"metadata": {},
"name": "Acme Corp",
"page_name": "<string>",
"permissions": [
"<string>"
],
"platform": "instagram",
"profile_picture_url": "<string>",
"reconnect_reason": "<string>",
"status": "active",
"username": "acmecorp"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}Update an account's permissions
Replaces the permissions of a connected account. Send null for every permission, including ones added later. Removing a permission takes effect at once and immediately deletes the comments, messages, analytics and posts not published through SocialAPI that it covers, and adding the permission back does not restore them. Posts published through SocialAPI are kept. Adding a permission takes effect at once when the platform already granted it, otherwise reconnect the account to ask for it. Check effective_permissions in the response.
curl --request PATCH \
--url https://api.social-api.ai/v1/accounts/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
"comments.read",
"comments.write"
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({permissions: ['comments.read', 'comments.write']})
};
fetch('https://api.social-api.ai/v1/accounts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/accounts/{id}"
payload = { "permissions": ["comments.read", "comments.write"] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"bio": "<string>",
"brand_id": "<string>",
"connection_type": "profile",
"effective_permissions": [
"<string>"
],
"id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"login_id": "<string>",
"metadata": {},
"name": "Acme Corp",
"page_name": "<string>",
"permissions": [
"<string>"
],
"platform": "instagram",
"profile_picture_url": "<string>",
"reconnect_reason": "<string>",
"status": "active",
"username": "acmecorp"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}Authorizations
Prefix your API key with "Bearer ". Example: Authorization: Bearer sapi_key_...
Path Parameters
Account ID
Body
New permissions
Permissions replaces the account's permissions and is required. Send null to give the account every permission, including ones added later. An empty list is rejected. Removing a permission immediately deletes the comments, messages, analytics and posts not published through SocialAPI that it covers; posts published through SocialAPI are kept. Valid values: posts.read, posts.write, comments.read, comments.write, messages.read, messages.write, reviews.read, reviews.write, analytics.read.
["comments.read", "comments.write"]
Response
OK
[optional] Profile biography or description
[always] SocialAPI brand ID this account belongs to
[optional] "profile" for a LinkedIn personal profile connected with connection_type "profile" (beta). Absent for every other account
profile "profile"
[always] The permissions this account can use right now: the requested permissions the platform supports, minus any the platform did not grant or has since refused. Uses the same names as permissions. An empty list when none apply
[always]
"acc_01HZ9X3Q4R5M6N7P8V2K0W1J"
[optional] Login id shared by accounts connected in the same authorization (e.g. facebook)
[optional] Platform-specific keys for this account
Show child attributes
Show child attributes
[always] Display name of the account or page
"Acme Corp"
[optional] Name of the single active page bound to this account; set only when exactly one page is active (e.g. facebook), so clients can label the tile with the page instead of the login identity
[always] The permissions requested for this account: one or more of posts.read, posts.write, comments.read, comments.write, messages.read, messages.write, reviews.read, reviews.write, analytics.read. null means every permission, including ones added later
[always]
"instagram"
[optional] Profile picture URL
[optional] Human-readable reason; only set when Status == "reconnect_required"
[always] One of: active, reconnect_required
"active"
[always] May equal Name on platforms without a distinct handle
"acmecorp"