simtrunkDocs

Webhooks

Every call, message, line, SIM bank and trunk change as an event, posted to your URL.

Webhooks post each event to a URL of yours as it happens. Add one under Webhooks in the dashboard, or through the API. Webhooks come with the Team plan (up to 10) and the Business plan (up to 50).

Add a webhook

Choose the URL, the topics (or * for all) and a secret, so you can check that a delivery came from simtrunk.

Terminal
curl https://api.simtrunk.com/v1/webhooks \  -H "Authorization: Bearer $SIMTRUNK_API_KEY" \  -H "Content-Type: application/json" \  -d '{"url": "https://example.com/simtrunk", "topics": ["simtrunk.call.missed", "simtrunk.sms.received"], "secret": "…"}'

GET /v1/webhooks/{id}/deliveries lists a webhook's deliveries, and POST /v1/notify/test sends a simtrunk.test event. The key needs webhooks:write (and settings:write for the test).

The event

Every event has the same envelope; data holds the topic's own fields.

FieldTypeWhat
idstringThe event's ID: the same event delivered again has the same ID.
eventstringThe topic.
titlestringThe event in words.
timetimestampWhen it happened (RFC 3339, UTC).
linestring (optional)The line's ID, for a line's event.
line_namestring (optional)The line's display name.
bodystring (optional)The event's text, for a person (an SMS, a USSD answer).
fieldsobject (optional)What a person reads of it, by label.
dataobject (optional)The topic's own fields (below).
simtrunk.sms.received
{  "id": "evt_…",  "event": "simtrunk.sms.received",  "title": "SMS received",  "time": "2026-12-01T09:30:00Z",  "line": "ln_…",  "line_name": "Sales",  "body": "Is the shop open today?",  "data": {    "message_id": 42,    "direction": "in",    "peer": "+243900000000",    "text": "Is the shop open today?"  }}

Topics

Calls

TopicWhen
simtrunk.call.incomingIncoming call ringing
simtrunk.call.outgoingOutgoing call started
simtrunk.call.answeredCall answered
simtrunk.call.endedCall ended
simtrunk.call.missedMissed call
simtrunk.call.failedOutgoing call failed

SMS and USSD

TopicWhen
simtrunk.sms.receivedSMS received
simtrunk.sms.sentSMS sent
simtrunk.sms.failedSMS failed
simtrunk.ussd.sentUSSD sent
simtrunk.ussd.answeredUSSD answered
simtrunk.ussd.failedUSSD failed
simtrunk.ussd.networkUSSD from the network

Lines

TopicWhen
simtrunk.line.createdLine created
simtrunk.line.updatedLine updated
simtrunk.line.deletedLine deleted
simtrunk.line.enabledLine enabled
simtrunk.line.disabledLine disabled
simtrunk.line.registeredLine registered to the network
simtrunk.line.unregisteredLine lost its registration
simtrunk.line.downLine down
simtrunk.line.recoveredLine recovered

SIM banks, SIMs and devices

TopicWhen
simtrunk.bank.addedSIM bank added
simtrunk.bank.updatedSIM bank updated
simtrunk.bank.removedSIM bank removed
simtrunk.bank.enrolledSIM bank enrolled
simtrunk.bank.connectedSIM bank connected
simtrunk.bank.disconnectedSIM bank disconnected
simtrunk.sim.insertedSIM inserted
simtrunk.sim.removedSIM removed
simtrunk.device.addedReader or modem added
simtrunk.device.removedReader or modem removed

eSIM profiles

TopicWhen
simtrunk.esim.profile.enabledeSIM profile enabled
simtrunk.esim.profile.disabledeSIM profile disabled
simtrunk.esim.profile.downloadedeSIM profile downloaded
simtrunk.esim.profile.download_failedeSIM download failed
simtrunk.esim.profile.deletedeSIM profile deleted

SIP trunks

TopicWhen
simtrunk.trunk.createdTrunk created
simtrunk.trunk.updatedTrunk updated
simtrunk.trunk.deletedTrunk deleted
simtrunk.trunk.registeredTrunk registered
simtrunk.trunk.registration_failedTrunk registration failed

SIP users and phones

TopicWhen
simtrunk.sip_user.createdSIP user created
simtrunk.sip_user.deletedSIP user deleted
simtrunk.sip_user.device.registeredPhone registered
simtrunk.sip_user.device.unregisteredPhone unregistered

Your account

TopicWhen
simtrunk.settings.updatedSettings changed
simtrunk.tenant.suspendedAccount suspended
simtrunk.tenant.resumedAccount resumed
simtrunk.testTest event

The fields of each topic are in the dashboard and at GET /v1/notify/topics.

How is this guide?

Last updated on

On this page