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

# Get campaign by id



## OpenAPI

````yaml /openapi.json get /api/email/campaign/{campaignId}
openapi: 3.0.0
info:
  description: >-
    Public REST API for Benchmark Email.


    Authenticate every request by including your API key in the `X-API-Key`
    header.

    Each key is issued with one or more scopes that control which endpoints it
    may call.


    Rate limits: 60 requests per minute per account.

    Monthly quota: determined by your subscription plan.
  title: Benchmark Email API
  version: 1.0.0
servers:
  - description: >-
      Your account's API base URL. Copy the full URL shown on Settings > API
      Keys in your Benchmark Email account and paste it here.
    url: '{apiBaseUrl}'
    variables:
      apiBaseUrl:
        default: ''
        description: >-
          Your account's API base URL. Copy it from Settings > API Keys in your
          Benchmark Email account.
security:
  - apiKeyAuth: []
tags:
  - description: Account related endpoints
    name: account
  - description: Contact related endpoints
    name: contact
  - description: Contact structure related endpoints
    name: contact-structure
  - description: List related endpoints
    name: lists
  - description: Email domain related endpoints
    name: email-domain
  - description: Email campaign related endpoints
    name: email-campaign
  - description: Email template related endpoints
    name: email-template
  - description: Report related endpoints
    name: reports
paths:
  /api/email/campaign/{campaignId}:
    get:
      tags:
        - email-campaign
      summary: Get campaign by id
      operationId: get_api_email_campaign_by_campaignId
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  _id:
                    description: Id of the campaign
                    type: string
                  cancelledAt:
                    description: Timestamp when the campaign was cancelled or failed
                    nullable: true
                    type: string
                  createdAt:
                    description: Date and time of creation
                    type: string
                  editorType:
                    description: >-
                      Which editor produced the campaign body. Campaigns created
                      before the editor choice existed read back as 'unlayer'.
                    enum:
                      - unlayer
                      - code
                    type: string
                  failedCount:
                    description: Failed sent count
                    type: number
                  from:
                    description: From email address
                    type: string
                  hostedUrl:
                    description: >-
                      Public URL of the campaign's hosted copy. Always present;
                      null unless the campaign sent successfully and its hosted
                      artifact was stored.
                    nullable: true
                    type: string
                  name:
                    description: Name of the campaign
                    type: string
                  plainTextBody:
                    description: >-
                      Plaintext version of the email body without HTML
                      formatting
                    example: >-
                      Hello, world! This is a plaintext version of the email
                      without any HTML formatting.
                    type: string
                  previewImageUrl:
                    description: >-
                      URL of the last thumbnail that finished rendering. The
                      thumbnail is rendered after the response is sent, so this
                      value may lag a content-changing write and is absent on a
                      freshly created campaign.
                    type: string
                  previewText:
                    description: Preview text of the email
                    type: string
                  scheduledAt:
                    description: Date and time of scheduled email
                    type: string
                  sentCount:
                    description: Successfully sent count
                    type: number
                  status:
                    description: Status of the campaign
                    type: string
                  subStatus:
                    description: >-
                      Granular failure/cancellation reason. Null for non-failure
                      states or legacy campaigns.
                    enum:
                      - missing_billing_info
                      - account_suspended
                      - invalid_subscription
                      - system_error
                      - quota_exceeded
                      - circuit_breaker_bounce
                      - circuit_breaker_complaint
                      - circuit_breaker_combined
                      - rejected_automated_review
                      - rejected_manual_review
                      - null
                    nullable: true
                    type: string
                  subject:
                    description: Subject of the email
                    type: string
                  totalRecipients:
                    description: >-
                      Contacts this campaign is expected to email. 0 until the
                      campaign is scheduled (except for an explicit contact-list
                      audience, counted at creation), then estimated from the
                      audience; narrows to the mailable (active) population when
                      the send begins — the figure the sending-allowance
                      decision uses.
                    type: number
                  updatedAt:
                    description: Date and time of last update
                    type: string
                type: object
          description: Successfully retrieved
        '401':
          description: Unauthorized
        '404':
          description: Not found
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      description: API key authentication
      in: header
      name: X-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.