> ## 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 Campaigns

> Retrieve all campaigns in your workspace

## Request

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

<ParamField query="status" type="string">
  Filter by campaign status. Options: `all`, `active`, `paused`, `draft`, `finished`
</ParamField>

<ParamField query="page" type="integer" default="1">
  Page number for pagination
</ParamField>

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

## Response

<ResponseField name="campaigns" type="array">
  Array of campaign objects

  <Expandable title="Campaign Object">
    <ResponseField name="id" type="string">
      Unique campaign identifier
    </ResponseField>

    <ResponseField name="name" type="string">
      Campaign name
    </ResponseField>

    <ResponseField name="status" type="string">
      Current campaign status: `started`, `paused`, `draft`, `finished`
    </ResponseField>

    <ResponseField name="totalLeads" type="integer">
      Total number of leads in the campaign
    </ResponseField>

    <ResponseField name="connectionsSent" type="integer">
      Number of connection requests sent
    </ResponseField>

    <ResponseField name="messagesSent" type="integer">
      Number of messages sent
    </ResponseField>

    <ResponseField name="repliesReceived" type="integer">
      Number of replies received
    </ResponseField>

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

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

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

  <Expandable title="Pagination Object">
    <ResponseField name="page" type="integer">
      Current page number
    </ResponseField>

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

    <ResponseField name="total" type="integer">
      Total number of campaigns
    </ResponseField>

    <ResponseField name="totalPages" type="integer">
      Total number of pages
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.sendpilot.ai/v1/campaigns \
    -H "X-API-Key: YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.sendpilot.ai/v1/campaigns', {
    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/campaigns',
      headers={'X-API-Key': 'YOUR_API_KEY'}
  )
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "campaigns": [
      {
        "id": "clxxx123456",
        "name": "Q1 Tech Founders Outreach",
        "status": "started",
        "totalLeads": 150,
        "connectionsSent": 120,
        "messagesSent": 85,
        "repliesReceived": 15,
        "createdAt": "2024-02-20T10:00:00.000Z",
        "updatedAt": "2024-02-24T15:30:00.000Z"
      },
      {
        "id": "clxxx789012",
        "name": "SaaS Decision Makers",
        "status": "paused",
        "totalLeads": 75,
        "connectionsSent": 50,
        "messagesSent": 30,
        "repliesReceived": 5,
        "createdAt": "2024-02-18T09:00:00.000Z",
        "updatedAt": "2024-02-23T12:00:00.000Z"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 20,
      "total": 2,
      "totalPages": 1
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v1/campaigns
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/campaigns:
    get:
      tags:
        - Campaigns
      summary: List campaigns
      description: Retrieve all campaigns in your workspace
      operationId: listCampaigns
      parameters:
        - name: status
          in: query
          description: Filter by campaign status
          schema:
            type: string
            enum:
              - active
              - paused
              - draft
              - finished
              - all
        - name: page
          in: query
          description: Page number
          schema:
            type: integer
            default: 1
            minimum: 1
        - name: limit
          in: query
          description: Items per page
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: List of campaigns
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    CampaignListResponse:
      type: object
      properties:
        campaigns:
          type: array
          items:
            $ref: '#/components/schemas/Campaign'
        pagination:
          $ref: '#/components/schemas/PaginationMeta'
      required:
        - campaigns
        - pagination
    Campaign:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        status:
          type: string
          enum:
            - started
            - paused
            - draft
            - finished
        totalLeads:
          type: integer
        connectionsSent:
          type: integer
        messagesSent:
          type: integer
        repliesReceived:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - status
        - totalLeads
        - createdAt
        - updatedAt
    PaginationMeta:
      type: object
      properties:
        total:
          type: integer
        page:
          type: integer
        limit:
          type: integer
        totalPages:
          type: integer
      required:
        - total
        - page
        - limit
        - totalPages
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        error:
          type: string
        code:
          type: string
        message:
          type: string
      required:
        - statusCode
        - message
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````