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

# List Conversations

> Retrieve conversations from your LinkedIn accounts

Returns all conversations for LinkedIn accounts in your workspace. Optionally filter by a specific LinkedIn account.

## Request

<ParamField header="X-API-Key" type="string" required>
  Your API key
</ParamField>

<ParamField query="accountId" type="string">
  Filter by specific LinkedIn sender account ID. If not provided, returns conversations from all accounts.
</ParamField>

<ParamField query="limit" type="integer" default="20">
  Number of conversations per page (max: 100)
</ParamField>

<ParamField query="continuationToken" type="string">
  Token for fetching the next page of conversations. Returned in the previous response.
</ParamField>

## Response

<ResponseField name="conversations" type="array">
  Array of conversation objects

  <Expandable title="Conversation Object">
    <ResponseField name="id" type="string">
      Unique conversation/chat identifier
    </ResponseField>

    <ResponseField name="accountId" type="string">
      The LinkedIn sender account ID this conversation belongs to
    </ResponseField>

    <ResponseField name="participants" type="array">
      Array of participants in the conversation

      <Expandable title="Participant Object">
        <ResponseField name="id" type="string">
          Participant's LinkedIn identifier
        </ResponseField>

        <ResponseField name="name" type="string">
          Participant's full name
        </ResponseField>

        <ResponseField name="profileUrl" type="string">
          Participant's LinkedIn profile URL
        </ResponseField>

        <ResponseField name="profilePicture" type="string">
          URL to participant's profile picture
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="lastMessage" type="object">
      The most recent message in the conversation

      <Expandable title="Last Message Object">
        <ResponseField name="content" type="string">
          Message content (truncated to 100 characters)
        </ResponseField>

        <ResponseField name="sentAt" type="string">
          ISO 8601 timestamp when the message was sent
        </ResponseField>

        <ResponseField name="direction" type="string">
          Message direction: `sent` or `received`
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="lastActivityAt" type="string">
      ISO 8601 timestamp of the last activity in the conversation
    </ResponseField>

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

    <ResponseField name="createdAt" type="string">
      ISO 8601 timestamp when the conversation was created
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      ISO 8601 timestamp when the conversation was last updated
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination metadata

  <Expandable title="Pagination Object">
    <ResponseField name="continuationToken" type="string">
      Token to use for fetching the next page of conversations
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Items per page
    </ResponseField>

    <ResponseField name="hasMore" type="boolean">
      Whether there are more conversations to fetch
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.sendpilot.ai/v1/inbox/conversations?accountId=sender_abc123&limit=20" \
    -H "X-API-Key: YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.sendpilot.ai/v1/inbox/conversations?accountId=sender_abc123&limit=20',
    {
      headers: {
        'X-API-Key': process.env.SENDPILOT_API_KEY
      }
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.sendpilot.ai/v1/inbox/conversations',
      params={
          'accountId': 'sender_abc123',
          'limit': 20
      },
      headers={'X-API-Key': 'YOUR_API_KEY'}
  )
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "conversations": [
      {
        "id": "2-OVp-y-UNyFXBYvx0FqmQ",
        "accountId": "sender_abc123",
        "participants": [
          {
            "id": "john-doe-12345",
            "name": "John Doe",
            "profileUrl": "https://www.linkedin.com/in/john-doe",
            "profilePicture": "https://media.licdn.com/dms/image/..."
          }
        ],
        "lastMessage": {
          "content": "Thanks for reaching out! I'd love to discuss...",
          "sentAt": "2024-02-24T15:30:00.000Z",
          "direction": "received"
        },
        "lastActivityAt": "2024-02-24T15:30:00.000Z",
        "unreadCount": 1,
        "createdAt": "2024-02-20T10:00:00.000Z",
        "updatedAt": "2024-02-24T15:30:00.000Z"
      }
    ],
    "pagination": {
      "continuationToken": "eyJjb250aW51YXRpb24iOiIxNzA4Nzg0MjAwMDAwIn0=",
      "limit": 20,
      "hasMore": true
    }
  }
  ```

  ```json 404 theme={null}
  {
    "statusCode": 404,
    "error": "Not Found",
    "code": "SENDER_NOT_FOUND",
    "message": "LinkedIn sender with ID 'sender_abc123' not found in this workspace"
  }
  ```
</ResponseExample>

<Tip>
  Use the `continuationToken` from the response to fetch older response. Pass it as a query parameter in subsequent requests.
</Tip>


## OpenAPI

````yaml GET /v1/inbox/conversations
openapi: 3.0.0
info:
  title: SendPilot External API
  description: >
    The SendPilot API enables you to programmatically manage LinkedIn outreach
    campaigns,

    add leads, update lead statuses, send messages, and receive real-time
    webhook notifications.
  version: 1.0.0
  contact:
    name: SendPilot Support
    email: support@sendpilot.ai
    url: https://sendpilot.ai
servers:
  - url: https://api.sendpilot.ai
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Credits
    description: Credits and quota management
  - name: Campaigns
    description: Campaign management endpoints
  - name: Leads
    description: Lead management endpoints
  - name: Lead Database
    description: Lead Database search endpoints
  - name: Lead Extractor
    description: Lead extraction campaign endpoints
  - name: Inbox
    description: Direct messaging endpoints
paths:
  /v1/inbox/conversations:
    get:
      tags:
        - Inbox
      summary: List conversations
      description: >
        Retrieve conversations from your LinkedIn accounts. Returns all
        conversations

        for LinkedIn accounts in your workspace. Optionally filter by a specific
        LinkedIn account.
      operationId: listConversations
      parameters:
        - name: accountId
          in: query
          description: >-
            Filter by specific LinkedIn sender account ID. If not provided,
            returns conversations from all accounts.
          schema:
            type: string
        - name: limit
          in: query
          description: Number of conversations per page (max 100)
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 100
        - name: continuationToken
          in: query
          description: >-
            Token for fetching the next page of conversations. Returned in the
            previous response.
          schema:
            type: string
      responses:
        '200':
          description: List of conversations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    ConversationListResponse:
      type: object
      properties:
        conversations:
          type: array
          items:
            $ref: '#/components/schemas/Conversation'
        pagination:
          $ref: '#/components/schemas/ContinuationPagination'
      required:
        - conversations
        - pagination
    Conversation:
      type: object
      properties:
        id:
          type: string
          description: Unique conversation/chat identifier
        accountId:
          type: string
          description: The LinkedIn sender account ID this conversation belongs to
        participants:
          type: array
          items:
            $ref: '#/components/schemas/ConversationParticipant'
        lastMessage:
          $ref: '#/components/schemas/ConversationLastMessage'
        lastActivityAt:
          type: string
          format: date-time
        unreadCount:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - accountId
        - participants
    ContinuationPagination:
      type: object
      properties:
        continuationToken:
          type: string
          description: Token to use for fetching the next page
        limit:
          type: integer
          description: Items per page
        hasMore:
          type: boolean
          description: Whether there are more results to fetch
      required:
        - hasMore
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        error:
          type: string
        code:
          type: string
        message:
          type: string
      required:
        - statusCode
        - message
    ConversationParticipant:
      type: object
      properties:
        id:
          type: string
          description: Participant's LinkedIn identifier
        name:
          type: string
          description: Participant's full name
        profileUrl:
          type: string
          description: Participant's LinkedIn profile URL
        profilePicture:
          type: string
          description: URL to participant's profile picture
    ConversationLastMessage:
      type: object
      properties:
        content:
          type: string
          description: Message content (truncated to 100 characters)
        sentAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the message was sent
        direction:
          type: string
          enum:
            - sent
            - received
          description: Message direction
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````