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

# Get Campaign

> Retrieve a single campaign by ID

## Request

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

<ParamField path="id" type="string" required>
  The campaign ID
</ParamField>

## Response

<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="type" type="string">
  Campaign type (e.g., `regular`)
</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="linkedInSenderIds" type="array">
  Array of LinkedIn sender IDs associated with this campaign
</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>

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

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.sendpilot.ai/v1/campaigns/clxxx123456', {
    headers: {
      'X-API-Key': process.env.SENDPILOT_API_KEY
    }
  });
  const campaign = await response.json();
  ```

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

  response = requests.get(
      'https://api.sendpilot.ai/v1/campaigns/clxxx123456',
      headers={'X-API-Key': 'YOUR_API_KEY'}
  )
  campaign = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "clxxx123456",
    "name": "Q1 Tech Founders Outreach",
    "status": "started",
    "type": "regular",
    "totalLeads": 150,
    "connectionsSent": 120,
    "messagesSent": 85,
    "repliesReceived": 15,
    "linkedInSenderIds": ["sender_abc123", "sender_def456"],
    "createdAt": "2024-02-20T10:00:00.000Z",
    "updatedAt": "2024-02-24T15:30:00.000Z"
  }
  ```

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


## OpenAPI

````yaml GET /v1/campaigns/{id}
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/{id}:
    get:
      tags:
        - Campaigns
      summary: Get campaign
      description: Retrieve a single campaign by ID
      operationId: getCampaign
      parameters:
        - $ref: '#/components/parameters/CampaignId'
      responses:
        '200':
          description: Campaign details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDetail'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    CampaignId:
      name: id
      in: path
      required: true
      description: Campaign ID
      schema:
        type: string
  schemas:
    CampaignDetail:
      allOf:
        - $ref: '#/components/schemas/Campaign'
        - type: object
          properties:
            description:
              type: string
              nullable: true
            type:
              type: string
            linkedInSenderIds:
              type: array
              items:
                type: string
    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
    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'
    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

````