Messaging · RCS

Send an RCS message

Sends an RCS message.

POSThttps://api.pozy.ai/v1/rcs/messages
sendRcsMessage

Guides: RCS, Idempotency and safe retries

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

  • agentIdstringrequired
  • tostringrequired
  • textstring

    Up to 3072 characters.

  • contentobject

    One of:

    Option 1 (3 fields)
    • typestringrequired

      One of text.

    • textstringrequired

      Up to 3072 characters.

    • suggestionsarray of object

      Up to 11 items.

      One of:

      Option 1 (3 fields)
      • typestringrequired

        One of reply.

      • textstringrequired

        Up to 25 characters.

      • postbackDatastring
      Option 2 (4 fields)
      • typestringrequired

        One of dial.

      • textstringrequired

        Up to 25 characters.

      • phoneNumberstringrequired
      • postbackDatastring
      Option 3 (6 fields)
      • typestringrequired

        One of openUrl.

      • textstringrequired

        Up to 25 characters.

      • urlstring (URL)required
      • applicationstring

        One of BROWSER, WEBVIEW. Default BROWSER.

      • webviewViewModestring

        One of FULL, HALF, TALL. Default FULL.

      • postbackDatastring
      Option 4 (7 fields)
      • typestringrequired

        One of viewLocation.

      • textstringrequired

        Up to 25 characters.

      • latitudenumber
      • longitudenumber
      • querystring
      • labelstring
      • postbackDatastring
      Option 5 (3 fields)
      • typestringrequired

        One of shareLocation.

      • textstringrequired

        Up to 25 characters.

      • postbackDatastring
      Option 6 (7 fields)
      • typestringrequired

        One of calendarEvent.

      • textstringrequired

        Up to 25 characters.

      • startTimestring (date-time)required
      • endTimestring (date-time)required
      • titlestringrequired

        Up to 100 characters.

      • descriptionstring

        Up to 500 characters.

      • postbackDatastring
    Option 2 (3 fields)
    • typestringrequired

      One of media.

    • mediaobjectrequired
      3 child fields
      • urlstring (URL)required
      • thumbnailUrlstring (URL)
      • heightstring

        One of SHORT, MEDIUM, TALL. Default MEDIUM.

    • suggestionsarray of object

      Up to 11 items.

      One of:

      Option 1 (3 fields)
      • typestringrequired

        One of reply.

      • textstringrequired

        Up to 25 characters.

      • postbackDatastring
      Option 2 (4 fields)
      • typestringrequired

        One of dial.

      • textstringrequired

        Up to 25 characters.

      • phoneNumberstringrequired
      • postbackDatastring
      Option 3 (6 fields)
      • typestringrequired

        One of openUrl.

      • textstringrequired

        Up to 25 characters.

      • urlstring (URL)required
      • applicationstring

        One of BROWSER, WEBVIEW. Default BROWSER.

      • webviewViewModestring

        One of FULL, HALF, TALL. Default FULL.

      • postbackDatastring
      Option 4 (7 fields)
      • typestringrequired

        One of viewLocation.

      • textstringrequired

        Up to 25 characters.

      • latitudenumber
      • longitudenumber
      • querystring
      • labelstring
      • postbackDatastring
      Option 5 (3 fields)
      • typestringrequired

        One of shareLocation.

      • textstringrequired

        Up to 25 characters.

      • postbackDatastring
      Option 6 (7 fields)
      • typestringrequired

        One of calendarEvent.

      • textstringrequired

        Up to 25 characters.

      • startTimestring (date-time)required
      • endTimestring (date-time)required
      • titlestringrequired

        Up to 100 characters.

      • descriptionstring

        Up to 500 characters.

      • postbackDatastring
    Option 3 (5 fields)
    • typestringrequired

      One of card.

    • cardobjectrequired
      4 child fields
      • titlestring

        Up to 200 characters.

      • descriptionstring

        Up to 2000 characters.

      • mediaobject
        3 child fields
        • urlstring (URL)required
        • thumbnailUrlstring (URL)
        • heightstring

          One of SHORT, MEDIUM, TALL. Default MEDIUM.

      • suggestionsarray of object

        Up to 4 items.

        One of:

        Option 1 (3 fields)
        • typestringrequired

          One of reply.

        • textstringrequired

          Up to 25 characters.

        • postbackDatastring
        Option 2 (4 fields)
        • typestringrequired

          One of dial.

        • textstringrequired

          Up to 25 characters.

        • phoneNumberstringrequired
        • postbackDatastring
        Option 3 (6 fields)
        • typestringrequired

          One of openUrl.

        • textstringrequired

          Up to 25 characters.

        • urlstring (URL)required
        • applicationstring

          One of BROWSER, WEBVIEW. Default BROWSER.

        • webviewViewModestring

          One of FULL, HALF, TALL. Default FULL.

        • postbackDatastring
        Option 4 (7 fields)
        • typestringrequired

          One of viewLocation.

        • textstringrequired

          Up to 25 characters.

        • latitudenumber
        • longitudenumber
        • querystring
        • labelstring
        • postbackDatastring
        Option 5 (3 fields)
        • typestringrequired

          One of shareLocation.

        • textstringrequired

          Up to 25 characters.

        • postbackDatastring
        Option 6 (7 fields)
        • typestringrequired

          One of calendarEvent.

        • textstringrequired

          Up to 25 characters.

        • startTimestring (date-time)required
        • endTimestring (date-time)required
        • titlestringrequired

          Up to 100 characters.

        • descriptionstring

          Up to 500 characters.

        • postbackDatastring
    • orientationstring

      One of VERTICAL, HORIZONTAL. Default VERTICAL.

    • thumbnailAlignmentstring

      One of LEFT, RIGHT. Default LEFT.

    • suggestionsarray of object

      Up to 11 items.

      One of:

      Option 1 (3 fields)
      • typestringrequired

        One of reply.

      • textstringrequired

        Up to 25 characters.

      • postbackDatastring
      Option 2 (4 fields)
      • typestringrequired

        One of dial.

      • textstringrequired

        Up to 25 characters.

      • phoneNumberstringrequired
      • postbackDatastring
      Option 3 (6 fields)
      • typestringrequired

        One of openUrl.

      • textstringrequired

        Up to 25 characters.

      • urlstring (URL)required
      • applicationstring

        One of BROWSER, WEBVIEW. Default BROWSER.

      • webviewViewModestring

        One of FULL, HALF, TALL. Default FULL.

      • postbackDatastring
      Option 4 (7 fields)
      • typestringrequired

        One of viewLocation.

      • textstringrequired

        Up to 25 characters.

      • latitudenumber
      • longitudenumber
      • querystring
      • labelstring
      • postbackDatastring
      Option 5 (3 fields)
      • typestringrequired

        One of shareLocation.

      • textstringrequired

        Up to 25 characters.

      • postbackDatastring
      Option 6 (7 fields)
      • typestringrequired

        One of calendarEvent.

      • textstringrequired

        Up to 25 characters.

      • startTimestring (date-time)required
      • endTimestring (date-time)required
      • titlestringrequired

        Up to 100 characters.

      • descriptionstring

        Up to 500 characters.

      • postbackDatastring
    Option 4 (4 fields)
    • typestringrequired

      One of carousel.

    • cardsarray of objectrequired

      At least 2 items. Up to 10 items.

      4 child fields
      • titlestring

        Up to 200 characters.

      • descriptionstring

        Up to 2000 characters.

      • mediaobject
        3 child fields
        • urlstring (URL)required
        • thumbnailUrlstring (URL)
        • heightstring

          One of SHORT, MEDIUM, TALL. Default MEDIUM.

      • suggestionsarray of object

        Up to 4 items.

        One of:

        Option 1 (3 fields)
        • typestringrequired

          One of reply.

        • textstringrequired

          Up to 25 characters.

        • postbackDatastring
        Option 2 (4 fields)
        • typestringrequired

          One of dial.

        • textstringrequired

          Up to 25 characters.

        • phoneNumberstringrequired
        • postbackDatastring
        Option 3 (6 fields)
        • typestringrequired

          One of openUrl.

        • textstringrequired

          Up to 25 characters.

        • urlstring (URL)required
        • applicationstring

          One of BROWSER, WEBVIEW. Default BROWSER.

        • webviewViewModestring

          One of FULL, HALF, TALL. Default FULL.

        • postbackDatastring
        Option 4 (7 fields)
        • typestringrequired

          One of viewLocation.

        • textstringrequired

          Up to 25 characters.

        • latitudenumber
        • longitudenumber
        • querystring
        • labelstring
        • postbackDatastring
        Option 5 (3 fields)
        • typestringrequired

          One of shareLocation.

        • textstringrequired

          Up to 25 characters.

        • postbackDatastring
        Option 6 (7 fields)
        • typestringrequired

          One of calendarEvent.

        • textstringrequired

          Up to 25 characters.

        • startTimestring (date-time)required
        • endTimestring (date-time)required
        • titlestringrequired

          Up to 100 characters.

        • descriptionstring

          Up to 500 characters.

        • postbackDatastring
    • cardWidthstring

      One of SMALL, MEDIUM. Default MEDIUM.

    • suggestionsarray of object

      Up to 11 items.

      One of:

      Option 1 (3 fields)
      • typestringrequired

        One of reply.

      • textstringrequired

        Up to 25 characters.

      • postbackDatastring
      Option 2 (4 fields)
      • typestringrequired

        One of dial.

      • textstringrequired

        Up to 25 characters.

      • phoneNumberstringrequired
      • postbackDatastring
      Option 3 (6 fields)
      • typestringrequired

        One of openUrl.

      • textstringrequired

        Up to 25 characters.

      • urlstring (URL)required
      • applicationstring

        One of BROWSER, WEBVIEW. Default BROWSER.

      • webviewViewModestring

        One of FULL, HALF, TALL. Default FULL.

      • postbackDatastring
      Option 4 (7 fields)
      • typestringrequired

        One of viewLocation.

      • textstringrequired

        Up to 25 characters.

      • latitudenumber
      • longitudenumber
      • querystring
      • labelstring
      • postbackDatastring
      Option 5 (3 fields)
      • typestringrequired

        One of shareLocation.

      • textstringrequired

        Up to 25 characters.

      • postbackDatastring
      Option 6 (7 fields)
      • typestringrequired

        One of calendarEvent.

      • textstringrequired

        Up to 25 characters.

      • startTimestring (date-time)required
      • endTimestring (date-time)required
      • titlestringrequired

        Up to 100 characters.

      • descriptionstring

        Up to 500 characters.

      • postbackDatastring
  • fallbackTextstring

    Up to 3072 characters.

  • ttlSecondsinteger

    At least 1.

Example

curl -X POST "https://api.pozy.ai/v1/rcs/messages" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "agentId": "6b99fbd950277956c14bd44d",
  "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 RCS