Get Conversations

Returns a paginated list of company conversations

GEThttps://api.pact.im/api/p2/conversations

Returns paginated conversations of the company sorted by last_updated_at.

By default, 25 conversations are returned per page.

Read more about pagination.

Query Parameters

ParameterRequiredValidationsDescription
private_api_tokentrueMust be a stringYOUR_API_TOKEN
company_idtrueMust be an integerID of the company
search_stringfalseMust be a stringSearch by sender phone, sender name, or sender public external ID. Leading + and @ are stripped automatically, so +79991112233 and 79991112233, or @username and username, return the same result
pagefalseMust be an integerPage number. Returns the first page if omitted
per_pagefalseMust be an integerEntries per page (25 by default)

Example

Request

shell
curl -X GET 'https://api.pact.im/api/p2/conversations' \
  --header 'Content-Type: application/json' \
  --data '{
    "private_api_token": YOUR_API_TOKEN,
    "company_id": COMPANY_ID,
    "page": 1
  }'

Response

json
{
  "conversations": [
    {
      "id": 18642847,
      "company_id": 52204,
      "sender_name": "79517591813",
      "sender_phone": "79517591813",
      "sender_external_id": "79517591813",
      "sender_external_public_id": "79517591813",
      "provider": "whatsapp",
      "avatar_url": "http://localhost:3000/avatars/original/missing.png",
      "created_at": "2024-11-11T12:35:57.995Z",
      "last_updated_at": "2024-11-21T08:37:36.000Z",
      "last_message_id": 14056,
      "operational_state": "open",
      "replied_state": "replied",
      "group": false
    }
  ],
  "meta": {
    "page": 1,
    "entries_count": 2,
    "per_page": 25
  }
}

Search…

Start typing to search