Skip to content

List a conversation's messages

View .md
GET

Reply with POST /v2/messages and this conversationId.

Authorization

  • Authorizationheaderrequired

    Bearer YOUR_API_KEY. Create a key in the dashboard.

Path parameters

  • conversationIdstringrequired

Query parameters

  • limitinteger
    Default50
    Limitsmax 100
  • cursorstring

    Opaque nextCursor from the previous page.

Responses

200Messages, newest first.
  • itemsobject[]required
    23 properties
    • idstringrequired
    • tostringrequired
    • fromstring

      Where the message came from: for an outbound message, your address (as GET /v2/channels lists it for channel, except WhatsApp, where it is the sender's own number field); for an inbound one, the contact.

    • channelstringrequired

      A transport a message travels on.

      One ofsmssms_onewaywhatsapptelegramemailinstagrammessengervoice
    • directionstringrequired

      Who sent the message. Needed to render a thread: status cannot tell the two apart, because an inbound message is also stored as delivered.

      One ofinboundoutbound
    • messageTypestringrequired

      Type of message. Every type except text and template is sent on WhatsApp only: the send routes them there whatever channel says, and in v2 an explicit channel other than whatsapp is refused with 400 naming messageType and channel.

      location_request asks the recipient to share their location and is WhatsApp-only. It takes no content object — the prompt goes in text (max 1024 characters) and the button label is fixed by WhatsApp. The recipient's answer arrives as an inbound location message whose content.replyToMessageId is the ID of the request.

      request_contact_info asks the recipient to share their phone number and is WhatsApp-only. Like location_request it takes no content object — the prompt goes in text (max 1024 characters) and WhatsApp renders a fixed Share Contact Info button. The answer arrives as an inbound contact message. Use it to recover the phone number of a contact who adopted a WhatsApp username and is only known by their business-scoped user ID (BSUID); when they share it, Zavu automatically links the phone number to that contact.

      One oftextimagevideoaudiodocumentstickerlocationcontactbuttonslistcta_urlrequest_contact_infolocation_requestreactiontemplate
    • statusstringrequired
      One ofqueuedsendingsentdeliveredreadfailedreceivedpending_url_verification
    • textstring

      Text content or caption.

    • contentobject

      Content for non-text message types (WhatsApp and Telegram).

      32 properties
      • mediaUrlstring

        URL of the media file (for image, video, audio, document, sticker).

      • mediaIdstring

        WhatsApp media ID if already uploaded.

      • mimeTypestring

        MIME type of the media.

      • filenamestring

        Filename for documents.

      • latitudenumber

        Latitude for location messages.

      • longitudenumber

        Longitude for location messages.

      • locationNamestring

        Name of the location.

      • locationAddressstring

        Address of the location.

      • contactsobject[]

        Contact cards for contact messages.

        2 properties
        • namestring
        • phonesstring[]
      • buttonsobject[]

        Interactive buttons (max 3).

        Limitsmax items 3
        2 properties
        • idstringrequired
          Limitsmax length 256
        • titlestringrequired
          Limitsmax length 20
      • listButtonstring

        Button text for list messages.

        Limitsmax length 20
      • sectionsobject[]

        Sections for list messages.

        2 properties
        • titlestringrequired
        • rowsobject[]required
          Limitsmax items 10
          3 properties
          • idstringrequired
          • titlestringrequired
            Limitsmax length 24
          • descriptionstring
            Limitsmax length 72
      • ctaDisplayTextstring

        Button label for cta_url messages.

        Limitsmax length 20
      • ctaUrlstring<uri>

        Destination URL opened in the device's default browser when the button is tapped. Used with messageType=cta_url. WhatsApp requires HTTPS in production.

      • ctaHeaderTypestring

        Optional header type for cta_url messages.

        One oftextimagevideodocument
      • ctaHeaderTextstring

        Header text when ctaHeaderType is 'text'.

        Limitsmax length 60
      • ctaHeaderMediaUrlstring<uri>

        Public HTTPS URL of the header media when ctaHeaderType is 'image', 'video', or 'document'. WhatsApp fetches this URL — it must be publicly reachable and return the declared content type.

      • footerTextstring

        Optional footer text for cta_url messages.

        Limitsmax length 60
      • emojistring

        Emoji for reaction messages.

      • reactToMessageIdstring

        Message ID to react to.

      • replyToMessageIdstring

        Zavu message ID of the quoted message this message replies to.

        When sending: set it to make the message a quoted reply to an earlier message in the same conversation, such as the data.messageId of a message.inbound webhook. Supported on WhatsApp (every message type except reaction) and Telegram. The quoted message must belong to this project (otherwise 404), must have gone out on the same channel as this send, must belong to the conversation to addresses, must have been sent or received by the address this message goes out from (from), and must have a providerMessageId. A failed message and a Telegram button tap cannot be quoted. Any other case returns 400 instead of sending the message unquoted. The stored message then carries the rest of the replyTo* fields.

        When receiving: present on inbound messages that quote an earlier message. Omitted when the quoted message is not found in Zavu (e.g. an old or unknown message) — use replyToProviderMessageId in that case.

      • replyToProviderMessageIdstring

        Provider message ID (WhatsApp WAMID, or Telegram message ID) of the quoted message. Present whenever an inbound WhatsApp message is a reply, even if the quoted message is not stored in Zavu, and on outbound quoted replies. Read-only: to quote when sending, set replyToMessageId.

      • replyToFromstring

        Sender of the quoted message (phone number in E.164 format, or the Telegram chat ID). Read-only.

      • replyToTextstring

        Truncated snippet (up to 200 characters) of the quoted message's text, for display. Empty when the quoted message has no text (e.g. media). Read-only.

      • replyToMessageTypestring

        Type of the quoted message (text, image, video, etc.). Read-only.

      • templateIdstring

        Template ID for template messages.

      • templateVariablesobject

        Variables for body placeholders. Key them to match the template body: by position (1, 2, ...) for positional templates, or by name (e.g. customer_name) for named templates. Zavu detects the template's format and sends the correct payload to Meta. Named keys also resolve a named text-header variable. Do not mix positional and named keys in the same request.

        1 properties
        • {key}string
      • templateButtonVariablesobject

        Variables for dynamic button placeholders (URL buttons and OTP buttons). Keys are the button index (0, 1, 2) in the template's buttons array — not the placeholder name. Values substitute the {{1}} placeholder inside that button's URL.

        WhatsApp constraints: - URL buttons only accept {{1}} — positional, numeric, no whitespace, no name. Named placeholders like {{token}} are stored as literal URL text by Meta and cannot be substituted. - At most one placeholder per URL button. - A template may have at most three buttons. - Static URL buttons (no placeholder) and quick_reply buttons are not included here.

        1 properties
        • {key}string
      • templateHeaderVariablesobject

        Value for a text-header variable, keyed by 1 (WhatsApp text headers allow at most one variable). Optional override. If omitted, Zavu resolves the header from templateVariables using the header placeholder's name (e.g. novios). Static text headers need no value.

        1 properties
        • {key}string
      • templateHeaderMediaUrlstring<uri>

        HTTPS URL of the media for this send, for a WhatsApp template whose header is image, video or document. It replaces the file stored on the template for this message only; the template is not changed. WhatsApp fetches the URL when the message is sent, so it must be publicly reachable at that moment (a short-lived signed link works if it outlives the send). Without it, the template's stored header file is sent.

        A template whose header is text, or that has no header, is refused with 400 invalid_request: details.field is content.templateHeaderMediaUrl and details.errors repeats the message, before anything is sent or charged. A URL that is not HTTPS is refused with 400 invalid_request and a details.errors entry whose path is ["content", "templateHeaderMediaUrl"]. Ignored on channels other than WhatsApp.

        Limitsmax length 2048
      • templateHeaderFilenamestring

        File name WhatsApp shows the recipient for a document header, e.g. invoice-1042.pdf. Works with templateHeaderMediaUrl, or on its own to name the template's stored file. Only valid when the template's header is document: any other header is refused with 400 invalid_request, details.field set to content.templateHeaderFilename and details.errors repeating the message, before anything is sent or charged. Ignored on channels other than WhatsApp.

        Limitsmin length 1 · max length 240
      • referralobject

        Click-to-WhatsApp (CTWA) ad attribution: where an inbound conversation came from.

        WhatsApp only. Present on the first inbound message of a conversation opened from a Meta ad or post, and on no message after it — so store it when it arrives rather than expecting it again. Organic conversations never carry it.

        Field names are camelCased to match the rest of this API; Meta sends them as snake_case (ctwa_clid, source_id, ...). Fields that do not apply are omitted: a post source has no click id, and an image ad has no videoUrl.

        10 properties
        • sourceTypestring

          Where the click came from.

          One ofadpost
        • sourceIdstring

          Identifier of the ad or post that produced the click.

        • sourceUrlstring<uri>

          Meta permalink to the ad or post.

        • headlinestring

          Headline of the ad or post.

        • bodystring

          Body copy of the ad or post.

        • mediaTypestring

          Type of media on the ad, when it had any.

          One ofimagevideo
        • imageUrlstring<uri>

          Image of the ad. Present when mediaType is image.

        • videoUrlstring<uri>

          Video of the ad. Present when mediaType is video.

        • thumbnailUrlstring<uri>

          Thumbnail of the ad media.

        • ctwaClidstring

          Click-to-WhatsApp click identifier. This is the value Meta's Conversions API needs to credit a conversion back to the ad that produced the conversation. Present on ad sources; a post source has none.

    • conversationIdstring

      ID of the conversation (inbox thread) this message belongs to. Use it to build a direct dashboard link: https://dashboard.zavu.dev/{locale}/inbox?conv={conversationId}. Omitted only on legacy messages created before conversation threading.

    • providerMessageIdstring

      Message ID from the delivery provider.

    • errorCodestringnullable

      Why a failed message failed, as a Zavu code: RISK_REJECTED, DAILY_LIMIT_EXCEEDED, TEN_DLC_REQUIRED, SMS_NOT_DELIVERED, WHATSAPP_WINDOW_CLOSED... A delivery provider's own code is translated where its meaning is known and kept in errorDetails.providerCode; one with no known meaning is SMS_DELIVERY_FAILED, WHATSAPP_REJECTED, VOICE_DELIVERY_FAILED, EMAIL_DELIVERY_FAILED or DELIVERY_FAILED. (/v1 returns the provider's raw code here.)

    • errorMessagestringnullable
    • costnumbernullable

      Zavu's own per-message platform charge, in USD (6 decimals). Messaging is billed against the plan's allowance, so it is often 0.

    • costProvidernumbernullable

      What delivering the message cost Zavu (carrier cost), in USD. Filled in when the delivery report brings it, so null until then.

    • costTotalnumbernullable

      cost + costProvider. For SMS this is BEFORE Zavu's markup, so it is not what your balance was charged: read charged for that. For voice it includes the markup.

    • metadataobject
      1 properties
      • {key}string
    • createdAtstring<date-time>required
    • updatedAtstring<date-time>
    • attemptedChannelsstring[]

      Transports tried before the current channel, oldest first, when an automatic fallback moved the message (WhatsApp to SMS). Empty when no fallback happened. Fallback runs after the send returned, so this can change after POST /v2/messages answered.

      One ofsmssms_onewaywhatsapptelegramemailinstagrammessengervoice
    • riskHoldstringnullable

      held while the message waits for risk review (it stays queued), released once a reviewer let it go, null when it was never held.

      One ofheldreleasednull
    • errorDetailsobjectnullable

      Present when errorCode translates a delivery provider's code.

      1 properties
      • providerCodestring

        The provider's own code, unchanged.

    • chargednumbernullable

      What this message has taken from your prepaid balance, in USD. SMS and one-way SMS only: charged per segment when the message is accepted (routing.estimatedCost), raised if the delivery report brings a higher real cost, and refunded (0) when the message fails AND the carrier charged nothing. A failed SMS the carrier did charge for (it attempted delivery) stays charged. Null on other channels, which are not billed per message here.

  • nextCursorstringnullable
400Invalid query (`limit` outside 1–100, or a malformed `cursor`), with `details.errors`.
  • codestringrequired
  • messagestringrequired
  • detailsobject

    Machine-readable context. Keys that mean the same thing everywhere: - errors: present on every 400 invalid_request for an invalid body or query parameter, [{path, message, ...}], path naming the field (["to"], ["contacts", 2, "recipient"], ["limit"]). - recommendation: one sentence saying what to do next. - dashboardUrl: the dashboard screen that fixes it. - connect: on 409 no_channel, the channels this project can connect to reach the recipient, each {type, request, note, available, dashboardUrl?}; request is the exact call (POST /v2/channels with its body, or POST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger). available: false says why in note (one-way SMS closed until business verification is approved). - address / from: the address the error is about, under the name the request used for it.

    1 properties
    • errorsobject[]
      3 properties
      • pathobject[]required
      • messagestringrequired
      • codestring
401Unauthorized.
  • codestringrequired
  • messagestringrequired
  • detailsobject

    Machine-readable context. Keys that mean the same thing everywhere: - errors: present on every 400 invalid_request for an invalid body or query parameter, [{path, message, ...}], path naming the field (["to"], ["contacts", 2, "recipient"], ["limit"]). - recommendation: one sentence saying what to do next. - dashboardUrl: the dashboard screen that fixes it. - connect: on 409 no_channel, the channels this project can connect to reach the recipient, each {type, request, note, available, dashboardUrl?}; request is the exact call (POST /v2/channels with its body, or POST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger). available: false says why in note (one-way SMS closed until business verification is approved). - address / from: the address the error is about, under the name the request used for it.

    1 properties
    • errorsobject[]
      3 properties
      • pathobject[]required
      • messagestringrequired
      • codestring
404Conversation not found, or it belongs to another project.
  • codestringrequired
  • messagestringrequired
  • detailsobject

    Machine-readable context. Keys that mean the same thing everywhere: - errors: present on every 400 invalid_request for an invalid body or query parameter, [{path, message, ...}], path naming the field (["to"], ["contacts", 2, "recipient"], ["limit"]). - recommendation: one sentence saying what to do next. - dashboardUrl: the dashboard screen that fixes it. - connect: on 409 no_channel, the channels this project can connect to reach the recipient, each {type, request, note, available, dashboardUrl?}; request is the exact call (POST /v2/channels with its body, or POST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger). available: false says why in note (one-way SMS closed until business verification is approved). - address / from: the address the error is about, under the name the request used for it.

    1 properties
    • errorsobject[]
      3 properties
      • pathobject[]required
      • messagestringrequired
      • codestring