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

# Create Email Message

> Requires `emailMessages: true` in the credential's `entitiesToSync` selection and a connector that supports this operation. [Choose what data to sync](https://rollout.com/docs/advanced-guides/controlling-which-records-sync-with-rollout), or [fix an entity that is not configured to sync](https://rollout.com/docs/troubleshooting/entity-not-configured-to-sync).



## OpenAPI

````yaml /openapi/crm.json post /emailMessages
openapi: 3.0.3
info:
  title: Universal CRM API Documentation
  description: Development documentation
  version: '1.0'
servers:
  - url: https://crm.universal.rollout.com/api
security: []
paths:
  /emailMessages:
    post:
      tags:
        - Email Messages
      summary: Create Email Message
      description: >-
        Requires `emailMessages: true` in the credential's `entitiesToSync`
        selection and a connector that supports this operation. [Choose what
        data to
        sync](https://rollout.com/docs/advanced-guides/controlling-which-records-sync-with-rollout),
        or [fix an entity that is not configured to
        sync](https://rollout.com/docs/troubleshooting/entity-not-configured-to-sync).
      operationId: postEmailMessages
      parameters:
        - name: fields
          in: query
          required: false
          schema:
            type: string
            description: >-
              Comma-separated top-level fields to return; the parameter can also
              be repeated, once per field. `id` is always returned. Omit it, or
              pass `allFields`, to get every field, including `original`.
              Unknown names return 400.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                personId:
                  type: string
                userId:
                  type: string
                subject:
                  type: string
                body:
                  type: string
                sender:
                  type: object
                  properties:
                    name:
                      type: string
                    email:
                      nullable: true
                      type: string
                  required:
                    - name
                    - email
                recipients:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      email:
                        nullable: true
                        type: string
                    required:
                      - name
                      - email
                threadId:
                  type: string
              required:
                - subject
                - body
                - sender
                - recipients
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                personId:
                  type: string
                userId:
                  type: string
                subject:
                  type: string
                body:
                  type: string
                sender:
                  type: object
                  properties:
                    name:
                      type: string
                    email:
                      nullable: true
                      type: string
                  required:
                    - name
                    - email
                recipients:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      email:
                        nullable: true
                        type: string
                    required:
                      - name
                      - email
                threadId:
                  type: string
              required:
                - subject
                - body
                - sender
                - recipients
          multipart/form-data:
            schema:
              type: object
              properties:
                personId:
                  type: string
                userId:
                  type: string
                subject:
                  type: string
                body:
                  type: string
                sender:
                  type: object
                  properties:
                    name:
                      type: string
                    email:
                      nullable: true
                      type: string
                  required:
                    - name
                    - email
                recipients:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      email:
                        nullable: true
                        type: string
                    required:
                      - name
                      - email
                threadId:
                  type: string
              required:
                - subject
                - body
                - sender
                - recipients
      responses:
        '201':
          description: The created email message.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  personId:
                    description: Present unless the request's `fields` leaves it out.
                    nullable: true
                    type: string
                  userId:
                    description: Present unless the request's `fields` leaves it out.
                    nullable: true
                    type: string
                  threadId:
                    description: Present unless the request's `fields` leaves it out.
                    nullable: true
                    type: string
                  subject:
                    description: Present unless the request's `fields` leaves it out.
                    type: string
                  body:
                    description: Present unless the request's `fields` leaves it out.
                    type: string
                  sender:
                    description: Present unless the request's `fields` leaves it out.
                    type: object
                    properties:
                      name:
                        type: string
                      email:
                        nullable: true
                        type: string
                    required:
                      - name
                      - email
                  recipients:
                    description: Present unless the request's `fields` leaves it out.
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        email:
                          nullable: true
                          type: string
                      required:
                        - name
                        - email
                  isRead:
                    description: Present unless the request's `fields` leaves it out.
                    nullable: true
                    type: boolean
                  isStarred:
                    description: Present unless the request's `fields` leaves it out.
                    nullable: true
                    type: boolean
                  isIncoming:
                    description: Present unless the request's `fields` leaves it out.
                    nullable: true
                    type: boolean
                  sent:
                    description: Present unless the request's `fields` leaves it out.
                    nullable: true
                    type: string
                  received:
                    description: Present unless the request's `fields` leaves it out.
                    nullable: true
                    type: string
                  created:
                    description: Present unless the request's `fields` leaves it out.
                    nullable: true
                    type: string
                  updated:
                    description: Present unless the request's `fields` leaves it out.
                    nullable: true
                    type: string
                  rolloutUpdated:
                    description: Present unless the request's `fields` leaves it out.
                    type: string
                  originalIds:
                    description: Present unless the request's `fields` leaves it out.
                    type: object
                    additionalProperties:
                      anyOf:
                        - type: number
                        - type: string
                  original:
                    description: Present unless the request's `fields` leaves it out.
                    type: object
                    additionalProperties:
                      type: object
                      additionalProperties: {}
                required:
                  - id
                description: The created email message.
        '400':
          description: Response for status 400
          content:
            application/json:
              schema:
                type: object
                properties:
                  errorMessage:
                    type: string
                required:
                  - errorMessage
        '409':
          description: Response for status 409
          content:
            application/json:
              schema:
                type: object
                properties:
                  errorMessage:
                    type: string
                    enum:
                      - >-
                        Data for this credential is not ready yet. Please try
                        again.
                required:
                  - errorMessage
        '423':
          description: >-
            423 Locked — the credential is temporarily frozen by an operator.
            Reads still work; POST/PATCH/PUT/DELETE are rejected until it is
            unfrozen. Unlike 424 (invalid credential), do not re-authenticate —
            retry later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                      required:
                        - message
                required:
                  - errors
      security:
        - jwt: []
          credential_id: []
components:
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      description: Consumer JWT minted by the tenant's backend
    credential_id:
      type: apiKey
      in: header
      name: X-Rollout-Credential-Id
      description: The Rollout Credential ID to use for queries/mutations

````

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