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

# Get Campaign

> Retrieve the details of a specific campaign by its ID using the AutoSend API.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567' \
    --header 'Authorization: Bearer <token>'
  ```

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

  url = "https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567"
  headers = {"Authorization": "Bearer <token>"}

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

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.autosend.com/v1/campaigns/60d5ec49f1b2c72d9c8b4567',
    {
      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/60d5ec49f1b2c72d9c8b4567',
    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/60d5ec49f1b2c72d9c8b4567", 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/60d5ec49f1b2c72d9c8b4567"))
              .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/60d5ec49f1b2c72d9c8b4567')
  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": {
      "id": "69d348dd0351e0c32be90342",
      "projectId": "68c7e05a0bd5787257e6ee3b",
      "organizationId": "68c7e05a0bd5787257e6ee38",
      "createdBy": 68c7e05a0bd5787257e7ec99,
      "name": "Spring Sale Newsletter",
      "subject": "Don't miss our Spring Sale!",
      "previewText": "Up to 50% off this weekend only",
      "replyTo": "support@example.com",
      "toLists": [
        {
          "id": "696e1158fbfc515799175f02",
          "name": "seg list",
          "type": "list",
          "contactCount": 3
        }
      ],
      "excludeLists": [],
      "unsubscribeGroupId": null,
      "sendNow": true,
      "scheduledAt": "2026-04-06T05:56:02.850Z",
      "templateId": "A-280fa451a7ca5cc17513",
      "status": "sent",
      "from": {
        "email": "hello@yourdomain.com",
        "name": "Example Team"
      },
      "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",
      "abortedAt": null,
      "failureReason": null,
      "createdAt": "2026-04-06T05:47:09.523Z",
      "updatedAt": "2026-04-06T07:26:09.190Z",
      "sendToGlobalList": false,
      "template": {
        "templateId": "A-280fa451a7ca5cc17513",
        "projectId": "68c7e05a0bd5787257e6ee3b",
        "templateName": "Spring Sale Newsletter",
        "subject": "Don't miss our Spring Sale!",
        "previewText": "Up to 50% off this weekend only",
        "emailTemplate": "<!DOCTYPE html><html><head></head><body><h1>Welcome, {{name}}!</h1><p>Thanks for signing up.</p></body></html>",
        "templateType": "marketing",
        "builderType": "code",
        "createdAt": "2026-04-06T05:47:09.516Z",
        "updatedAt": "2026-04-06T05:47:09.516Z",
      },
      "trackingClick": true,
      "trackingOpen": true,
      "sendMode": "immediate",
      "resumedAt": null,
      "pausedReason": null,
      "pausedAt": null,
      "thresholdPreset": "balanced",
      "source": "api",
    },
    "message": "Campaign retrieved successfully"
  }
  ```
</ResponseExample>

### Authorizations

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

### Path Parameters

<ParamField path="campaignId" type="string" required>
  The id of the campaign to retrieve.
</ParamField>

### Response

<span className="text-sm">Returns the full campaign object for the given ID.</span>

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

<ResponseField name="data" type="object">
  The campaign object.

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

    <ResponseField name="projectId" type="string">
      ID of the project this campaign belongs to.
    </ResponseField>

    <ResponseField name="organizationId" type="string">
      ID of the organization this campaign belongs to.
    </ResponseField>

    <ResponseField name="createdBy" type="string | null">
      ID of the user who created 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="fromSenderId" type="string | null">
      ID of the sender used for this campaign.
    </ResponseField>

    <ResponseField name="replyTo" type="string">
      Reply-to email address.
    </ResponseField>

    <ResponseField name="toLists" type="array">
      Lists or segments the campaign targets.

      <Expandable title="toLists item">
        <ResponseField name="id" type="string">
          ID of the list or segment.
        </ResponseField>

        <ResponseField name="name" type="string">
          Name of the list or segment.
        </ResponseField>

        <ResponseField name="type" type="string">
          Type of the target. One of: `list`, `segment`.
        </ResponseField>

        <ResponseField name="contactCount" type="number">
          Number of contacts in the list or segment.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="excludeLists" type="array">
      Lists or segments excluded from this campaign.
    </ResponseField>

    <ResponseField name="unsubscribeGroupId" type="string | null">
      ID of the unsubscribe group associated with this campaign.
    </ResponseField>

    <ResponseField name="sendNow" type="boolean">
      Whether the campaign was sent immediately.
    </ResponseField>

    <ResponseField name="scheduledAt" type="string | null">
      ISO 8601 date-time when the campaign is scheduled to send. Null if not scheduled.
    </ResponseField>

    <ResponseField name="templateId" type="string">
      ID of the email template used by this campaign.
    </ResponseField>

    <ResponseField name="status" type="string">
      Current status of the campaign. One of: `draft`, `scheduled`, `sending`, `sending_gradual`, `paused`, `sent`, `failed`, `aborted`.
    </ResponseField>

    <ResponseField name="from" type="object">
      Sender identity.

      <Expandable title="from">
        <ResponseField name="email" type="string">
          Sender email address.
        </ResponseField>

        <ResponseField name="name" type="string">
          Sender display name.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="metrics" type="object">
      Campaign delivery and engagement metrics.

      <Expandable title="metrics">
        <ResponseField name="sent" type="number">
          Number of emails sent.
        </ResponseField>

        <ResponseField name="delivered" type="number">
          Number of emails delivered.
        </ResponseField>

        <ResponseField name="opened" type="number">
          Number of emails opened.
        </ResponseField>

        <ResponseField name="suppressed" type="number">
          Number of emails suppressed.
        </ResponseField>

        <ResponseField name="clicked" type="number">
          Number of emails clicked.
        </ResponseField>

        <ResponseField name="bounced" type="number">
          Number of emails bounced.
        </ResponseField>

        <ResponseField name="unsubscribed" type="number">
          Number of unsubscribes.
        </ResponseField>

        <ResponseField name="spamReported" type="number">
          Number of spam reports.
        </ResponseField>

        <ResponseField name="processedCount" type="number">
          Total number of emails processed.
        </ResponseField>

        <ResponseField name="totalContacts" type="number">
          Total number of contacts targeted.
        </ResponseField>

        <ResponseField name="failedCount" type="number">
          Number of emails that failed to send.
        </ResponseField>

        <ResponseField name="averageRatePerSecond" type="number">
          Average sending rate per second.
        </ResponseField>

        <ResponseField name="totalDurationSeconds" type="number">
          Total time taken to send the campaign in seconds.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="sentAt" type="string | null">
      ISO 8601 timestamp when the campaign was sent.
    </ResponseField>

    <ResponseField name="abortedAt" type="string | null">
      ISO 8601 timestamp when the campaign was aborted. Null if not aborted.
    </ResponseField>

    <ResponseField name="agendaJobId" type="string | null">
      Internal job ID for the campaign send process.
    </ResponseField>

    <ResponseField name="failureReason" type="string | null">
      Reason for campaign failure. Null if the campaign did not fail.
    </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>

    <ResponseField name="sendToGlobalList" type="boolean">
      Whether the campaign was sent to the global contact list.
    </ResponseField>

    <ResponseField name="template" type="object">
      The email template associated with this campaign.

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

        <ResponseField name="projectId" type="string">
          ID of the project the template belongs to.
        </ResponseField>

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

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

        <ResponseField name="previewText" type="string">
          Preview text from the template.
        </ResponseField>

        <ResponseField name="emailTemplate" type="string">
          HTML content of the email template.
        </ResponseField>

        <ResponseField name="templateType" type="string">
          Type of the template. One of: `marketing`, `transactional`.
        </ResponseField>

        <ResponseField name="builderType" type="string">
          How the template was built. One of: `code`, `editor`.
        </ResponseField>

        <ResponseField name="editorJson" type="object | null">
          Editor JSON data if built with the visual editor.
        </ResponseField>

        <ResponseField name="parentBodyProperties" type="object | null">
          Parent body properties for the template.
        </ResponseField>

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

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

        <ResponseField name="isFlagged" type="boolean">
          Whether the template has been flagged.
        </ResponseField>

        <ResponseField name="source" type="string">
          Source of the template. One of: `api`, `dashboard`.
        </ResponseField>

        <ResponseField name="id" type="string">
          Internal ID of the template.
        </ResponseField>
      </Expandable>
    </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="sendMode" type="string">
      How the campaign is delivered: `immediate`, `scheduled`, or `gradual`.
    </ResponseField>

    <ResponseField name="resumedAt" type="string | null">
      ISO 8601 timestamp when the campaign was resumed. Null if never paused.
    </ResponseField>

    <ResponseField name="pausedReason" type="string | null">
      Reason the campaign was paused. Null if not paused.
    </ResponseField>

    <ResponseField name="pausedAt" type="string | null">
      ISO 8601 timestamp when the campaign was paused. Null if not paused.
    </ResponseField>

    <ResponseField name="thresholdPreset" type="string">
      Sending threshold preset. One of: `balanced`, `aggressive`, `conservative`.
    </ResponseField>

    <ResponseField name="source" type="string">
      Source of the campaign. One of: `api`, `dashboard`.
    </ResponseField>

    <ResponseField name="gradualSend" type="object | null">
      Gradual send configuration. Null if not using gradual send mode.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="message" type="string">
  A human-readable message describing the result.
</ResponseField>


## OpenAPI

````yaml GET /campaigns/{campaignId}
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/{campaignId}:
    get:
      tags:
        - Campaigns
      summary: Get a campaign by ID
      description: Retrieves a single campaign by its ID. MCP access allowed.
      operationId: getCampaign
      parameters:
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
          description: Id of the campaign.
      responses:
        '200':
          description: Campaign returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '404':
          description: Campaign not found.
          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.

````