> ## Documentation Index
> Fetch the complete documentation index at: https://docs.linkupapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Conversation Messages

> Retrieve messages from a specific LinkedIn conversation

Get detailed messages from a LinkedIn conversation using either a LinkedIn profile URL or a direct conversation ID, including message content, timestamps, and sender information.

<Note>
  **Credit Usage:** 1 credit per 10 results (or fraction thereof). For example:

  * 1-10 results = 1 credit
  * 11-20 results = 2 credits
  * 300 results = 30 credits
</Note>

### Header Parameters

<ParamField header="x-api-key" type="string" required>
  Your API key
</ParamField>

### Body Parameters

<ParamField body="linkedin_url" type="string">
  URL of the LinkedIn profile to get conversation messages with. **Required if `conversation_id` is not provided.**
</ParamField>

<ParamField body="conversation_id" type="string">
  Direct conversation ID to retrieve messages from. **Required if `linkedin_url` is not provided.**
</ParamField>

<ParamField body="total_results" type="integer" default="10">
  Number of messages per page
</ParamField>

<ParamField body="cursor" type="string">
  Timestamp of the last message for pagination. Omit for the first request to get the most recent messages.
</ParamField>

<ParamField body="country" type="string" default="FR">
  Country code for proxy selection. Available: (US, UK, FR, DE, NL, IT, IL, CA, BR, ES, IN)
</ParamField>

<ParamField body="login_token" type="string" required>
  LinkedIn authentication cookie obtained from the login/verify process
</ParamField>

### Response

<ResponseField name="status" type="string">
  Request status (success/error)
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="Properties">
    <ResponseField name="profile_url" type="string">
      The LinkedIn profile URL used in the request (only included if provided in request)
    </ResponseField>

    <ResponseField name="conversation_id" type="string">
      The unique identifier of the conversation
    </ResponseField>

    <ResponseField name="total_results" type="integer">
      Number of messages returned
    </ResponseField>

    <ResponseField name="total_other_member_message_count" type="integer">
      Total number of messages from other conversation participants
    </ResponseField>

    <ResponseField name="unread_count" type="integer">
      Number of unread messages in the conversation
    </ResponseField>

    <ResponseField name="last_seen_message" type="boolean">
      Indicates if the last message has been seen
    </ResponseField>

    <ResponseField name="last_seen_at" type="integer">
      Timestamp when the conversation was last seen (milliseconds since epoch)
    </ResponseField>

    <ResponseField name="messages" type="array">
      <Expandable title="Message Object">
        <ResponseField name="text" type="string">
          Content of the message
        </ResponseField>

        <ResponseField name="timestamp" type="integer">
          Delivery timestamp of the message (milliseconds since epoch)
        </ResponseField>

        <ResponseField name="sender" type="string">
          Full name of the message sender
        </ResponseField>

        <ResponseField name="sender_info" type="object">
          <Expandable title="Sender Properties">
            <ResponseField name="first_name" type="string">
              First name of the sender
            </ResponseField>

            <ResponseField name="last_name" type="string">
              Last name of the sender
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="message_type" type="string">
          Type of message (e.g., "TEXT", "SYSTEM")
        </ResponseField>

        <ResponseField name="entity_urn" type="string">
          Unique identifier for the message entity
        </ResponseField>

        <ResponseField name="read_status" type="string">
          Status of the message (e.g., "READ", "UNREAD") - *Note: This field may not always be present*
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="pagination" type="object">
      <Expandable title="Pagination Object">
        <ResponseField name="count" type="integer">
          Number of messages returned in the current response
        </ResponseField>

        <ResponseField name="has_next_page" type="boolean">
          Indicates if there are more messages to fetch
        </ResponseField>

        <ResponseField name="next_cursor" type="string">
          Cursor to use for fetching the next page of messages. Only present if `has_next_page` is true.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success Response - Using LinkedIn URL theme={null}
  {
    "status": "success",
    "data": {
      "conversation_id": "urn:li:msg_conversation:(urn:li:fsd_profile:ACoAADxnv0oB_dN-NfpvEBlsVPU_W1omM-Xu24o,2-OTFjNWU3YWMtN2IwNi00ZWUwLWE1YzYtNTg4OGNkMGU2ZGRhXzAxMw==)",
      "profile_url": "https://www.linkedin.com/in/al%C3%A9s-pr%C3%A9w-aa0262324/",
      "total_results": 5,
      "total_other_member_message_count": 32,
      "unread_count": 0,
      "last_seen_message": true,
      "last_seen_at": 1749403535456,
      "messages": [
        {
          "text": "😃",
          "timestamp": 1745270025236,
          "sender": "Titouan Prioux",
          "sender_info": {
            "first_name": "Titouan",
            "last_name": "Prioux"
          },
          "message_type": "TEXT",
          "entity_urn": "urn:li:msg_message:(urn:li:fsd_profile:ACoAADxnv0oB_dN-NfpvEBlsVPU_W1omM-Xu24o,2-MTc0NTI3MDAyNTA5MWIzODI1OS0xMDAmOTFjNWU3YWMtN2IwNi00ZWUwLWE1YzYtNTg4OGNkMGU2ZGRhXzAxMw==)"
        },
        {
          "text": "hello",
          "timestamp": 1745267779513,
          "sender": "Alés Préw",
          "sender_info": {
            "first_name": "Alés",
            "last_name": "Préw"
          },
          "message_type": "TEXT",
          "entity_urn": "urn:li:msg_message:(urn:li:fsd_profile:ACoAADxnv0oB_dN-NfpvEBlsVPU_W1omM-Xu24o,2-MTc0NTI2Nzc3OTM2MmI3NTkxNS0xMDAmOTFjNWU3YWMtN2IwNi00ZWUwLWE1YzYtNTg4OGNkMGU2ZGRhXzAxMw==)"
        },
        {
          "text": "",
          "timestamp": 1745266498889,
          "sender": "Alés Préw",
          "sender_info": {
            "first_name": "Alés",
            "last_name": "Préw"
          },
          "message_type": "SYSTEM",
          "entity_urn": "urn:li:msg_message:(urn:li:fsd_profile:ACoAADxnv0oB_dN-NfpvEBlsVPU_W1omM-Xu24o,2-MTc0NTI2NjQ5ODY1OWI3NDYxOC0xMDAmOTFjNWU3YWMtN2IwNi00ZWUwLWE1YzYtNTg4OGNkMGU2ZGRhXzAxMw==)"
        }
      ],
      "pagination": {
        "count": 5,
        "has_next_page": true,
        "next_cursor": "1745266498889"
      }
    }
  }
  ```

  ```json Error Response - Missing Parameters theme={null}
  {
    "status": "error",
    "message": "Missing required parameter: either 'conversation_id' or 'linkedin_url' must be provided"
  }
  ```

  ```json Success Response - No Conversation theme={null}
  {
    "status": "success",
    "message": "No conversation found with this profile"
  }
  ```
</ResponseExample>

### Notes

* **Two Access Methods**: You can retrieve conversation messages using either:
  * **LinkedIn Profile URL**: The API will first find the conversation ID associated with that profile
  * **Direct Conversation ID**: Skip the profile lookup and access the conversation directly
* **Parameter Requirements**: Either `linkedin_url` OR `conversation_id` must be provided (not both required)
* Messages are returned in chronological order (most recent first)
* The `timestamp` is in milliseconds since epoch
* **Cursor-based Pagination**:
  * **First request**: Omit the `cursor` parameter to get the most recent messages
  * **Subsequent requests**: Pass the `next_cursor` value from the previous response as the `cursor` parameter
  * **End of results**: When `has_next_page` is `false`, there are no more messages to fetch
  * Use `total_results` to control how many messages are returned per request (default: 10)
* When using `linkedin_url`, the API first retrieves the conversation ID for the specified profile, then fetches the messages
* When using `conversation_id`, the API directly fetches messages from that conversation
* This endpoint can only retrieve messages with profiles you've already had a conversation with
* Historical messages may be limited by LinkedIn's data retention policies
* The `profile_url` field is only included in the response when it was provided in the request

### Pagination Example

```json theme={null}
// First request - get most recent messages
{"linkedin_url": "https://linkedin.com/in/example", "total_results": 5}

// Next page - use cursor from previous response
{"linkedin_url": "https://linkedin.com/in/example", "total_results": 5, "cursor": "1745266498889"}
```
