List contact messages

Retrieve the most recent WhatsApp messages exchanged with a contact, across all of their conversations.

GET/contacts/:uuid/messages

Authentication

This endpoint authenticates with your API key sent in the X-API-Key header (ek_live_... format). You can manage your API keys from the Dev Tools section of the dashboard.

Path parameters

ParameterTypeRequiredDescription
uuidStringRequiredUUID of the contact.

Query parameters

ParameterTypeRequiredDescription
limitIntegerOptionalNumber of messages to return (default 100, max 200).

Example request

bash
curl -X GET "https://eclectic-api-537143970188.us-central1.run.app/api/external/v2/contacts/eb2b914a-977e-4ab8-96e7-b886698b3eac/messages?limit=50" \
  -H "X-API-Key: ek_live_your_api_key_here"

Example response

json
{
  "messages": [
    {
      "uuid": "a1b2c3d4-0002-0000-0000-000000000000",
      "status": "sent",
      "channel": "whatsapp",
      "createdAt": "2024-09-24T11:32:05Z",
      "from": "56987654321",
      "to": "56912345678",
      "text": "Hi! How can we help?",
      "attachments": [],
      "metadata": {}
    },
    {
      "uuid": "a1b2c3d4-0001-0000-0000-000000000000",
      "status": "received",
      "channel": "whatsapp",
      "createdAt": "2024-09-23T20:09:10Z",
      "from": "56912345678",
      "to": "56987654321",
      "text": "Hello!",
      "attachments": [],
      "metadata": {}
    }
  ]
}

Notes

  • Messages are returned newest first.
  • status is sent or received depending on the message direction, or failed if delivery failed.
  • Possible errors: 400 (validation), 401 (invalid or missing API key), 404 (contact not found).