Contents

Inbound & opt-outs

Receive replies, handle STOP and START, and test before a number is live.

When someone replies to a number SMS21 has assigned to you, the reply is stored and sent to your webhooks, and SMS21 acts on opt-out keywords for you. Replies arrive on the same provider callback URL as delivery reports, so there is nothing extra to configure.

Numbers are assigned by SMS21

Inbound numbers are provisioned with the provider and assigned to one project. Ask support for a number; it then appears on your replies as to.

STOP and START are handled for you

Only the first word counts, upper-cased and without punctuation — Stop please. is a STOP. A STOP word adds the sender to your opt-out list, which every bulk campaign already honours; a START word removes them. Everything else is stored and forwarded untouched: SMS21 does not interpret your customers’ messages.

Reply starts withWhat SMS21 doesaction
STOP, UNSUBSCRIBE, CANCEL, END, QUIT, OPTOUTAdds the sender to your opt-out listopt_out
START, UNSTOP, SUBSCRIBE, OPTINRemoves them from itopt_in
Anything elseStores and forwards the replynone

Read replies

FieldTypeDescription
fromstringoptionalOnly replies from this number.
tostringoptionalOnly replies to this number of yours.
actionstringoptionalnone, opt_out or opt_in.
receivedFrom / receivedTostringoptionalISO 8601 bounds on arrival time.
curl "https://sms21.in/v1/inbound?action=opt_out" -H "X-API-Key: $SMS21_API_KEY"

The message.received webhook

Subscribe an endpoint to message.received to get replies as they arrive. Unlike the message.* status events, this payload carries the sender’s number and the text: that is the message being delivered to you. Verify the signature exactly as for other webhooks.

{
  "id": "evt_…",
  "event": "message.received",
  "timestamp": "2026-09-16T10:30:00.000Z",
  "inboundId": "inb_…",
  "from": "919876543210",
  "to": "919812345678",
  "text": "STOP",
  "keyword": "STOP",
  "action": "opt_out"
}

Test before a number is live

With a test key, POST /inbound/simulate delivers a reply through the sandbox as if a handset had sent it: the keyword is applied, your opt-out list is updated and your webhooks fire. It only works for a number assigned to the same project.

curl -X POST https://sms21.in/v1/inbound/simulate \
  -H "X-API-Key: $SMS21_TEST_KEY" -H "Content-Type: application/json" \
  -d '{"from":"919876543210","to":"919812345678","text":"STOP"}'

What to expect

  • Replies to a number that is not assigned (or is disabled) are not delivered to anyone.
  • Providers retry callbacks; SMS21 de-duplicates on the provider’s message ID, so you see one reply.
  • Replies are personal data: the text is cleared and numbers masked after the retention period (90 days by default).
  • Inbound messages are not charged.
  • Long replies arrive as the provider sends them; SMS21 does not reassemble multi-part messages.