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

# Send the CFDI (XML + PDF) by email to the receptor

> Authenticate with either a Supabase session (member of the invoice's organization) or an API key belonging to that same organization. `to` is optional — if omitted, the recipient is resolved from the Customer registered for the invoice's RFC receptor (if it has an email on file). Retries automatically against the email provider before failing.



## OpenAPI

````yaml https://api.timbrix.mx/api/openapi.json post /invoices/{uuid}/email
openapi: 3.0.0
info:
  title: Timbrix API
  description: >-
    API de facturación electrónica CFDI 4.0 para México, con servidor OAuth2
    para gestionar organizaciones, miembros y webhooks. Compatible con agentes
    de IA — ver la extensión `x-ai-agent-friendly` en la raíz de esta spec.


    REST API with OAuth2 server for managing organizations, members, and
    webhooks.
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: organizations
    description: Organization management endpoints
  - name: oauth
    description: OAuth2 authentication and authorization
  - name: webhooks
    description: Webhook configuration and delivery
  - name: users
    description: User information endpoints
  - name: api-keys
    description: API Keys management and validation
paths:
  /invoices/{uuid}/email:
    post:
      tags:
        - invoices
      summary: Send the CFDI (XML + PDF) by email to the receptor
      description: >-
        Authenticate with either a Supabase session (member of the invoice's
        organization) or an API key belonging to that same organization. `to` is
        optional — if omitted, the recipient is resolved from the Customer
        registered for the invoice's RFC receptor (if it has an email on file).
        Retries automatically against the email provider before failing.
      operationId: InvoicesController_sendEmail
      parameters:
        - name: uuid
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendInvoiceEmailDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceEmailSendResponseDto'
        '400':
          description: >-
            No recipient email available (no matching Customer, or Customer has
            no email) and `to` was not provided
        '403':
          description: Caller does not belong to the invoice's organization
        '404':
          description: uuid does not match any invoice
        '503':
          description: Email provider unavailable after automatic retries
      security:
        - apiKey: []
        - bearer: []
components:
  schemas:
    SendInvoiceEmailDto:
      type: object
      properties:
        to:
          type: string
          example: cliente@example.com
          description: >-
            Correo del receptor al que se enviará el CFDI. Si se omite, se usa
            el correo del Customer registrado con el RFC receptor de la factura
            (si existe). Si no hay un Customer con correo registrado y tampoco
            se envía este campo, la solicitud falla con 400.
    InvoiceEmailSendResponseDto:
      type: object
      properties:
        id:
          type: string
        invoiceId:
          type: string
        sentTo:
          type: string
          example: cliente@example.com
        status:
          type: string
          enum:
            - sent
            - failed
        sentBy:
          type: object
          description: >-
            ID del usuario de la sesión que solicitó el envío. `null` si se
            envió con una API key.
        createdAt:
          format: date-time
          type: string
      required:
        - id
        - invoiceId
        - sentTo
        - status
        - createdAt
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API Key for authentication (format: sk_...)'
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````