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

# Send email

> Queues an email for delivery. Returns `202 Accepted` immediately —
delivery is asynchronous. Use webhooks or poll `GET /api/v1/emails/{id}` for status.

The `from` address domain must be verified in your workspace.
Provide at least one of `html` or `text`. If `html` is provided without `text`,
Torpedo generates a plain-text version automatically. To opt out of a text part,
send `text` as an empty string.




## OpenAPI

````yaml /openapi.yaml post /api/v1/emails
openapi: 3.0.3
info:
  title: Torpedo API
  version: '1.0'
  description: |
    Torpedo is a transactional messaging API built for developers.
    Send emails from your own verified domain, SMS to Mozambican numbers, and
    WhatsApp verification codes with a single HTTP call.
  contact:
    email: hello@torpedo.co.mz
  license:
    name: Torpedo API Terms of Service
    url: https://torpedo.co.mz/terms
  termsOfService: https://torpedo.co.mz/terms
servers:
  - url: https://api.torpedo.co.mz
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/emails:
    post:
      tags:
        - Emails
      summary: Send email
      description: >
        Queues an email for delivery. Returns `202 Accepted` immediately —

        delivery is asynchronous. Use webhooks or poll `GET /api/v1/emails/{id}`
        for status.


        The `from` address domain must be verified in your workspace.

        Provide at least one of `html` or `text`. If `html` is provided without
        `text`,

        Torpedo generates a plain-text version automatically. To opt out of a
        text part,

        send `text` as an empty string.
      operationId: sendEmail
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - from
                - to
                - subject
              description: Provide at least one of `html` or `text`.
              properties:
                from:
                  type: string
                  maxLength: 255
                  description: |
                    Sender address. Must use a verified domain.
                    Accepts bare email or display name format.
                  example: Acme <hello@myapp.com>
                to:
                  type: string
                  format: email
                  maxLength: 255
                  example: user@example.com
                subject:
                  type: string
                  minLength: 1
                  maxLength: 255
                  example: Welcome to Acme
                html:
                  type: string
                  maxLength: 1000000
                  description: >-
                    HTML body of the email. If `text` is omitted, Torpedo
                    generates plain text from this field.
                  example: <h1>Welcome!</h1><p>Thanks for signing up.</p>
                text:
                  type: string
                  maxLength: 100000
                  description: >-
                    Optional plain-text body. Set to an empty string to send no
                    text part.
                  example: Welcome! Thanks for signing up.
                replyTo:
                  type: string
                  format: email
                  maxLength: 255
                  description: Optional reply-to address
            example:
              from: Acme <hello@myapp.com>
              to: user@example.com
              subject: Welcome to Acme
              html: <h1>Welcome!</h1><p>Thanks for signing up.</p>
      responses:
        '202':
          description: Email queued for delivery
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      status:
                        type: string
                        example: queued
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: Free trial exhausted or workspace has no active sending plan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Workspace sending is blocked or the API key is scoped to another
            domain
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid content, domain not verified, or recipient suppressed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Monthly or daily sending quota exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Unique key for replaying the original accepted response without sending
        again. Leading and trailing whitespace is removed; only the first 255
        characters are retained.
      schema:
        type: string
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            type: object
            required:
              - code
              - message
            properties:
              code:
                type: string
                example: VALIDATION_ERROR
              message:
                type: string
                example: Domain not verified
              field:
                type: string
                example: from
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: |
        Prefix `tor_` followed by a base64url-encoded random key.
        Create and manage API keys from the authenticated Torpedo dashboard.

````

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