#Subscribe

Subscribe a webhook endpoint to receive incoming messages received on your channel.

#Method

POST

#Path

/webhook-subscriptions

#Body parameters

NameValueData typeRequired?
platformA value that identifies the platform hosting the endpoint (e.g., "salesforce")StringYes
providertwlo (for Twilio SMS),
twlowa (for Twilio WhatsApp),
gswa (for Gupshup WhatsApp)
StringYes
channel_keyChannel key value from Profile & settings -> APIStringYes
subscriber_reference_idUnique identifier for the subscription. If you call the API again with the same value for this field, it will update the existing subscription.StringYes
webhook_urlWebhook endpoint URLStringURL

#Response

#HTTP status codes

CodeRemarks
200Request was successful.
400Validation error or request body was incorrectly formatted.
401Authentication failed. Check apikey header.
404Requested API endpoint not found.
429The rate limit has been reached.
500-511There was a problem processing the request on our server. Try again later.

#Response object

NameValueRemarks
statussuccess or error-
errorsArray of object { msg: [error detail] }Only present when status is error.
dataObject { id: [subscription id]}Only present when status is success

#Code sample

curl --location --request POST 'https://api.sociocs.com/webhook-subscriptions' \ --header 'apikey: your_api_key' \ --header 'Content-Type: application/json' \ --data-raw '{ "platform": "salesforce", "provider": "twlo", "channel_key": "[your channel key]", "subscriber_reference_id": "ABC1234567890XYZ", "webhook_url": "https://example.com/incoming" }'