Create webhook endpoint
curl --request POST \
--url https://api.social-api.ai/v1/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"comment.received",
"dm.received"
],
"url": "https://example.com/webhooks/socialapi"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: ['comment.received', 'dm.received'],
url: 'https://example.com/webhooks/socialapi'
})
};
fetch('https://api.social-api.ai/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/webhooks"
payload = {
"events": ["comment.received", "dm.received"],
"url": "https://example.com/webhooks/socialapi"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"events": [
"comment.received",
"dm.received"
],
"id": "wh_01HZ9X3Q4R5M6N7P8V2K0W1J",
"message": "Store the secret securely. It will not be shown again.",
"secret": "4f3c2a1b9e8d7c6f5e4d3c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2",
"url": "https://example.com/webhooks/socialapi"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}Webhooks
Create webhook endpoint
Registers a new webhook endpoint and performs a live reachability ping. If the endpoint is unreachable or returns an unexpected response, the request fails with 400 (webhook_verification_failed). The generated secret is returned once - store it securely.
POST
/
webhooks
Create webhook endpoint
curl --request POST \
--url https://api.social-api.ai/v1/webhooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"comment.received",
"dm.received"
],
"url": "https://example.com/webhooks/socialapi"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: ['comment.received', 'dm.received'],
url: 'https://example.com/webhooks/socialapi'
})
};
fetch('https://api.social-api.ai/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/webhooks"
payload = {
"events": ["comment.received", "dm.received"],
"url": "https://example.com/webhooks/socialapi"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"events": [
"comment.received",
"dm.received"
],
"id": "wh_01HZ9X3Q4R5M6N7P8V2K0W1J",
"message": "Store the secret securely. It will not be shown again.",
"secret": "4f3c2a1b9e8d7c6f5e4d3c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2",
"url": "https://example.com/webhooks/socialapi"
}{
"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_...
Body
application/json
Endpoint config
Events is the list of event types to subscribe to.
Available options:
post.scheduled, post.published, post.failed, post.partial, post.updated, post.deleted, post.unpublished, post.retried, comment.received, dm.received, dm.sent, dm.referral, dm.postback, dm.deleted, dm.status.sent, dm.status.delivered, dm.status.read, dm.status.failed, review.received, review.updated, mention.received, account.connected, account.disconnected, account.updated, page.removed Example:
["comment.received", "dm.received"]
URL is the HTTPS endpoint that will receive webhook POST requests.
Example:
"https://example.com/webhooks/socialapi"
Response
Endpoint created
Example:
["comment.received", "dm.received"]
Example:
"wh_01HZ9X3Q4R5M6N7P8V2K0W1J"
Example:
"Store the secret securely. It will not be shown again."
Example:
"4f3c2a1b9e8d7c6f5e4d3c2b1a0f9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2"
Example:
"https://example.com/webhooks/socialapi"