> This page is for Unified.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

The `Message` object is used to represent an email message.

### The Message Object

```json
{
  "id": "string",
  "remote_id": "string",
  "created_at": "2023-01-01T00:00:00Z",
  "modified_at": "2023-01-01T00:00:00Z",
  "subject": "string",
  "body_text": "string",
  "message_url": "string",
  "sent_at": "2023-01-01T00:00:00Z",
  "received_at": "2023-01-01T00:00:00Z",
  "is_draft": true,
  "from_address": "string",
  "thread": "string",
  "to": [
    "string"
  ],
  "cc": [
    "string"
  ],
  "bcc": [
    "string"
  ],
  "mailboxes": [
    "string"
  ],
  "permissions": [
    {
      "id": "string",
      "remote_id": "string",
      "created_at": "2023-01-01T00:00:00Z",
      "modified_at": "2023-01-01T00:00:00Z",
      "effect": "ALLOWED",
      "actions": [
        "READ"
      ],
      "applied_to_users": [
        "string"
      ],
      "applied_to_groups": [
        "string"
      ],
      "applied_to_folders": [
        "string"
      ],
      "applied_to_mailboxes": [
        "string"
      ],
      "remote_was_deleted": true,
      "field_mappings": {
        "organization_defined_targets": {
          "string": {}
        },
        "linked_account_defined_targets": {
          "string": {}
        }
      }
    }
  ],
  "folders": [
    "string"
  ],
  "remote_was_deleted": true
}
```

### Schema (`Message`)

```yaml
components:
  schemas:
    EffectEnum:
      type: string
      enum:
        - ALLOWED
        - DENIED
        - INHERITED
      title: EffectEnum
    ActionsEnum:
      type: string
      enum:
        - READ
      title: ActionsEnum
    PermissionFieldMappings:
      type: object
      properties:
        organization_defined_targets:
          type: object
          additionalProperties:
            description: Any type
        linked_account_defined_targets:
          type: object
          additionalProperties:
            description: Any type
      title: PermissionFieldMappings
    Permission:
      type: object
      properties:
        id:
          type: string
          format: uuid
        remote_id:
          type:
            - string
            - 'null'
          description: The third-party API ID of the matching object.
        created_at:
          type: string
          format: date-time
          description: The datetime that this object was created by Merge.
        modified_at:
          type: string
          format: date-time
          description: The datetime that this object was modified by Merge.
        effect:
          oneOf:
            - $ref: '#/components/schemas/EffectEnum'
            - type: 'null'
          description: The permission's effect.
        actions:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ActionsEnum'
          description: The actions that this permission applies to.
        applied_to_users:
          type: array
          items:
            type: string
            format: uuid
        applied_to_groups:
          type: array
          items:
            type: string
            format: uuid
        applied_to_folders:
          type: array
          items:
            type: string
            format: uuid
        applied_to_mailboxes:
          type: array
          items:
            type: string
            format: uuid
        remote_was_deleted:
          type: boolean
          description: >-
            Indicates whether or not this object has been deleted in the third
            party platform. Full coverage deletion detection is a premium
            add-on. Native deletion detection is offered for free with limited
            coverage. [Learn
            more](https://docs.merge.dev/integrations/hris/supported-features/).
        field_mappings:
          oneOf:
            - $ref: '#/components/schemas/PermissionFieldMappings'
            - type: 'null'
      description: >-
        # The EmailPermission Object

        ### Description

        The `EmailPermission` object is used to represent a permission on an
        email resource.

        ### Usage Example

        Fetch from the `GET /api/email/v1/email-permissions` endpoint and view
        their email permissions.
      title: Permission
    Message:
      type: object
      properties:
        id:
          type: string
          format: uuid
        remote_id:
          type:
            - string
            - 'null'
          description: The third-party API ID of the matching object.
        created_at:
          type: string
          format: date-time
          description: The datetime that this object was created by Merge.
        modified_at:
          type: string
          format: date-time
          description: The datetime that this object was modified by Merge.
        subject:
          type:
            - string
            - 'null'
          description: The subject of the message.
        body_text:
          type:
            - string
            - 'null'
          description: The body text of the message.
        message_url:
          type:
            - string
            - 'null'
          format: uri
          maxLength: 2000
          description: The 3rd party url of the message.
        sent_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the message was sent.
        received_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the message was received.
        is_draft:
          type:
            - boolean
            - 'null'
          description: Whether the message is a draft.
        from_address:
          type:
            - string
            - 'null'
          format: uuid
          description: The sender of the message.
        thread:
          type:
            - string
            - 'null'
          format: uuid
          description: The thread that the message belongs to.
        to:
          type: array
          items:
            type: string
            format: uuid
        cc:
          type: array
          items:
            type: string
            format: uuid
        bcc:
          type: array
          items:
            type: string
            format: uuid
        mailboxes:
          type: array
          items:
            type: string
            format: uuid
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
        folders:
          type: array
          items:
            type: string
            format: uuid
        remote_was_deleted:
          type: boolean
          description: >-
            Indicates whether or not this object has been deleted in the third
            party platform. Full coverage deletion detection is a premium
            add-on. Native deletion detection is offered for free with limited
            coverage. [Learn
            more](https://docs.merge.dev/integrations/hris/supported-features/).
      title: Message
```