Inbox · Messages

Create conversation

Creates a conversation.

POSThttps://api.pozy.ai/v1/inbox/conversations
createInboxConversation

Guides: Messages, X, WhatsApp

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

Request body

application/json, required

  • accountIdstringrequired
  • participantIdstring
  • participantUsernamestring
  • messagestring
  • subjectstring

    Up to 998 characters.

  • ccarray of string (email)

    Up to 50 items.

  • skipDmCheckboolean

    Default false.

  • templateNamestring
  • categorystring

    One of utility.

  • linkPreviewboolean

    Default true.

  • templateLanguagestring
  • templateParamsarray of string
  • templateButtonParamsarray of object

    Up to 10 items.

    • indexintegerrequired

      0 to 9.

    • subTypestringrequired

      One of url, copy_code, flow.

    • valuestringrequired
  • templateCardsarray of object

    Up to 10 items.

    • cardIndexintegerrequired

      0 to 9.

    • paramsarray of string
    • headerMediaobject
      3 child fields
      • typestringrequired

        One of image, video, document.

      • linkstring
      • idstring
    • buttonsarray of object

      Up to 2 items.

      3 child fields
      • indexintegerrequired

        0 to 1.

      • subTypestringrequired

        One of quick_reply, url.

      • valuestringrequired
  • headerMediaobject
    • typestringrequired

      One of image, video, document.

    • linkstring
    • idstring
    • filenamestring
  • headerLocationobject
    • latitudenumberrequired
    • longitudenumberrequired
    • namestring
    • addressstring

Example

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

Response

201 on success

  • successboolean
  • dataobject
    • messageIdstring
    • conversationIdstring
    • participantIdstring
    • participantNamestring

      Can be null.

    • participantUsernamestring

      Can be null.

201 response
{
  "success": true,
  "data": {
    "messageId": "62d191e7089bc48b8ea56b35",
    "conversationId": "6e525f3820fc636aa96d2ee9",
    "participantId": "6f0150243551cb6ee41f35e0",
    "participantName": "Acme",
    "participantUsername": "acme"
  }
}

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 Messages