SMS
SMS is receive-only. Runtime calls are authenticated with AGNT_KEY.
GET /v1/sms/number
Return the current assigned phone number or null.
json
{
"number": "+13156200700",
"country_iso2": "US",
"provider": "textverified"
}GET /v1/sms/messages
List stored SMS history.
Query parameters:
limit: default20, max100offset: default0direction: optionalinboundoroutbound
Behavior:
- before returning history, AgentID syncs the newest
100provider messages - messages are ordered newest-first
- provider messages are upserted into Postgres and then paginated from local state
- SMS uses
offsetpagination because this history is synced into a bounded local list before results are returned
Example response:
json
[
{
"message_id": "uuid",
"direction": "inbound",
"from_number": "61476882350",
"to_number": "3156200700",
"raw_payload": {
"source": "textverified",
"provider_message_id": "01KKR4RYSNNNSBYFS8XF4X6KYE",
"from_number": "61476882350",
"to_number": "3156200700",
"raw_message": "test",
"parsed_code": null,
"provider_received_at": "2026-03-15T07:01:10.069868+00:00",
"service_name": "manual-test"
},
"created_at": "2026-03-15T07:01:10.069868+00:00"
}
]POST /v1/sms/wait-for-code
Return the newest unseen SMS immediately, or wait for a new one.
Request:
json
{
"service_name": "brevo",
"timeout": 300,
"request_id": "otp-req-1"
}Response:
json
{
"code": "766136",
"from_number": "8556428544",
"raw_message": "Your Brevo activation code is 766136.",
"received_at": "2026-03-11T11:58:17.554867+00:00",
"request_id": "otp-req-1"
}Retry and idempotency:
- if an unseen stored/provider message already exists, it is returned immediately
- otherwise AgentID blocks on the provider until
timeout - reuse a client
request_idif you need safe retries for the same waiting request
Errors:
400no phone number provisioned401invalidAGNT_KEY408timeout waiting for verification code