LemuAIDocs

Contacts · 3 min read

Contact Messages

List every message and call to or from one contact, on any channel, with delivery status

Open in ChatGPTOpen in ClaudeMarkdown

Returns every message sent to or received from a contact, newest first, on every channel: WhatsApp, email, SMS and voice calls. Each entry shows where the message is in its life (sent, delivered, read, failed) and what sent it.

GET/api/v1/contacts/{contact_id}/messages

Headers#

NameRequiredDescription
X-API-KeyYesAn API key from your organization. See Authentication.

Path parameters#

NameTypeRequiredDescription
contact_idintegerYesThe contact's id, from List contacts or an upsert response.

Query parameters#

NameTypeRequiredDescription
limitintegerNoHow many messages to return, 1 to 200. Default 50.
before_idintegerNoOnly return messages older than the message with this id. To get the next page, pass the next_before_id value from the previous response.

Example request:

cURL
curl "https://app.lemuai.com/api/v1/contacts/901/messages?limit=20" \
  -H "X-API-Key: lemu_your_api_key"

Response#

200

JSON
{
  "messages": [
    {
      "id": 77120,
      "channel": "whatsapp",
      "direction": "outbound",
      "status": "read",
      "provider": "meta",
      "provider_status": "read",
      "template_name": "cart_reminder",
      "text": "Hi Priya, you left something in your cart. Complete your order here: https://le2.in/abc123",
      "source_type": "automation",
      "source_id": 3318,
      "workflow_run_id": null,
      "error": null,
      "meta": {},
      "created_at": "2026-10-27T10:14:05Z",
      "sent_at": "2026-10-27T10:14:06Z",
      "delivered_at": "2026-10-27T10:14:09Z",
      "read_at": "2026-10-27T10:20:31Z",
      "failed_at": null
    },
    {
      "id": 77064,
      "channel": "voice",
      "direction": "outbound",
      "status": "delivered",
      "provider": "plivo",
      "provider_status": "completed",
      "template_name": null,
      "source_type": "campaign",
      "source_id": 214,
      "workflow_run_id": 51290,
      "error": null,
      "meta": { "duration": 94 },
      "created_at": "2026-10-26T15:02:11Z",
      "sent_at": "2026-10-26T15:02:12Z",
      "delivered_at": "2026-10-26T15:02:20Z",
      "read_at": null,
      "failed_at": null
    }
  ],
  "next_before_id": null
}
FieldTypeDescription
messagesarrayThe messages on this page, newest first.
messages[].idintegerThe message's id.
messages[].channelstringwhatsapp, email, sms or voice. A call is one message on the voice channel.
messages[].directionstringoutbound (sent to the contact) or inbound (received from the contact).
messages[].statusstringWhere the message is now. See Message status.
messages[].providerstring or nullThe service that carried the message, for example the WhatsApp, email or telephony provider.
messages[].provider_statusstring or nullThe provider's own last status word, before LemuAI mapped it to status.
messages[].template_namestring or nullThe WhatsApp or email template used, if any.
messages[].textstring or nullThe message's text, up to 1,000 characters: what was written, or a template's filled-in text. null for calls and messages with no text.
messages[].source_typestring or nullWhat sent it: automation (a journey), campaign, voice_agent (an agent during a call), transactional (the transactional email API), inbox (a team member replying in the Inbox), manual (a call placed by hand or through the API), inbound_call, customer (a message the contact sent you) or test.
messages[].source_idinteger or nullThe id of what sent it, such as the journey run, the campaign or the call.
messages[].workflow_run_idinteger or nullThe call this message is (voice), or the call it was sent during (for example a WhatsApp message sent by an agent tool).
messages[].errorstring or nullWhy the message failed, when status is failed.
messages[].metaobjectExtra details about the message, for example a call's duration in seconds.
messages[].created_atstringWhen the message was created, in ISO 8601 (UTC).
messages[].sent_at, delivered_at, read_at, failed_atstring or nullWhen the message reached each status. null if it hasn't.
next_before_idinteger or nullPass this as before_id to get the next page. null on the last page.

Message status#

Outbound messages move forward through these statuses, or end as failed:

StatusMeaning
queuedWaiting to be sent.
sentHanded to the provider.
deliveredReached the person. For a call, the call was answered.
readThe person opened it. For email, the email was opened.
clickedFor email, the person clicked a tracked link.
failedIt couldn't be sent or delivered. See error.
receivedAn inbound message from the contact.

Errors#

StatusWhen
401The API key is missing or not valid.
404No contact with this id in your organization.
422limit is outside 1 to 200, or before_id isn't a number.

See Errors for the error format.

Was this page helpful?