Inbox · Messages

Send message

Sends a message.

POSThttps://api.pozy.ai/v1/inbox/conversations/{conversationId}/messages
sendInboxMessage

Guides: Messages, Message templates, X

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

Path parameters

NameTypeNotes
conversationIdrequiredstring

Headers

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

Request body

application/json, required

  • accountIdstringrequired
  • messagestring
  • attachmentUrlstring
  • categorystring

    One of utility.

  • linkPreviewboolean

    Default true.

  • attachmentTypestring

    One of image, video, audio, file.

  • attachmentNamestring
  • voiceNoteboolean
  • subjectstring

    Up to 1000 characters.

  • ccarray of string (email)

    Up to 50 items.

  • effectstring

    One of slam, loud, gentle, invisibleInk, echo, spotlight, balloons, confetti, love, lasers, fireworks, shootingStar, celebration.

  • contactCardboolean
  • channelstring

    One of imessage, sms, rcs, whatsapp.

  • sharedMediaIdstring

    Matches ^\d+$.

  • stickerstring

    One of like_heart.

  • quickRepliesarray of object

    Up to 13 items.

    • titlestringrequired

      Up to 20 characters.

    • payloadstringrequired
    • imageUrlstring
  • buttonsarray of object

    Up to 3 items.

    • typestringrequired

      One of url, postback, phone.

    • titlestringrequired

      Up to 20 characters.

    • urlstring
    • payloadstring
    • phonestring
  • templateobject
    • typestring

      One of generic.

    • imageAspectRatiostring

      One of horizontal, square.

    • elementsarray of object

      Up to 10 items.

      7 child fields
      • titlestring

        Up to 80 characters.

      • subtitlestring
      • imageUrlstring
      • buttonsarray of object

        Up to 3 items.

        4 child fields
        • typestring

          One of url, postback.

        • titlestring

          Up to 20 characters.

        • urlstring
        • payloadstring
      • namestring
      • languagestring
      • componentsarray of object
  • interactiveobject
    • typestringrequired

      One of list, cta_url, flow, location_request_message, request_contact_info, voice_call, product, product_list, catalog_message, carousel, address_message.

    • headerobject
      5 child fields
      • typestring

        One of text, image, video, document.

      • textstring
      • imageobject
        1 child field
        • linkstring
      • videoobject
        1 child field
        • linkstring
      • documentobject
        1 child field
        • linkstring
    • bodyobject
      1 child field
      • textstringrequired
    • footerobject
      1 child field
      • textstring
    • actionobject

      One of:

      Option 1 (2 fields)
      • buttonstringrequired
      • sectionsarray of objectrequired

        At least 1 item. Up to 10 items.

        2 child fields
        • titlestring
        • rowsarray of objectrequired

          At least 1 item. Up to 10 items.

          3 child fields
          • idstringrequired
          • titlestringrequired
          • descriptionstring
      Option 2 (2 fields)
      • namestringrequired

        One of cta_url.

      • parametersobjectrequired
        2 child fields
        • display_textstringrequired
        • urlstring (URL)required
      Option 3 (2 fields)
      • namestringrequired

        One of voice_call.

      • parametersobject
        3 child fields
        • display_textstring

          Up to 20 characters.

        • ttl_minutesinteger

          1 to 43200.

        • payloadstring

          Up to 512 characters.

      Option 4 (2 fields)
      • namestringrequired

        One of flow.

      • parametersobjectrequired
        7 child fields
        • flow_message_versionstring

          One of 3.

        • flow_tokenstringrequired
        • flow_idstringrequired
        • flow_ctastringrequired
        • flow_actionstringrequired

          One of navigate, data_exchange.

        • flow_action_payloadobject
          2 child fields
          • screenstring
          • dataobject
        • modestring

          One of draft.

      Option 5 (1 fields)
      • namestringrequired

        One of send_location.

      Option 6 (1 fields)
      • namestringrequired

        One of request_contact_info.

      Option 7 (2 fields)
      • catalog_idstringrequired
      • product_retailer_idstringrequired
      Option 8 (2 fields)
      • catalog_idstringrequired
      • sectionsarray of objectrequired

        At least 1 item. Up to 10 items.

        2 child fields
        • titlestring
        • product_itemsarray of objectrequired

          At least 1 item.

          1 child field
          • product_retailer_idstringrequired
      Option 9 (2 fields)
      • namestringrequired

        One of catalog_message.

      • parametersobject
        1 child field
        • thumbnail_product_retailer_idstring
      Option 10 (1 fields)
      • cardsarray of objectrequired

        At least 2 items. Up to 10 items.

        5 child fields
        • card_indexinteger

          0 to 9.

        • typestring
        • headerobject
        • bodyobject
        • actionobject
      Option 11 (2 fields)
      • namestringrequired

        One of address_message.

      • parametersobjectrequired
        4 child fields
        • countrystringrequired
        • valuesobject
        • saved_addressesarray of object
        • validation_errorsmap of string
  • replyMarkupobject
    • typestring

      One of inline_keyboard, reply_keyboard.

    • keyboardarray of array of object
    • oneTimeboolean

      Default true.

  • messagingTypestring

    One of RESPONSE, UPDATE, MESSAGE_TAG.

  • messageTagstring

    One of CONFIRMED_EVENT_UPDATE, POST_PURCHASE_UPDATE, ACCOUNT_UPDATE, HUMAN_AGENT.

  • replyTostring
  • locationobject
    • latitudenumberrequired
    • longitudenumberrequired
    • namestring
    • addressstring
  • contactsarray of object
    • nameobjectrequired
      3 child fields
      • formatted_namestringrequired
      • first_namestring
      • last_namestring
    • phonesarray of object
      2 child fields
      • phonestring
      • typestring
    • emailsarray of object
      2 child fields
      • emailstring
      • typestring

Example

curl -X POST "https://api.pozy.ai/v1/inbox/conversations/6e525f3820fc636aa96d2ee9/messages" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9"
}'

Response

200 on success

  • successboolean
  • warningsarray of object
    • codestringrequired

      One of ignored_field.

    • paramstringrequired

      One of replyTo.

    • messagestringrequired
  • dataobject
    • messageIdstring
    • conversationIdstring
    • attachmentsarray of object
      2 child fields
      • typestring
      • urlstring
    • messageIdsarray of string
    • partialFailureobject
      3 child fields
      • partstring

        One of text.

      • errorstring
      • platformErrorobject
        4 child fields
        • codeinteger
        • subcodeinteger
        • fbtraceIdstring
        • typestring
200 response
{
  "success": true,
  "warnings": [
    {
      "code": "ignored_field",
      "param": "replyTo",
      "message": "Hello from Pozy"
    }
  ],
  "data": {
    "messageId": "62d191e7089bc48b8ea56b35",
    "conversationId": "6e525f3820fc636aa96d2ee9",
    "attachments": [
      {
        "type": "string",
        "url": "https://pozy.ai/media/example-1.jpg"
      }
    ],
    "messageIds": [
      "Hello from Pozy"
    ],
    "partialFailure": {
      "part": "text",
      "error": "string",
      "platformError": {
        "code": 1,
        "subcode": 1,
        "fbtraceId": "683a6bd99e02a3ca186c487f",
        "type": "string"
      }
    }
  }
}

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.
404not_foundNothing with that id exists in your workspace.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in Messages