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

# Queue outbound email(s) from your Agent

> Queues email tasks for agent accounts with operator email enabled. Pass "target" or "to"/"cc"/"bcc" for one email. Use "targets" only to enqueue multiple separate emails.



## OpenAPI

````yaml post /api/v2/agent/outboundEmail
openapi: 3.0.0
info:
  version: 2.0.0
  title: Vida API
  description: Vida API Documentation
servers:
  - url: https://api.vida.dev
    description: Vida Production
    variables:
      baseUrl:
        default: api.vida.dev
        description: Production API Root
security: []
paths:
  /api/v2/agent/outboundEmail:
    post:
      tags:
        - Agents
      summary: Queue outbound email(s) from your Agent
      description: >-
        Queues email tasks for agent accounts with operator email enabled. Pass
        "target" or "to"/"cc"/"bcc" for one email. Use "targets" only to enqueue
        multiple separate emails.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              oneOf:
                - type: object
                  required:
                    - content
                  properties:
                    target:
                      type: string
                      description: Destination email address
                      example: person@example.com
                    to:
                      description: >-
                        Destination email address or array of destination email
                        addresses for one email
                    cc:
                      description: >-
                        CC email address or array of CC email addresses for one
                        email
                    bcc:
                      description: >-
                        BCC email address or array of BCC email addresses for
                        one email
                    content:
                      type: string
                      description: Email body. Raw HTML is supported.
                    subject:
                      type: string
                      description: Email subject line
                    attachments:
                      type: array
                      description: SendGrid-style attachment objects with base64 content
                    context:
                      type: string
                      description: Optional context for the task
                    taskContext:
                      type: string
                      description: Task-specific context
                    accountId:
                      type: integer
                      description: Optional agent account id override
                    agentId:
                      type: integer
                      description: Optional campaign id override
                    roomId:
                      type: string
                      description: Room id when replying to an existing email message
                    replyToMessageUuid:
                      type: string
                      description: >-
                        Email message uuid to reply to; used with roomId for
                        thread headers
                    scheduledFor:
                      type: integer
                      description: Unix seconds to schedule delivery
                    meta:
                      type: object
                      description: Optional metadata
                    externalTaskId:
                      type: string
                      description: >-
                        Optional customer-provided identifier applied to created
                        task(s)
                - type: object
                  required:
                    - targets
                  properties:
                    targets:
                      description: >-
                        Array of email addresses or objects with per-item
                        options
                    content:
                      type: string
                      description: Email body applied to string targets
                    subject:
                      type: string
                      description: Subject applied to string targets
                    cc:
                      description: CC applied to string targets
                    bcc:
                      description: BCC applied to string targets
                    attachments:
                      type: array
                      description: Attachments applied to string targets
                    context:
                      type: string
                    taskContext:
                      type: string
                    accountId:
                      type: integer
                    agentId:
                      type: integer
                    scheduledFor:
                      type: integer
                    scheduleSpacingSec:
                      type: integer
                      description: >-
                        If provided, stagger scheduledFor by this many seconds
                        per index
                    meta:
                      type: object
                    externalTaskId:
                      type: string
      responses:
        '200':
          description: Queued successfully
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Server Error
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: query
      name: token
      description: Vida API Token

````