Create a webhook endpoint (portal session)
POST
/api/webhooks
curl --request POST \ --url https://api.sipstack.com/api/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com/sipstack-webhook", "events": [ "message.delivered", "message.failed" ] }'import requests
url = "https://api.sipstack.com/api/webhooks"
payload = { "url": "https://example.com/sipstack-webhook", "events": ["message.delivered", "message.failed"]}headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const url = 'https://api.sipstack.com/api/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://example.com/sipstack-webhook","events":["message.delivered","message.failed"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}import axios from 'axios';
const options = { method: 'POST', url: 'https://api.sipstack.com/api/webhooks', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, data: { url: 'https://example.com/sipstack-webhook', events: ['message.delivered', 'message.failed'] }};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}Registers an endpoint URL for the given event types. The signing
secret is returned only in this response — you need it to verify
the X-Webhook-Signature header on deliveries.
Portal admin-console surface, authenticated with the portal session
(JWT/cookie). For server-to-server API-key access see the
Webhooks (API key) tag.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
url
required
string format: uri
Example
https://example.com/sipstack-webhook events
required
Array<string>
Example
[ "message.delivered", "message.failed"]Responses
Section titled “ Responses ”Endpoint created — data.secret is shown once.
Media type application/json
object
success
boolean
message
string
data
object
uuid
string format: uuid
url
string
events
Array<string>
secret
HMAC signing secret — shown only here.
string
Example generated
{ "success": true, "message": "example", "data": { "uuid": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "url": "example", "events": [ "example" ], "secret": "example" }}Missing/invalid URL or empty events array.
Not an owner/admin, or webhooks not on your plan.