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

# List Campaigns

> List all campaigns in your account with optional filtering and pagination using the AutoSend API.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.autosend.com/v1/campaigns?status=draft&page=1&limit=20' \
    --header 'Authorization: Bearer <token>'
  ```

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

  url = "https://api.autosend.com/v1/campaigns"
  params = {
      "status": "draft",
      "page": 1,
      "limit": 20
  }
  headers = {"Authorization": "Bearer <token>"}

  response = requests.get(url, params=params, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.autosend.com/v1/campaigns?status=draft&page=1&limit=20',
    {
      method: 'GET',
      headers: {
        Authorization: 'Bearer <token>',
      },
    }
  );
  const data = await response.json();
  console.log(data);
  ```

  ```php PHP theme={null}
  <?php
  $curl = curl_init();
  curl_setopt_array($curl, [
    CURLOPT_URL => 'https://api.autosend.com/v1/campaigns?status=draft&page=1&limit=20',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
      'Authorization: Bearer <token>',
    ],
  ]);
  $response = curl_exec($curl);
  curl_close($curl);
  echo $response;
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"io"
  	"net/http"
  )

  func main() {
  	req, _ := http.NewRequest("GET", "https://api.autosend.com/v1/campaigns?status=draft&page=1&limit=20", nil)
  	req.Header.Set("Authorization", "Bearer <token>")

  	client := &http.Client{}
  	resp, _ := client.Do(req)
  	defer resp.Body.Close()
  	body, _ := io.ReadAll(resp.Body)
  	fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  public class Main {
      public static void main(String[] args) throws Exception {
          HttpClient client = HttpClient.newHttpClient();
          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create("https://api.autosend.com/v1/campaigns?status=draft&page=1&limit=20"))
              .header("Authorization", "Bearer <token>")
              .GET()
              .build();
          HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
          System.out.println(response.body());
      }
  }
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'uri'
  require 'json'

  uri = URI('https://api.autosend.com/v1/campaigns')
  uri.query = URI.encode_www_form(status: 'draft', page: 1, limit: 20)

  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Get.new(uri)
  request['Authorization'] = 'Bearer <token>'

  response = http.request(request)
  puts JSON.parse(response.body)
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "campaigns": [
        {
          "id": "60d5ec49f1b2c72d9c8b4567",
          "name": "Spring Sale Newsletter",
          "subject": "Don't miss our Spring Sale!",
          "previewText": "Up to 50% off this weekend only",
          "status": "draft",
          "sendMode": "immediate",
          "trackingClick": true,
          "trackingOpen": true,
          "createdAt": "2026-03-01T10:00:00.000Z",
          "updatedAt": "2026-03-15T14:30:00.000Z"
        },
        {
          "id": "60d5ec49f1b2c72d9c8b4568",
          "name": "Welcome Series - Week 1",
          "subject": "Welcome to Autosend!",
          "previewText": "Get started in minutes",
          "status": "sent",
          "sendMode": "scheduled",
          "trackingClick": true,
          "trackingOpen": true,
          "metrics": {
            "sent": 200,
            "delivered": 200,
            "opened": 160,
            "suppressed": 0,
            "clicked": 0,
            "bounced": 0,
            "unsubscribed": 0,
            "spamReported": 0,
            "processedCount": 200,
            "totalContacts": 200,
            "failedCount": 0
          },
          "sentAt": "2026-04-06T05:54:51.190Z",
          "createdAt": "2026-02-15T08:00:00.000Z",
          "updatedAt": "2026-02-20T09:45:00.000Z"
        }
      ],
      "pagination": {
        "page": 1,
        "limit": 20,
        "total": 2,
        "totalPages": 1
      }
    }
  }
  ```
</ResponseExample>

### Authorizations

<ParamField path="Authorizations" type="string | header" required>
  Bearer authentication header of the form Bearer `<token>`, where `<token>` is your auth token.
</ParamField>

### Query Parameters

<ParamField query="status" type="string">
  Filter campaigns by status. One of: `draft`, `scheduled`, `sending`, `sending_gradual`, `paused`, `sent`, `failed`, `aborted`.
</ParamField>

<ParamField query="name" type="string">
  Filter campaigns by name. Supports partial matching.
</ParamField>

<ParamField query="page" type="integer">
  Page number for pagination. Must be at least `1`. Defaults to `1`.
</ParamField>

<ParamField query="limit" type="integer">
  Number of results to return per page. Must be between `1` and `100`. Defaults to `20`.
</ParamField>

<ParamField query="startDate" type="string">
  ISO 8601 date-time string. Only campaigns created on or after this date are returned.
</ParamField>

<ParamField query="endDate" type="string">
  ISO 8601 date-time string. Only campaigns created on or before this date are returned.
</ParamField>

<ParamField query="includeCounts" type="string">
  Whether to include recipient and send counts in each campaign object. Pass `"true"` or `"false"`.
</ParamField>

### Response

<span className="text-sm">Returns a paginated list of campaign objects.</span>

<ResponseField name="success" type="boolean">
  Indicates whether the request was successful.
</ResponseField>

<ResponseField name="data" type="object">
  Response payload.

  <Expandable title="data">
    <ResponseField name="campaigns" type="array">
      Array of campaign objects.

      <Expandable title="campaign">
        <ResponseField name="campaignId" type="string">
          Unique identifier of the campaign.
        </ResponseField>

        <ResponseField name="name" type="string">
          Display name of the campaign.
        </ResponseField>

        <ResponseField name="subject" type="string">
          Email subject line.
        </ResponseField>

        <ResponseField name="previewText" type="string">
          Preview text shown in email clients.
        </ResponseField>

        <ResponseField name="status" type="string">
          Current status of the campaign.
        </ResponseField>

        <ResponseField name="sendMode" type="string">
          How the campaign is delivered: `immediate`, `scheduled`, or `gradual`.
        </ResponseField>

        <ResponseField name="trackingClick" type="boolean">
          Whether click tracking is enabled.
        </ResponseField>

        <ResponseField name="trackingOpen" type="boolean">
          Whether open tracking is enabled.
        </ResponseField>

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

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

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

      <Expandable title="pagination">
        <ResponseField name="page" type="integer">
          Current page number.
        </ResponseField>

        <ResponseField name="limit" type="integer">
          Number of results per page.
        </ResponseField>

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

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


## OpenAPI

````yaml GET /campaigns
openapi: 3.1.0
info:
  title: Autosend Campaigns API
  version: 1.0.0
  description: API endpoints for managing marketing campaigns in Autosend.
servers:
  - url: https://api.autosend.com/v1
    description: Production
security:
  - BearerAuth: []
paths:
  /campaigns:
    get:
      tags:
        - Campaigns
      summary: List campaigns
      description: >-
        Retrieves a paginated list of campaigns with optional filtering. MCP
        access allowed.
      operationId: listCampaigns
      parameters:
        - name: status
          in: query
          schema:
            type: string
            enum:
              - draft
              - scheduled
              - sending
              - sending_gradual
              - paused
              - sent
              - failed
              - aborted
          description: Filter by campaign status.
        - name: name
          in: query
          schema:
            type: string
          description: Filter by campaign name (partial match).
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
          description: Page number for pagination.
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
          description: Number of results per page (1–100).
        - name: startDate
          in: query
          schema:
            type: string
            format: date-time
          description: Filter campaigns created on or after this ISO 8601 date.
        - name: endDate
          in: query
          schema:
            type: string
            format: date-time
          description: Filter campaigns created on or before this ISO 8601 date.
        - name: includeCounts
          in: query
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
          description: Include recipient/send counts in the response.
      responses:
        '200':
          description: List of campaigns returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
        code:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.

````