Unpublish a post
curl --request POST \
--url https://api.social-api.ai/v1/posts/{pid}/unpublish \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: 'acc_01HZ9X3Q4R5M6N7P8V2K0W1J'})
};
fetch('https://api.social-api.ai/v1/posts/{pid}/unpublish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/posts/{pid}/unpublish"
payload = { "account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true
}{
"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": {}
}
}Posts
Unpublish a post
Unpublishes a published post from a specific account (if account_id provided) or all accounts.
POST
/
posts
/
{pid}
/
unpublish
Unpublish a post
curl --request POST \
--url https://api.social-api.ai/v1/posts/{pid}/unpublish \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: 'acc_01HZ9X3Q4R5M6N7P8V2K0W1J'})
};
fetch('https://api.social-api.ai/v1/posts/{pid}/unpublish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/posts/{pid}/unpublish"
payload = { "account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true
}{
"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
Post ID
Body
application/json
Optional account_id to unpublish from
AccountID optionally scopes the unpublish to a single platform target.
Example:
"acc_01HZ9X3Q4R5M6N7P8V2K0W1J"
Response
Post unpublished
Example:
true