Preview: SendMock has no stable release yet. These docs follow develop.

API reference

Numbers

POST/api/v1/numbers

Add a number.

CLI
sendmock numbers add
MCP tool
sendmock_number_upsert
In the app
Numbers > Add number

Request body (application/json)

VirtualNumberInput : Body of POST and PATCH /api/v1/numbers.

FieldTypeDescription
numberstring
E.164, without a channel prefix; channels says whether WhatsApp works.Example: +15550001111
labelstring
A name for the number, e.g. the app or feature that uses it.Example: Support line
channelsNumberChannel[]
Where the number works: sms, whatsapp or both.One of: sms, whatsapp
inbound_urlstring | null
Reply webhook (Twilio "A message comes in"); null means rules only.Example: http://localhost:3000/sms/inbound
inbound_methodInboundWebhookMethod
The HTTP method of the reply webhook.One of: POST, GETExample: POST
inbound_fallback_urlstring | null
Called when the reply webhook fails, with ErrorCode and ErrorUrl added, as Twilio does.Example: http://localhost:3000/sms/inbound-fallback
inbound_template_idstring | null
Payload template for the inbound webhook, e.g. twilio.inbound_sms.Example: twilio.inbound_sms
status_callback_urlstring | null
Your app's URL for status changes of messages sent from this number.Example: http://localhost:3000/sms/status
messaging_service_sidstring | null
The Messaging Service this number belongs to, MG...; null for none.Example: MG00000000000000000000000000000001

Answer

201 VirtualNumber

Errors: 400, as { error: { code, message } }

Try it in Demo mode

PATCH/api/v1/numbers/{numberId}

Change a number.

CLI
sendmock numbers update <numberId>
MCP tool
sendmock_number_upsert
In the app
Numbers > Edit

Request body (application/json)

VirtualNumberInput : Body of POST and PATCH /api/v1/numbers.

FieldTypeDescription
numberstring
E.164, without a channel prefix; channels says whether WhatsApp works.Example: +15550001111
labelstring
A name for the number, e.g. the app or feature that uses it.Example: Support line
channelsNumberChannel[]
Where the number works: sms, whatsapp or both.One of: sms, whatsapp
inbound_urlstring | null
Reply webhook (Twilio "A message comes in"); null means rules only.Example: http://localhost:3000/sms/inbound
inbound_methodInboundWebhookMethod
The HTTP method of the reply webhook.One of: POST, GETExample: POST
inbound_fallback_urlstring | null
Called when the reply webhook fails, with ErrorCode and ErrorUrl added, as Twilio does.Example: http://localhost:3000/sms/inbound-fallback
inbound_template_idstring | null
Payload template for the inbound webhook, e.g. twilio.inbound_sms.Example: twilio.inbound_sms
status_callback_urlstring | null
Your app's URL for status changes of messages sent from this number.Example: http://localhost:3000/sms/status
messaging_service_sidstring | null
The Messaging Service this number belongs to, MG...; null for none.Example: MG00000000000000000000000000000001

Answer

200 VirtualNumber

Errors: 400, 404, as { error: { code, message } }

Try it in Demo mode

POST/api/v1/messaging-services

Add a Messaging Service.

CLI
sendmock sms services create
MCP tool
sendmock_messaging_service_create
In the app
Numbers > Messaging Services > New Messaging Service

Request body (application/json)

MessagingServiceInput : Body of POST and PATCH /api/v1/messaging-services.

FieldTypeDescription
friendly_namestring
A name for the service.Example: Notifications
number_idsUlid[]
The virtual numbers in the sender pool, by ID.
inbound_modeMessagingServiceInboundMode
What happens to inbound messages: webhook (call inbound_url), defer_to_sender (each number's own webhook) or drop.One of: webhook, defer_to_sender, dropExample: webhook
inbound_urlstring | null
Used when inbound_mode is webhook.Example: http://localhost:3000/sms/inbound
inbound_fallback_urlstring | null
Called when inbound_url fails.Example: http://localhost:3000/sms/inbound-fallback

Answer

201 MessagingService

Errors: 400, as { error: { code, message } }

Try it in Demo mode

PATCH/api/v1/messaging-services/{serviceSid}

Change a Messaging Service.

CLI
sendmock sms services update <serviceSid>
MCP tool
sendmock_messaging_service_update
In the app
Numbers > Messaging Services > Edit

Request body (application/json)

MessagingServiceInput : Body of POST and PATCH /api/v1/messaging-services.

FieldTypeDescription
friendly_namestring
A name for the service.Example: Notifications
number_idsUlid[]
The virtual numbers in the sender pool, by ID.
inbound_modeMessagingServiceInboundMode
What happens to inbound messages: webhook (call inbound_url), defer_to_sender (each number's own webhook) or drop.One of: webhook, defer_to_sender, dropExample: webhook
inbound_urlstring | null
Used when inbound_mode is webhook.Example: http://localhost:3000/sms/inbound
inbound_fallback_urlstring | null
Called when inbound_url fails.Example: http://localhost:3000/sms/inbound-fallback

Answer

200 MessagingService

Errors: 400, 404, as { error: { code, message } }

Try it in Demo mode