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

# Send email to yourself, workspace members or user groups

Sends a plain-text email from Cube, a separate copy to each person. Omit recipients and groups to email yourself. Your email permissions determine who you can send to. OAuth requires the `email.send` scope.


## OpenAPI

````yaml /api-reference/api.yaml post /api/v1/email
openapi: 3.1.0
info:
  title: Cube Platform API
  version: 1.0.0
  description: >-
    Programmatically manage Cube: deployments and everything scoped to them

    (environments, folders, reports, workbooks, notifications, workspace, and
    agents),

    plus account-level users, groups, policies, embedding, and AI settings.
    Data-model

    authoring, dev mode, branches, and uploads live under /build/api/v1 — same
    host and

    token, routed to the build pods.
servers:
  - url: https://{tenant}.cubecloud.dev
    description: Your tenant host. Replace the whole host if you use a custom domain.
    variables:
      tenant:
        default: your-tenant
        description: Your Cube tenant subdomain
security:
  - bearerAuth: []
tags:
  - name: Deployments
  - name: Deployment Creation
  - name: Environments
  - name: Env Variables
  - name: Regions
  - name: Data Model
  - name: Data Model Uploads
  - name: GitHub
  - name: GitHub Connection
  - name: dbt Sync
  - name: Databricks Metric View Publication
  - name: Databricks Metric View Integration
  - name: Snowflake Semantic View Sync
  - name: Folders
  - name: Reports
  - name: External Documents
  - name: Workbooks
  - name: Workbook Promotions
  - name: Dashboard Exports
  - name: Notifications
  - name: Scheduled Tasks
  - name: Workspace
  - name: Agents
  - name: Users
  - name: Users Admin
  - name: API Keys
  - name: Roles
  - name: User Attributes
  - name: User Attribute Values
  - name: Tenant Settings
  - name: OAuth Integrations
  - name: User OAuth Tokens
  - name: OIDC Token Configs
  - name: App Theme
  - name: Embed
  - name: Embed Tenants
  - name: Dashboard Embed Access
  - name: Usage Analytics
  - name: OpenAPI Spec
  - name: Audit Log
  - name: Chat History
  - name: Data Model History
  - name: Email
  - name: Ossie Conversion
  - name: Query History
  - name: Report Deliveries
paths:
  /api/v1/email:
    post:
      tags:
        - Email
      summary: Send email to yourself, workspace members or user groups
      operationId: sendEmail
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentEmailRequest'
        description: AgentEmailRequest
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentEmailResponse'
          description: ''
components:
  schemas:
    AgentEmailRequest:
      properties:
        attachments:
          description: PDF, PNG, or CSV files. Total decoded size at most 20 MiB.
          oneOf:
            - items:
                $ref: '#/components/schemas/AgentEmailAttachment'
              type: array
              maxItems: 5
            - type: 'null'
        body:
          description: Plain text. Line breaks are preserved.
          maxLength: 10000
          minLength: 1
          type: string
        groups:
          description: >-
            User groups, named by name. Every active member gets their own copy;
            a person in several groups or also listed in recipients gets it
            once. Large sends go out in the background (see `queued`). Always
            tell the user about anyone in `skipped`.
          oneOf:
            - items:
                $ref: '#/components/schemas/AgentEmailGroup'
              type: array
              maxItems: 50
              minItems: 1
            - type: 'null'
        recipients:
          description: >-
            Workspace-member email addresses. Omit both recipients and groups to
            send to the authenticated user.
          oneOf:
            - items:
                $ref: '#/components/schemas/AgentEmailRecipient'
              type: array
              maxItems: 1000
              minItems: 1
            - type: 'null'
        subject:
          maxLength: 200
          minLength: 1
          type: string
      required:
        - subject
        - body
      type: object
    AgentEmailResponse:
      properties:
        queued:
          description: >-
            True when the email was accepted and is still being sent in the
            background: do not say it was delivered.
          type: boolean
        recipientCount:
          description: How many people the email is being sent to, each separately.
          type: integer
        sent:
          type: boolean
        skipped:
          description: >-
            Requested emails and groups not sent to, with the reason. Tell the
            user; never resend to a listed group.
          items:
            $ref: '#/components/schemas/AgentEmailSkipped'
          type: array
      required:
        - sent
        - recipientCount
        - queued
        - skipped
      type: object
    AgentEmailAttachment:
      properties:
        content:
          description: File contents encoded as base64.
          format: base64
          minLength: 1
          type: string
        contentType:
          $ref: '#/components/schemas/AgentEmailAttachmentContentType'
        filename:
          maxLength: 255
          type: string
      required:
        - filename
        - content
        - contentType
      type: object
    AgentEmailGroup:
      properties:
        name:
          description: The user group name, matched case-insensitively.
          maxLength: 255
          minLength: 1
          type: string
      required:
        - name
      type: object
    AgentEmailRecipient:
      properties:
        email:
          format: email
          type: string
      required:
        - email
      type: object
    AgentEmailSkipped:
      properties:
        count:
          description: How many members of the group were not sent to.
          oneOf:
            - type: integer
            - type: 'null'
        email:
          description: A requested email address that was not sent to.
          oneOf:
            - type: string
            - type: 'null'
        group:
          description: A requested group with members that were not sent to.
          oneOf:
            - type: string
            - type: 'null'
        reason:
          $ref: '#/components/schemas/AgentEmailSkippedReason'
          description: >-
            `noPermission`: you may only email yourself. `deliveryFailed`: that
            copy failed and the rest went out. Retry only failed emails; for a
            group, tell the user how many members were missed and never resend
            to the group.
      required:
        - reason
      type: object
    AgentEmailAttachmentContentType:
      enum:
        - application/pdf
        - image/png
        - text/csv
      type: string
    AgentEmailSkippedReason:
      enum:
        - noPermission
        - deliveryFailed
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Token authentication. Send `Authorization: Bearer <YOUR_TOKEN>`.'

````

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