Skip to main content

Managing Webhooks

You can use the API to programmatically manage which webhook events are delivered to your endpoint — list available events, check which are enabled, and enable or disable individual events.

Webhook URL Required

Before using these endpoints, the Webhooks integration must be set up via the dashboard with a webhook URL. The API manages event subscriptions only — it does not set or change the webhook URL itself.

Required Scopes

  • webhooks.read — List available and enabled webhook events
  • webhooks.write — Enable or disable webhook events

List Available Events

Retrieve the full list of event types that can be subscribed to:

curl "https://app.sipsim.com/api/v2/webhooks/available" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

{
"status": 200,
"request_id": "...",
"timestamp": "2025-01-15T10:30:00Z",
"data": [
{ "event": "incoming_call_start" },
{ "event": "incoming_call_start_chain_member_call" },
{ "event": "incoming_call_end_chain_member_call" },
{ "event": "incoming_call_answer" },
{ "event": "incoming_call_end" },
{ "event": "outgoing_call_start" },
{ "event": "outgoing_call_answer" },
{ "event": "outgoing_call_end" },
{ "event": "voicemail" },
{ "event": "tags" },
{ "event": "speech" },
{ "event": "summary" },
{ "event": "sms" },
{ "event": "rating" }
]
}

List Enabled Events

Retrieve only the events your webhook is currently subscribed to:

curl "https://app.sipsim.com/api/v2/webhooks" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

{
"status": 200,
"request_id": "...",
"timestamp": "2025-01-15T10:30:00Z",
"data": [
{ "event": "incoming_call_start" },
{ "event": "incoming_call_end" }
]
}

Enable an Event

Subscribe to a specific event by name:

curl -X POST "https://app.sipsim.com/api/v2/webhooks/outgoing_call_end" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

The response includes the full current webhook setting:

{
"status": 200,
"request_id": "...",
"timestamp": "2025-01-15T10:30:00Z",
"data": {
"webhook_url": "https://example.com/webhooks/sipsim",
"enabled": true,
"subscribed_events": [
"incoming_call_start",
"incoming_call_end",
"outgoing_call_end"
]
}
}
Idempotent

Enabling an event that is already enabled has no effect — the call succeeds without duplicating the subscription.

Disable an Event

Unsubscribe from a specific event:

curl -X DELETE "https://app.sipsim.com/api/v2/webhooks/incoming_call_start" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response Format

The enable and disable endpoints return the WebhookSetting object:

FieldTypeDescription
webhook_urlstringYour configured webhook endpoint URL
enabledbooleanWhether the webhook integration is active
subscribed_eventsarrayList of currently enabled event names

Error Handling

Webhook Integration Not Configured (404)

If the Webhooks integration has not been set up via the dashboard:

{
"status": 404,
"errors": ["Webhook integration not configured. Set a webhook URL via the dashboard first."],
"request_id": "...",
"timestamp": "2025-01-15T10:30:00Z",
"path": "/api/v2/webhooks"
}

Solution: Set up the Webhooks integration from the dashboard first. The API cannot create the Webhooks integration — it can only manage event subscriptions for an existing one.

Unknown Event (400)

If you try to enable or disable an event name that doesn't exist:

{
"status": 400,
"errors": ["Unknown event 'invalid_event'. Use GET /api/v2/webhooks/available for the list of valid events."],
"request_id": "...",
"timestamp": "2025-01-15T10:30:00Z",
"path": "/api/v2/webhooks/invalid_event"
}

Solution: Use the list available events endpoint to see valid event names.

Bulk Enable Example

To subscribe to all available events at once:

import requests

access_token = "YOUR_ACCESS_TOKEN"
headers = {"Authorization": f"Bearer {access_token}"}

available = requests.get(
"https://app.sipsim.com/api/v2/webhooks/available",
headers=headers
).json()["data"]

for event in available:
requests.post(
f"https://app.sipsim.com/api/v2/webhooks/{event['event']}",
headers=headers
)
print(f"Enabled: {event['event']}")

print("All events enabled.")

Next Steps