curl --request PATCH \
--url https://api.social-api.ai/v1/accounts/{account_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
"comments.read",
"comments.write"
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({permissions: ['comments.read', 'comments.write']})
};
fetch('https://api.social-api.ai/v1/accounts/{account_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/{account_id}"
payload = { "permissions": ["comments.read", "comments.write"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"brand_id": "<string>",
"effective_permissions": [
"<string>"
],
"id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"name": "Acme Corp",
"permissions": [
"<string>"
],
"platform": "instagram",
"status": "active",
"username": "acmecorp",
"bio": "<string>",
"connection_type": "profile",
"login_id": "<string>",
"metadata": {},
"page_name": "<string>",
"profile_picture_url": "<string>",
"reconnect_reason": "<string>"
}{
"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"
}{
"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"
}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/{account_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
"comments.read",
"comments.write"
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({permissions: ['comments.read', 'comments.write']})
};
fetch('https://api.social-api.ai/v1/accounts/{account_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/{account_id}"
payload = { "permissions": ["comments.read", "comments.write"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"brand_id": "<string>",
"effective_permissions": [
"<string>"
],
"id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"name": "Acme Corp",
"permissions": [
"<string>"
],
"platform": "instagram",
"status": "active",
"username": "acmecorp",
"bio": "<string>",
"connection_type": "profile",
"login_id": "<string>",
"metadata": {},
"page_name": "<string>",
"profile_picture_url": "<string>",
"reconnect_reason": "<string>"
}{
"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"
}{
"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
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