> ## 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.

# Create a new task

> Submit a new task (call, text, email, ping). For call/text/email tasks, target is required. Email tasks use message for the body, support raw HTML, and may include meta.email.subject plus SendGrid-style meta.email.attachments.



## OpenAPI

````yaml post /api/v2/tasks
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/tasks:
    post:
      tags:
        - Tasks
      summary: Create a new task
      description: >-
        Submit a new task (call, text, email, ping). For call/text/email tasks,
        target is required. Email tasks use message for the body, support raw
        HTML, and may include meta.email.subject plus SendGrid-style
        meta.email.attachments.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
              properties:
                type:
                  type: string
                  example: email
                target:
                  type: string
                  example: person@example.com
                message:
                  type: string
                  example: <p>Hello <strong>there</strong>.</p>
                context:
                  type: string
                  example: Follow-up task context
                greeting:
                  type: string
                  example: Hello from a task
                waitToGreet:
                  type: boolean
                  example: true
                accountId:
                  type: integer
                  example: 1234
                scheduledFor:
                  type: integer
                  example: 1712350000
                meta:
                  type: object
                  description: >-
                    Optional task metadata. Call tasks may use bridgeAfterAnswer
                    with destination and optional monitor to bridge the answered
                    target to another number.
                  example:
                    email:
                      subject: Follow-up from Vida
                      attachments:
                        - filename: report.pdf
                          type: application/pdf
                          content: BASE64_CONTENT
                          disposition: attachment
      responses:
        '201':
          description: Task created successfully
        '400':
          description: Missing required fields
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error

````