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

# Create Email

> Creates a new email in the system with the provided details.



## OpenAPI

````yaml POST /public/emails
openapi: 3.0.3
info:
  title: RevyOps API
  version: 1.0.0
servers: []
security: []
paths:
  /public/emails:
    post:
      tags:
        - public
      description: Creates a new email in the system with the provided details.
      operationId: Add email
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailModel'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/EmailModel'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/EmailModel'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailModel'
          description: Created. The email was successfully created.
        '400':
          description: Bad Request. Invalid data has been provided.
        '401':
          description: Unauthorized. Contact does not belong to this client.
        '403':
          description: Forbidden. Missing authentication credentials or invalid API key.
        '404':
          description: Not Found. Contact with this ID does not exist.
        '500':
          description: Internal Server Error. An unexpected error occurred on the server.
components:
  schemas:
    EmailModel:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        updated_time:
          type: string
          format: date-time
          readOnly: true
        email_timestamp:
          type: string
          format: date-time
        contact_email:
          type: string
          format: email
        contact_id:
          type: integer
        agent_email:
          type: string
          format: email
        email_type:
          type: string
        subject:
          type: string
        body_text:
          type: string
        body_html:
          type: string
        campaign_id:
          type: string
        campaign_name:
          type: string
        interested:
          type: boolean
        origin:
          type: string
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/EmailCustomFields'
      required:
        - email_type
        - id
        - origin
        - updated_time
    EmailCustomFields:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        updated_time:
          type: string
          format: date-time
          readOnly: true
        field_name:
          type: string
        field_value:
          type: string
          maxLength: 2500
      required:
        - field_name
        - field_value
        - id
        - updated_time

````