# Get emails

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /unibox/emails:
    get:
      summary: Get emails
      deprecated: false
      description: Get emails
      operationId: Unibox_unibox/get-emails
      tags:
        - Unibox
        - Unibox
      parameters:
        - name: workspace_id
          in: query
          description: Workspace ID
          required: true
          schema:
            type: string
            description: Workspace ID
            default: ''
            examples:
              - 65f3c92d3dbe5dbb35374a9a
        - name: preview_only
          in: query
          description: >-
            Set to true if you only want the email content's preview and not the
            full body
          required: false
          schema:
            type: string
            description: >-
              Set to true if you only want the email content's preview and not
              the full body
            default: ''
            enum:
              - 'true'
              - 'false'
            examples:
              - 'true'
        - name: lead
          in: query
          description: >-
            Optional - Enter the email address of the lead to fetch emails only
            for that specific lead.
          required: false
          schema:
            type: string
            description: >-
              Optional - Enter the email address of the lead to fetch emails
              only for that specific lead.
            default: ''
            format: email
            examples:
              - lead@example.com
        - name: campaign_id
          in: query
          description: Optional - only fetch emails for a specific campaign
          required: false
          schema:
            type: string
            description: Optional - only fetch emails for a specific campaign
            default: ''
            examples:
              - 65f3c92d3dbe5dbb35374a9b
        - name: email_type
          in: query
          description: >-
            Optional-  Specifies the type of emails to retrieve. Options include
            all emails, received emails, or sent emails. Sent emails include
            only those replied directly from Unibox. For sent campaign emails,
            please use the campaign-emails endpoint.
          required: false
          schema:
            type: string
            description: >-
              Optional-  Specifies the type of emails to retrieve. Options
              include all emails, received emails, or sent emails. Sent emails
              include only those replied directly from Unibox. For sent campaign
              emails, please use the campaign-emails endpoint.
            default: ''
            enum:
              - all
              - received
              - sent
            examples:
              - all
        - name: page_trail
          in: query
          description: >-
            Optional - Token for fetching the next page of results. Use the
            page_trail value from the previous response to fetch the next page.
          required: false
          schema:
            type: string
            description: >-
              Optional - Token for fetching the next page of results. Use the
              page_trail value from the previous response to fetch the next
              page.
            default: ''
            examples:
              - ''
        - name: label
          in: query
          description: >-
            Optional - The label of the email should be in all capital letters,
            with spaces replaced by underscores
          required: false
          schema:
            type: string
            description: >-
              Optional - The label of the email should be in all capital
              letters, with spaces replaced by underscores
            default: ''
            examples:
              - MEETING_BOOKED
        - 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: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  page_trail:
                    type: string
                    description: Token for fetching the next page of results
                    examples:
                      - 66b9d78ff91fabf920f6964d
                  data:
                    type: array
                    description: ''
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Use this ID for reply.
                          examples:
                            - 66b9d78ff91fabf920f6964d
                        message_id:
                          type: string
                          description: the email's raw message ID
                          examples:
                            - <ab76062c-3f46-4583-15dd-86aba3f13d83@account.com>
                        is_unread:
                          type: integer
                          description: ''
                          format: int32
                          examples:
                            - 0
                        lead:
                          type: string
                          description: Email address of the lead
                          examples:
                            - lead@example.com
                        lead_id:
                          type: string
                          description: Unique ID of the lead
                          examples:
                            - 65f3c92d3dbe5dbb35374a9a
                        campaign_id:
                          type: string
                          description: Campaign ID
                          examples:
                            - 668627fc3f30909b2ae9bd61
                        from_address_email:
                          type: string
                          description: ''
                          examples:
                            - lead@example.com
                        from_address_json:
                          type: array
                          description: ''
                          items:
                            type: object
                            properties:
                              address:
                                type: string
                                description: ''
                                examples:
                                  - lead@example.com
                              name:
                                type: string
                                description: ''
                            x-apidog-orders:
                              - address
                              - name
                        subject:
                          type: string
                          description: ''
                          examples:
                            - >-
                              RE: plusvibe.ai | 80% positive reply rate campaign
                              and how you can do the same
                        headers:
                          type: array
                          description: ''
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                                description: ''
                                examples:
                                  - Content-Type
                              value:
                                type: string
                                description: ''
                                examples:
                                  - text/html; charset=utf-8
                            x-apidog-orders:
                              - name
                              - value
                        timestamp_created:
                          type: string
                          description: ''
                          format: date-time
                          examples:
                            - '2024-08-13T11:58:18.000Z'
                        content_preview:
                          type: string
                          description: ''
                          examples:
                            - I'm interested. Please send me more info. Thanks.
                        label:
                          type: string
                          description: >-
                            The label of the email is in all capital letters,
                            with spaces replaced by underscores.
                          examples:
                            - MEETING_BOOKED
                        thread_id:
                          type: string
                          description: ''
                          examples:
                            - 66bb4a71e9bbd11ef367b940
                        eaccount:
                          type: string
                          description: ''
                          examples:
                            - sender@account.com
                        to_address_email_list:
                          type: string
                          description: ''
                          examples:
                            - sender@account.com
                        to_address_json:
                          type: array
                          description: ''
                          items:
                            type: object
                            properties:
                              address:
                                type: string
                                description: ''
                                examples:
                                  - sender@account.com
                              name:
                                type: string
                                description: ''
                            x-apidog-orders:
                              - address
                              - name
                        cc_address_email_list:
                          type: string
                          description: ''
                          examples:
                            - cc@example.com
                        cc_address_json:
                          type: array
                          description: ''
                          items:
                            type: object
                            properties:
                              address:
                                type: string
                                description: ''
                                examples:
                                  - cc@example.com
                              name:
                                type: string
                                description: ''
                                examples:
                                  - CC User
                            x-apidog-orders:
                              - address
                              - name
                        bcc_address_email_list:
                          type: string
                          description: ''
                          examples:
                            - bcc@example.com
                        source_modified_at:
                          type: string
                          description: ''
                          format: date-time
                          examples:
                            - '2024-08-13T11:58:18.000Z'
                        body:
                          type: object
                          description: ''
                          properties:
                            text:
                              type: string
                              description: ''
                              examples:
                                - >-
                                  I'm interested. Please send me more info.
                                  Thanks.
                            html:
                              type: string
                              description: ''
                              examples:
                                - >-
                                  <div>I'm interested. Please send me more info.
                                  Thanks.</div>
                          x-apidog-orders:
                            - text
                            - html
                      x-apidog-orders:
                        - id
                        - message_id
                        - is_unread
                        - lead
                        - lead_id
                        - campaign_id
                        - from_address_email
                        - from_address_json
                        - subject
                        - headers
                        - timestamp_created
                        - content_preview
                        - label
                        - thread_id
                        - eaccount
                        - to_address_email_list
                        - to_address_json
                        - cc_address_email_list
                        - cc_address_json
                        - bcc_address_email_list
                        - source_modified_at
                        - body
                x-apidog-orders:
                  - page_trail
                  - data
          headers: {}
          x-apidog-name: OK
        '400':
          description: Validation or other error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: ''
                    examples:
                      - Validation error
                  error:
                    type: string
                    description: ''
                    examples:
                      - Validation error
                x-apidog-orders:
                  - message
                  - error
          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: Unibox
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/929054/apis/api-17238025-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: []

```
