Skip to content

List messages ​

Paginated message history for one conversation, newest first. Useful for rehydrating a chat window, or reconciling if a callback was missed. Look up the conversation using either conversation_id or contact_id as a query parameter.

GET {api}/user/messages/webchat?conversation_id={conversation_id}
Authorization: Basic base64(client_id:client_secret)

By conversation ID:

bash
curl "https://api.genudo.ai/api/user/messages/webchat?conversation_id=221416&per_page=10" \
  -u "wc_YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
  -H "Accept: application/json"

By contact ID:

bash
curl "https://api.genudo.ai/api/user/messages/webchat?contact_id=user-abc-123&per_page=10" \
  -u "wc_YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
  -H "Accept: application/json"

Parameters ​

NameInTypeRequiredDescription
conversation_idqueryintegerIf contact_id is omittedConversation ID returned by Initiate
contact_idquerystringIf conversation_id is omittedChat/session ID returned by Initiate
per_pagequeryintegernoDefault 10
pagequeryintegernoStandard Laravel pagination

Provide at least one of conversation_id or contact_id. If both are supplied, contact_id takes precedence.

Contact ID

Use the exact contact_id returned by Initiate, such as user-abc-123. The lookup is scoped to the channel associated with your client credentials.

Response ​

json
{
  "status": true,
  "code": 200,
  "validation": [],
  "message": "Messages List",
  "data": {
    "current_page": 1,
    "data": [
      {
        "role": "assistant",
        "message": "Yes — we ship to Cairo within 3 business days.",
        "status": "sent",
        "files": [],
        "conversation_id": 221416,
        "opportunity_id": 231979,
        "error": null,
        "sender_id": null,
        "id": "6a9d558f78769aef13054e63"
      },
      {
        "role": "user",
        "message": "Hi, do you ship to Cairo?",
        "status": "received",
        "files": [],
        "conversation_id": 221416,
        "opportunity_id": 231979,
        "error": null,
        "sender_id": null,
        "id": "6a9d558f78769aef13054e62"
      }
    ],
    "per_page": 10,
    "total": 2,
    "last_page": 1,
    "from": 1,
    "to": 2,
    "next_page_url": null,
    "prev_page_url": null
  }
}
FieldDescription
roleuser for customer messages, assistant for AI replies
statusDelivery state, e.g. received, sent, failed
filesAttachments — path, mimetype, type, size, name
errorPopulated when the AI or delivery failed

Errors ​

CodeMessage
401Invalid client credentials
403Unauthorized — no matching conversation was found, or it does not belong to this channel
422Validation error — neither conversation_id nor contact_id was provided
422This endpoint is only available for web channels.

TIP

A missing conversation and a conversation that belongs to another channel both return 403 Unauthorized, so the response does not reveal whether the id exists.