Get a conversation

GET/api/v2/conversations/{username_or_id}

Returns one contact's messages. The first page has the newest messages; each further page goes back in time. Messages within a page are oldest first.

conversation has the same fields as on the contact object, plus has_unread and message_count, the number of messages included in messages.

Rate limit 300 requests per minute

Headers

  • x-api-keyheaderRequired

    Your API key.

  • Content-Typeheader

    application/json. Not needed for this request.

Path parameters

  • username_or_idstringRequired

    Instagram username or contact id.

Query parameters

  • message_limitinteger

    1 to 100. Default 30.

  • pagestring

    The next_page value from the previous response, to load older messages.

  • fieldsstring

    Contact details: basic (default) or full.

Errors

ErrorWhen
400invalid_message_limitinvalid_fieldsinvalid_page
A query parameter has a value that is not allowed.
404contact_not_found
No contact with that username or id in your organization.
Request
curl "https://app.dmtracker.ai/api/v2/conversations/jane.fitness?message_limit=50" \
  -H "x-api-key: $DMTRACKER_API_KEY" \
  -H "Content-Type: application/json"
Response 200
{
  "status": "success",
  "data": {
    "contact": {
      "id": "7c1e9a52-3f4b-4d2a-9e61-0b8f2d5c4a17",
      "username": "jane.fitness",
      "full_name": "Jane Cooper",
      "profile_picture": null
    },
    "conversation": {
      "last_message_at": "2026-10-21T15:14:50.000+00:00",
      "last_message_from": "user",
      "last_message": "Happy to help! Want me to send you the program details?",
      "last_contact_message_at": "2026-10-21T15:12:47.000+00:00",
      "first_contact_message_at": "2026-10-21T15:12:47.000+00:00",
      "can_reply": false,
      "reply_window_expires_at": "2026-10-22T15:12:47.000+00:00",
      "has_unread": false,
      "message_count": 2
    },
    "messages": [
      {
        "id": 23686,
        "from": "contact",
        "sent_by": null,
        "text": "Hi! How much is the coaching program?",
        "preview": "Hi! How much is the coaching program?",
        "message_type": "text",
        "media": null,
        "reaction_emoji": null,
        "template_buttons": null,
        "is_reply": false,
        "sent_at": "2026-10-21T15:12:47.000+00:00"
      },
      {
        "id": 23687,
        "from": "user",
        "sent_by": "alex@yourcompany.com",
        "text": "Happy to help! Want me to send you the program details?",
        "preview": "Happy to help! Want me to send you the program details?",
        "message_type": "text",
        "media": null,
        "reaction_emoji": null,
        "template_buttons": null,
        "is_reply": false,
        "sent_at": "2026-10-21T15:14:50.000+00:00"
      }
    ]
  },
  "has_more": false,
  "next_page": null
}
Link copied