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

# Get email (json, html or text content, raw)



## OpenAPI

````yaml /openapi.yaml get /emails/{id}
openapi: 3.0.0
info:
  title: MailCare API
  version: '1.0'
  description: API documentation for MailCare
servers:
  - url: https://mailcare.io/api/teams/{teamId}
    variables:
      teamId:
        default: '0'
        description: The team identifier
security: []
paths:
  /emails/{id}:
    get:
      tags:
        - Emails
      summary: Get email (json, html or text content, raw)
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            Successful response. The response format depends on the `Accept`
            header you include in your request. Choose the header value that
            matches the format you want.
          content:
            application/vnd.mailcare.v1+json:
              schema:
                description: >-
                  JSON representation of the email. Set `Accept:
                  application/vnd.mailcare.v1+json` to receive this format.
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Email'
            text/plain:
              schema:
                description: >-
                  Plain text body of the email. Set `Accept: text/plain` to
                  receive this format.
                type: string
                example: |
                  Welcome to mailcare.io. 
                  Follow this link to continue: https://mailcare.io
            text/html:
              schema:
                description: >-
                  HTML body of the email. Set `Accept: text/html` to receive
                  this format.
                type: string
                example: |
                  <div>
                    <h1>Welcome to mailcare.io</h1>
                    <p>
                      Follow this link to continue <a href="https://mailcare.io">mailcare.io</a>
                    </p>
                    </div>
            message/rfc2822:
              schema:
                description: >-
                  Raw email including headers and attachments. Set `Accept:
                  message/rfc2822` to receive this format.
                type: string
                example: >
                  From test@example.com  Sun Jun 16 17:50:14 2013

                  MIME-Version: 1.0

                  Date: Sun, 16 Jun 2013 17:50:12 +0200

                  Subject: =?ISO-8859-1?Q?Mail_avec_fichier_attach=E9_de_1ko?=

                  From: Name <test@example.com>

                  To: test@example.com

                  Content-Type: multipart/mixed;
                  boundary=047d7b1635f77236f404df476f85


                  --047d7b1635f77236f404df476f85

                  Content-Type: multipart/alternative;
                  boundary=047d7b1635f77236f004df476f83


                  --047d7b1635f77236f004df476f83

                  Content-Type: text/plain; charset=ISO-8859-1


                  this is text part


                  --047d7b1635f77236f004df476f83

                  Content-Type: text/html; charset=ISO-8859-1


                  <div>this is html part</div>


                  --047d7b1635f77236f004df476f83--

                  --047d7b1635f77236f404df476f85

                  Content-Type: application/octet-stream; name=attach01

                  Content-Disposition: attachment; filename=attach01

                  Content-Transfer-Encoding: base64

                  X-Attachment-Id: f_hi0eudw60


                  YQo=

                  --047d7b1635f77236f404df476f85--
      security:
        - bearer_auth: []
components:
  schemas:
    Email:
      type: object
      properties:
        id:
          type: string
        sender:
          type: object
          properties:
            id:
              type: string
            display_name:
              type: string
            email:
              type: string
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
        inbox:
          type: object
          properties:
            id:
              type: string
            display_name:
              type: string
            email:
              type: string
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
        carbon_copies:
          type: array
          items:
            type: object
            properties:
              display_name:
                type: string
              email:
                type: string
        subject:
          type: string
        created_at:
          type: string
          format: date-time
        read:
          type: string
          format: date-time
        favorite:
          type: boolean
        has_html:
          type: boolean
        has_text:
          type: boolean
        size_in_bytes:
          type: integer
        attachments:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              email_id:
                type: string
              headers_hashed:
                type: string
              file_name:
                type: string
              content_type:
                type: string
              size_in_bytes:
                type: integer
              created_at:
                type: string
                format: date-time
              updated_at:
                type: string
                format: date-time
              size_for_human:
                type: string
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````