# Get campaign emails

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /unibox/campaign-emails:
    get:
      summary: Get campaign emails
      deprecated: false
      description: >-
        Fetch campaign emails sent to a specific lead within a workspace.
        Optional `campaign_id` parameter can filter emails for a specific
        campaign.
      operationId: Campaign_campaign/retrieve-campaign-emails
      tags:
        - Campaign
        - Campaign
      parameters:
        - name: workspace_id
          in: query
          description: The unique ID of the workspace.
          required: true
          schema:
            type: string
            description: The unique ID of the workspace.
            default: ''
            examples:
              - 6509f7691205283f2a79f98c
        - name: lead
          in: query
          description: The email address of the lead to retrieve campaign emails for.
          required: true
          schema:
            type: string
            description: The email address of the lead to retrieve campaign emails for.
            default: ''
            examples:
              - lead@example.com
        - name: campaign_id
          in: query
          description: (Optional) The unique ID of the campaign to filter emails.
          required: false
          schema:
            type: string
            description: (Optional) The unique ID of the campaign to filter emails.
            default: ''
            examples:
              - 673fa3520561f86146182478
        - name: x-api-key
          in: header
          description: Your PlusVibe.ai account's API Key
          required: true
          example: ''
          schema:
            type: string
            description: Your PlusVibe.ai account's API Key
            default: ''
            examples:
              - your-api-key
      responses:
        '200':
          description: A list of campaign emails sent to the lead.
          content:
            application/json:
              schema:
                type: object
                properties:
                  page_trail:
                    type: string
                    description: A marker for pagination.
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        organization_id:
                          type: string
                          description: The ID of the organization.
                        workspace_id:
                          type: string
                          description: The ID of the workspace.
                        lead_id:
                          type: string
                          description: The ID of the lead.
                        current_step:
                          type: integer
                          description: The current step in the campaign sequence.
                        sent_on:
                          type: string
                          description: Timestamp when the email was sent.
                        variation:
                          type: string
                          description: Email variation identifier.
                        message_id:
                          type: string
                          description: The unique ID of the email message.
                        subject:
                          type: string
                          description: The subject of the email.
                        body:
                          type: string
                          description: The body content of the email.
                        is_text:
                          type: integer
                          description: Indicates whether the email is plain text.
                        id:
                          type: string
                          description: The unique ID of the email record.
                        campaign_id:
                          type: string
                          description: The unique ID of the campaign.
                        eaccount:
                          type: string
                          description: The email account used to send the email.
                        lead:
                          type: string
                          description: The lead's email address.
                      x-apidog-orders:
                        - organization_id
                        - workspace_id
                        - lead_id
                        - current_step
                        - sent_on
                        - variation
                        - message_id
                        - subject
                        - body
                        - is_text
                        - id
                        - campaign_id
                        - eaccount
                        - lead
                    description: List of campaign emails.
                required:
                  - data
                x-apidog-orders:
                  - page_trail
                  - data
              example:
                page_trail: ''
                data:
                  - organization_id: 6509f7691205283f2a79f98b
                    workspace_id: 6509f7691205283f2a79f98c
                    lead_id: 673fa7040561f861461832a2
                    current_step: 3
                    sent_on: '2024-12-17T21:04:41.582Z'
                    variation: A
                    message_id: <44cfd246-4b87-cc15-289d-c36c3e9d823f@gopiplai.com>
                    subject: Your Campaign Introduction
                    body: >-
                      Hi there, this is a sample campaign email body. Let us
                      know if you're interested!
                    is_text: 1
                    id: 6761e769c149e4d9ca7732fe
                    campaign_id: 673fa3520561f86146182478
                    eaccount: sender@example.com
                    lead: lead@example.com
          headers: {}
          x-apidog-name: OK
        '400':
          description: Bad request. This usually occurs due to invalid input parameters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error type.
                    examples:
                      - Invalid Workspace Id
                  message:
                    type: string
                    description: Detailed error message.
                    examples:
                      - Invalid Workspace Id
                x-apidog-orders:
                  - error
                  - message
          headers: {}
          x-apidog-name: Bad Request
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
          headers: {}
          x-apidog-name: Server Error
      security:
        - ApiKeyAuth: []
          x-apidog:
            schemeGroups:
              - id: uS5KiuC4wfZHK42AzOfA_
                schemeIds:
                  - ApiKeyAuth
            required: true
            use:
              id: uS5KiuC4wfZHK42AzOfA_
            scopes:
              uS5KiuC4wfZHK42AzOfA_:
                ApiKeyAuth: []
      x-apidog-folder: Campaign
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/929054/apis/api-17238002-run
components:
  schemas: {}
  securitySchemes:
    ApiKeyAuth:
      type: apikey
      in: header
      name: x-api-key
      description: |
        API key issued in the PlusVibe dashboard. The server reads it
        from the `x-api-key` header and injects it into the request as
        the `api_key` query parameter, which is why you will see
        `api_key` referenced in validation errors.
    apiKey:
      type: apikey
      in: body
      name: api_key
      description: API key passed in request body
servers:
  - url: https://api.plusvibe.ai/api/v1
    description: Prod Env
security:
  - ApiKeyAuth: []
    x-apidog:
      schemeGroups:
        - id: uS5KiuC4wfZHK42AzOfA_
          schemeIds:
            - ApiKeyAuth
      required: true
      use:
        id: uS5KiuC4wfZHK42AzOfA_
      scopes:
        uS5KiuC4wfZHK42AzOfA_:
          ApiKeyAuth: []

```
