Lalexi
APIСправочникMessages

List messages

The messages of a conversation in the order Lalexi shows them (by time, then by id) — newest first by default. Imported history is placed by its original time. Includes private notes and activity lines.

GET
/conversations/{conversation_id}/messages

Authorization

personalToken
AuthorizationBearer <token>

Your personal access token from Profile → Access Token in Lalexi. It acts with exactly your role: what you may see and do in the workspace, and nothing more. Everything done with it is recorded as done by you.

In: header

Path Parameters

conversation_id*integer

The conversation's number — the one in its Lalexi URL.

Query Parameters

order?string

desc — newest first (default); asc — oldest first.

Default"desc"
Value in"desc" | "asc"
limit?integer

Page size, 1–100 (values outside are brought into that range). Not a number → 422 validation_failed.

Default25
Range1 <= value <= 100
cursor?string

The next_cursor of the previous page. Opaque; a damaged cursor → 422 invalid_cursor.

Header Parameters

X-Workspace-Id?integer

The workspace to work in (an id from GET /me). Optional when you belong to a single workspace; required otherwise (400 workspace_required).

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://app.lalexi.com/v1/conversations/0/messages" \  -H "X-Workspace-Id: 7"
{
  "data": [
    {
      "id": 0,
      "conversation_id": 0,
      "type": "incoming",
      "text": "string",
      "deleted": true,
      "sender": {
        "type": "agent",
        "id": 0,
        "name": "string"
      },
      "status": "sent",
      "error_code": "message_limit_reached",
      "attachments": [
        {
          "id": 0,
          "type": "image",
          "url": "string",
          "file_name": "string",
          "size": 0,
          "content_type": "image/png"
        }
      ],
      "via": "api",
      "external_id": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "next_cursor": "string"
}
{
  "error": {
    "code": "workspace_required",
    "message": "You belong to several workspaces: pass the X-Workspace-Id header."
  }
}
{
  "error": {
    "code": "invalid_api_key",
    "message": "The API key is missing or invalid."
  }
}
{
  "error": {
    "code": "forbidden",
    "message": "You are not allowed to do this."
  }
}
{
  "error": {
    "code": "not_found",
    "message": "Resource not found."
  }
}
{
  "error": {
    "code": "validation_failed",
    "message": "The request is invalid.",
    "details": {
      "email": [
        "is invalid"
      ]
    }
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests. Retry after the number of seconds in Retry-After."
  }
}
{
  "error": {
    "code": "internal_error",
    "message": "Something went wrong on our side."
  }
}