Smstools

Webhooks

Receive realtime callbacks about updates in Smstools.

What are webhooks?

What are webhooks?

Webhooks are an extension of an API, but instead of your code requesting data from Smstools, Smstools sends data to you. The data arrives in a web request to your application. Webhooks are also used to notify your application of events such as an incoming call or message. Since the Smstools servers need to be able to send data to your application via webhooks, you need to set up a webserver to receive the incoming HTTP requests. You also need to specify the URL of each webhook on your webserver so that data can be sent to each one.

What are webhooks?

Type Description
delivery_report Delivery report after each sent message. Sometimes there can be 2 webhooks: first a 'submitted' status and later a 'delivered' or 'not delivered' status. Sometimes there are additional details available when the message was not delivered.
read_report Read confirmation after the message is read. A read confirmation is only available for Social Messaging or by using the 'Ask for a read report' link.
inbox_message Incoming message. Only available if you are using Social Messaging or a virtual number.
call_forwarding Call forwarding. Only available if you are using Social Messaging or a virtual number.
add_contact 1 contact was added via the API or Software
delete_contact 1 contact was removed via the API or Software
add_group A group was added via the API or Software
delete_group A group was removed via the API or Software
add_optout A contact was added to the opt‑out list via the API or Software
delete_optout A contact was removed from the opt‑out list via the API or Software
funds_purchased The account has completed a new order of funds
insufficient_funds The account no longer has available funds
email2sms_received Email2Sms has received an email and attempted to send it via SMS

Delivery report detail codes Status Explanation
0 SUBMITTED This message was delivered with the operator but we did not receive any delivery report.
1 DELIVERED This message is delivered successfully.
2 NOT DELIVERED This message was not delivered. Possible reason: receiver is outside the range of the network, network problems, receiver in foreign country.
3 BUFFERED This message is delivered with the operator but not delivered with the receiver.
4 REJECTED This message is refused by the operator.
5 REJECTED Extended info below!
9 UNKNOWN There are no delivery reports available for this message.

Status Explanation
10 Receiver number is invalid or unknown
11 Receiver is temporarily outside the range of the network operator
12 Phone related problem.
13 Operator network problem
14 Message expired - reason unknown
15 Receiver is listed on a blacklist
16 Message content problem
17 Receiver cannot be settled
18 Operator refused this due to spam
19 Subscriber cannot receive premium messages (blocked by operator)

Status Explanation
2000 INSUFFICIENT_FUNDS
2001 TOO_LONG
2002 TOO_SHORT
2003 TIMEOUT
2004 GATEWAY_ISSUES
2005 INVALID_SENDER
2006 INVALID_NUMBER
4000 UNKNOWN
4001 EMPTY_MESSAGE
4002 EMPTY_CLIENT
4003 LOCKED
4004 BLOCKED
4005 JOB_FAILED
4006 DUPLICATE
4007 INVALID_CONTENT

Example: delivery report

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "delivery_report",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"message": {
	  "messageid": "e1qk89exbzgf6fzfunceym2sd67h88",
	  "datetime": "2019-01-01 00:00:00",
	  "datetime_utc": "2019-01-01 00:00:00",
	  "content": "here comes your message body",
	  "sender": "yoursender",
	  "receiver": "32470123456",
	  "reference": "yourref",
	  "delivery_code": "1",
	  "delivery_status": "delivered",
	  "delivery_status_datetime": "2019-01-01 00:00:00",
	  "delivery_code_detail": "10",
	  "delivery_code_detail_description": "Unknown Subscriber"
	}
  }
]

Example: incoming message

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "inbox_message",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"message": {
	  "id": "12345678",
	  "date": "2019-01-01 00:00:00",
	  "date_utc": "2019-01-01 00:00:00",
	  "sender": "sendernumber",
	  "receiver": "12345678",
	  "content": "message content",
	  "type": "sms",
	  "file": null,
	  "processed": 0
	},
	"isreply": {
	  "reply": true,
	  "orig_message_content": "original message content",
	  "orig_messageid": "985zvqipp73csuuha2079fbshx",
	  "orig_messagedate": "2019-01-01 00:00:00",
	  "orig_messagedate_utc": "2019-01-01 00:00:00",
	  "orig_sender": "32471123456",
	  "orig_receiver": "12345678",
	  "orig_reference": ""
	}
  }
]

Example: call forwarding

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "call_forwarding",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"message": {
	  "id": "12345678",
	  "date": "2019-01-01 00:00:00",
	  "date_utc": "2019-01-01 00:00:00",
	  "sender": "sendernumber",
	  "receiver": "12345678",
	  "content": "Incoming VOIP Call - Forwarded to XXXXX",
	  "content_type": "complete",
	  "type": "call"
	}
  }
]

Example: read confirmation report

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "read_report",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"message": {
	  "messageid": "e1qk89exbzgf6fzfunceym2sd67h88",
	  "datetime": "2019-01-01 00:00:00",
	  "datetime_utc": "2019-01-01 00:00:00",
	  "content": "here comes your message body",
	  "sender": "yoursender",
	  "receiver": "32470123456",
	  "reference": "yourref",
	  "delivery_code": "1",
	  "delivery_status": "delivered",
	  "delivery_status_datetime": "2019-01-01 00:00:00",
	  "read_status": "message_read",
	  "read_datetime": "2019-01-01 00:01:00"
	}
  }
]

Example: Add contact

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "add_contact",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"contact": {
	  "action": "add",
	  "groupid": "12345",
	  "groupname": "Groupname",
	  "receiver": "32498123456",
	  "firstname": "John",
	  "lastname": "Doe",
	  "Custom1": null,
	  "Custom2": null,
	  "Custom3": null,
	  "Custom4": null,
	  "Custom5": null,
	  "Custom6": null,
	  "Custom7": null,
	  "Custom8": null,
	  "unsubscribed": null,
	  "unsubscribe_date": null
	}
  }
]

Example: Delete contact

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "delete_contact",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"contact": {
	  "action": "delete",
	  "groupid": "12345",
	  "groupname": "Groupname",
	  "receiver": "32498123456",
	  "firstname": "John",
	  "lastname": "Doe",
	  "Custom1": null,
	  "Custom2": null,
	  "Custom3": null,
	  "Custom4": null,
	  "Custom5": null,
	  "Custom6": null,
	  "Custom7": null,
	  "Custom8": null,
	  "unsubscribed": null,
	  "unsubscribe_date": null
	}
  }
]

Example: Add group

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "add_group",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"group": {
	  "action": "add",
	  "groupid": "12345",
	  "groupname": "Groupname"
	}
  }
]

Example: Delete group

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "delete_group",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"message": {
	  "id": "12345678",
	  "date": "2019-01-01 00:00:00",
	  "content": "Group deleted",
	  "type": "group"
	}
  }
]

Example: Add opt‑out

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "add_optout",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"optout": {
	  "action": "add",
	  "id": "1234",
	  "number": "32498123456",
	  "memo": "Sample opt-out",
	  "date": "2025-08-04",
	  "date_utc": "2025-08-04"
	}
  }
]

Example: Delete opt‑out

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "delete_optout",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"optout": {
	  "action": "delete",
	  "number": "32498123456",
	  "date": "2025-08-04",
	  "date_utc": "2025-08-04"
	}
  }
]

Example: Funds purchased

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "funds_purchased",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"funds": {
	  "order_id": "1234",
	  "item_amount": 1,
	  "currency": "eur",
	  "total_price": 10,
	  "price_excl": 0,
	  "purchase_type": "credits",
	  "payment_mode": "online",
	  "reference": "Reference",
	  "date": "2025-08-04 14:33:45",
	  "date_utc": "2025-08-04 12:33:45"
	}
  }
]

Example: Insufficient funds

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "insufficient_funds",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"funds": {
	  "item_amount": "0.000",
	  "item_type": "balance",
	  "message": "Insufficient funds",
	  "date": "2025-08-04 14:34:22",
	  "date_utc": "2025-08-04 12:34:22"
	}
  }
]

Example: Email2SMS trigger

								[
  {
	"webhook_id": "a9b56720-7adc-4c78-a04d-62521d1d3b09",
	"webhook_type": "email2sms_received",
	"username": "myusername",
	"timezone": "Europe/Brussels",
	"email2sms": {
	  "sender": "[email protected]",
	  "receiver": {
		"group": false,
		"receiver": "32498123456"
	  },
	  "result": "Success",
	  "status": "Message Sent",
	  "email_message_id": "abc123def456",
	  "sms_message_id": "985zvqipp73csuuha2079fbshx",
	  "date": "2025-01-01 00:00:00",
	  "date_utc": "2025-01-01 00:00:00"
	}
  }
]