API referenceLinkedin messaging
GET
/api/v1/messages

The account's messages newest first across its chats, its chats read in the order of their last activity, only as many as the page needs. A call looks through the account's 60 most recently active chats at most.

Authorization

X-API-KEY<token>

Your API key from the console (gw_live_…).

In: header

Query Parameters

account_id*string

The LinkedIn account (lg_…) to act as.

Length1 <= length
cursor?string

The previous page's cursor, as given (a time anchor in epoch milliseconds): the page goes on with the messages older than it. Takes the place of before.

limit?integer

How many messages to return, 1 to 250 (a larger number counts as 250). Default 25.

Range1 <= value <= 250
Default25
before?string

Only messages sent strictly before this date (ISO 8601). Ignored when cursor is sent.

Formatdate-time
after?string

Only messages sent strictly after this date (ISO 8601).

Formatdate-time
sender_id?string

Only the messages one person sent: their provider id (ACoA…, the sender_attendee_provider_id of their messages).

Response Body

application/json

curl -X GET "https://example.com/api/v1/messages?account_id=lg_3f9c2a7b1d&cursor=1761902400000&limit=50&sender_id=ACoAAB1a2b3c4d5e6f"
{  "object": "MessageList",  "items": [    {      "object": "Message",      "id": "string",      "message_id": "string",      "chat_id": "string",      "text": "string",      "subject": "string",      "timestamp": "2019-08-24T14:15:22Z",      "is_sender": 0,      "is_event": 0,      "sender_attendee_provider_id": "string",      "sender_provider_id": "string",      "attachments": [        {          "id": "string",          "type": "img",          "file_name": "string",          "file_size": 0,          "mimetype": "string",          "voice_note": true,          "duration": 0,          "unavailable": true        }      ]    }  ],  "cursor": "string"}