Messaging · SMS

Send an SMS/MMS

Sends an SMS/MMS.

POSThttps://api.pozy.ai/v1/sms/messages
sendSms

Guides: Send SMS, Alphanumeric sender IDs, SMS

Request

Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the messages resource group disabled get 403 resource_group_disabled. Authentication

Headers

NameTypeNotes
Idempotency-KeystringUp to 255 charactersRetries with the same key return the original result. See Idempotency

Request body

application/json, required

  • fromstringrequired
  • tostringrequired
  • textstring
  • mediaUrlsarray of string (URL)

    Up to 10 items.

  • sendAtstring (date-time)

Example

curl -X POST "https://api.pozy.ai/v1/sms/messages" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "from": "+14155550123",
  "to": "+14155550123"
}'

Response

200 on success

  • idstring
  • conversationIdstring
  • statusstring

    One of sent.

200 response
{
  "id": "6bfebd43ddc270f6d2c56fc5",
  "conversationId": "6e525f3820fc636aa96d2ee9",
  "status": "sent"
}

Errors

Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is read-only, scoped to other profiles, or has this resource group disabled.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in SMS