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

# Get campaign by ID

> Returns the full campaign document by id, including segmentation and assignment config, raw CSV payload (if any), and aggregated stats.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/campaigns/{id}
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/campaigns/{id}:
    get:
      tags:
        - Campaigns
      summary: Get campaign by ID
      description: >-
        Returns the full campaign document by id, including segmentation and
        assignment config, raw CSV payload (if any), and aggregated stats.
      operationId: get_campaigns_by_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Campaign returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignDetailResponse'
        '404':
          description: Campaign not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    CampaignDetailResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/CampaignDto'
      additionalProperties: true
      example:
        success: true
        data:
          _id: 665f1a0c0e0a4b001a2c9f10
          name: Q2 Lead Gen
          status: sent
          stats:
            total: 250
            sent: 248
            failed: 2
            successRate: 99.2%
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        error:
          type: string
      additionalProperties: true
      example:
        success: false
        message: Validation error
        error: name is required
    CampaignDto:
      type: object
      properties:
        _id:
          type: string
        organizationId:
          type: string
        name:
          type: string
        message:
          type: string
        userIds:
          type: array
          items:
            type: string
        scheduleDate:
          type: string
          format: date-time
        process:
          type: string
        contactStatus:
          type: string
        isAutopilot:
          type: boolean
        type:
          type: string
        status:
          type: string
          description: 'One of: scheduled, sent, failed, partial success, cancelled'
        createdBy:
          type: object
          additionalProperties: true
        failedUserIds:
          type: array
          items:
            type: string
        failedDetails:
          type: array
          items:
            type: object
            additionalProperties: true
        segmentation:
          type: object
          additionalProperties: true
          description: Segmentation config with segments array when enabled
        assignment:
          type: object
          additionalProperties: true
          description: Assignment config when enabled
        rawCsvData:
          type: object
          additionalProperties: true
        stats:
          type: object
          properties:
            total:
              type: integer
            sent:
              type: integer
            failed:
              type: integer
            successRate:
              type: string
          additionalProperties: false
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: true
      example:
        _id: 665f1a0c0e0a4b001a2c9f10
        organizationId: 64ee9a8b1e7f2a0011223344
        name: Q2 Lead Gen
        message: Hi {{firstName}}, are you still interested in a quote?
        userIds:
          - 64ee9a8b1e7f2a0011223399
        scheduleDate: '2026-05-20T15:00:00.000Z'
        process: 64eea1110000000000000001
        contactStatus: New Lead
        isAutopilot: false
        type: sms
        status: scheduled
        createdBy:
          _id: 64ee9a8b1e7f2a0011223399
          fullName: Alex Rep
        failedUserIds: []
        failedDetails: []
        stats:
          total: 250
          sent: 0
          failed: 0
          successRate: 0%
        createdAt: '2026-05-18T12:34:56.000Z'
        updatedAt: '2026-05-18T12:34:56.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````