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

# Preview a transmission

> Validates the recipient list and template and stores the result as a draft, without sending anything. Review the draft, then confirm it to dispatch.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/transmissions/preview
openapi: 3.1.0
info:
  contact:
    email: suporte@izap.ai
    name: iZap API Support
  description: Public REST API for the iZap WhatsApp business messaging platform.
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  title: iZap API
  version: v1
servers:
  - description: Production
    url: https://api.izap.ai
  - description: Staging
    url: https://api-staging.izap.ai
security: []
tags:
  - description: >-
      Personal access tokens for calling this API, plus introspection of the
      token presented on a request.
    name: api-tokens
  - description: >-
      Create a business, read and update its profile, and manage its opening
      hours.
    name: businesses
  - description: >-
      Reusable images belonging to the caller's business, referenced when
      composing messages.
    name: business-library
  - description: Product catalog menus a business publishes to its customers.
    name: menus
  - description: >-
      Provision and inspect the WhatsApp Cloud API numbers attached to a
      business: registration, WABA details, per-number assistant binding and
      catalog sends.
    name: whatsapp-cloud
  - description: >-
      Conversation lifecycle — list, create and delete chats, and control read,
      snooze, status and AI pause state.
    name: chats
  - description: >-
      Read a conversation's messages, send free-form or template replies, and
      upload attachments.
    name: messages
  - description: >-
      Manage WhatsApp message templates: draft them locally, submit them to Meta
      for review and sync approval status back.
    name: whatsapp-templates
  - description: >-
      Bulk template sends. A transmission is previewed into a draft, then
      confirmed or cancelled — confirming dispatches to real recipients.
    name: transmissions
  - description: >-
      Register URLs that receive signed event deliveries when something happens
      in a business, rotate their signing secrets, and replay an individual
      delivery.
    name: webhooks
  - description: >-
      Server-rendered order visualisation page for a business slug, behind HTTP
      Basic auth.
    name: orders
paths:
  /api/v1/transmissions/preview:
    post:
      tags:
        - transmissions
      summary: Preview a transmission
      description: >-
        Validates the recipient list and template and stores the result as a
        draft, without sending anything. Review the draft, then confirm it to
        dispatch.
      operationId: previewTransmission
      parameters:
        - in: header
          name: business-id
          required: true
          schema:
            format: uuid
            title: Business-Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTransmissionPreviewIn'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransmissionPreviewOut'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Missing or invalid credentials.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: The credential is valid but not authorized for this action.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: The resource, or the business named in the request, does not exist.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Unexpected error.
      security:
        - bearerAuth: []
components:
  schemas:
    CreateTransmissionPreviewIn:
      description: >-
        Validate CSV recipients against a template and create a DRAFT
        transmission.


        No messages are sent. ``recipients`` are parsed CSV rows (header ->
        value); each

        row must contain ``phone_column`` and the columns that fill the
        template's

        variables. Confirm the returned draft id with ``confirm_transmission``
        to send.
      properties:
        business_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Business Id
        max_messages_per_minute:
          default: 60
          description: Sending pace cap. Must be between 1 and 200 messages per minute.
          maximum: 200
          minimum: 1
          title: Max Messages Per Minute
          type: integer
        name:
          description: Human label for the transmission.
          maxLength: 255
          minLength: 1
          title: Name
          type: string
        phone_column:
          default: phone
          description: >-
            Name of the CSV column holding the recipient phone number (E.164 or
            local).
          maxLength: 255
          minLength: 1
          title: Phone Column
          type: string
        recipients:
          description: >-
            Parsed CSV rows; each row maps a string column header to its string
            cell value. Must include the phone column and the columns that
            supply the template's variables.
          items:
            additionalProperties:
              type: string
            type: object
          maxItems: 5000
          minItems: 1
          title: Recipients
          type: array
        scheduled_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            When to send. Omit or null to send immediately on confirm. If the
            value has no timezone offset it is interpreted in 'timezone'.
          title: Scheduled At
        template_language:
          default: pt_BR
          description: Template language/locale code as registered with Meta, e.g. 'pt_BR'.
          maxLength: 15
          minLength: 2
          title: Template Language
          type: string
        template_name:
          description: Name of the pre-approved WhatsApp Cloud API template to send.
          maxLength: 512
          minLength: 1
          title: Template Name
          type: string
        timezone:
          default: America/Sao_Paulo
          description: IANA timezone used to interpret a naive 'scheduled_at'.
          title: Timezone
          type: string
        transmission_type:
          const: whatsapp_template
          default: whatsapp_template
          description: Only 'whatsapp_template' is supported for now.
          title: Transmission Type
          type: string
        variable_columns:
          anyOf:
            - items:
                type: string
              maxItems: 50
              type: array
            - type: 'null'
          description: >-
            For positional templates ({{1}}, {{2}}, ...): the ordered CSV header
            names mapping to {{1}}, {{2}}, ... If omitted, the first non-phone
            columns are used in order. Ignored for templates with named
            placeholders.
          title: Variable Columns
      required:
        - name
        - template_name
        - recipients
      title: CreateTransmissionPreviewIn
      type: object
    TransmissionPreviewOut:
      properties:
        business_id:
          format: uuid
          title: Business Id
          type: string
        column_mapping:
          additionalProperties:
            type: string
          title: Column Mapping
          type: object
        duplicate_count:
          title: Duplicate Count
          type: integer
        estimated_duration_seconds:
          title: Estimated Duration Seconds
          type: integer
        invalid_count:
          title: Invalid Count
          type: integer
        name:
          title: Name
          type: string
        not_on_whatsapp_count:
          default: 0
          title: Not On Whatsapp Count
          type: integer
        phone_column:
          title: Phone Column
          type: string
        recipient_count:
          title: Recipient Count
          type: integer
        sample_errors:
          items:
            $ref: '#/components/schemas/PreviewRowErrorOut'
          title: Sample Errors
          type: array
        scheduled_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Scheduled At
        status:
          title: Status
          type: string
        template_language:
          title: Template Language
          type: string
        template_name:
          title: Template Name
          type: string
        transmission_id:
          format: uuid
          title: Transmission Id
          type: string
        transmission_type:
          title: Transmission Type
          type: string
        uses_named_variables:
          title: Uses Named Variables
          type: boolean
        valid_count:
          title: Valid Count
          type: integer
        warnings:
          items:
            type: string
          title: Warnings
          type: array
      required:
        - transmission_id
        - name
        - status
        - transmission_type
        - template_name
        - template_language
        - uses_named_variables
        - recipient_count
        - valid_count
        - invalid_count
        - duplicate_count
        - column_mapping
        - phone_column
        - sample_errors
        - estimated_duration_seconds
        - scheduled_at
        - warnings
        - business_id
      title: TransmissionPreviewOut
      type: object
    ApiError:
      description: >-
        The response body of a handled API error.


        ``detail`` is either a plain string (FastAPI's default for an

        ``HTTPException`` raised with a string, and for the ``default``
        fastapi-users

        messages like ``"Not authenticated"``) or the structured

        :class:`ApiErrorDetail` object described above. ``code`` is present only
        on

        the top-level shape ``aizap.core.exceptions.AppException`` produces for
        its

        own 5xx responses (``"INTERNAL_ERROR"`` / ``"DB_ERROR"``); it does not

        duplicate the ``code`` nested inside a structured ``detail``.
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Code
        detail:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ApiErrorDetail'
          title: Detail
      required:
        - detail
      title: ApiError
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    PreviewRowErrorOut:
      properties:
        error:
          title: Error
          type: string
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        row_index:
          title: Row Index
          type: integer
      required:
        - row_index
        - phone
        - error
      title: PreviewRowErrorOut
      type: object
    ApiErrorDetail:
      additionalProperties: true
      description: |-
        The structured ``detail`` object some error responses carry.

        Several handlers (the REST API plan gate, the free-tier limits, the
        webhooks entitlement gate, the closed customer-service window) raise
        ``HTTPException(detail={"code": ..., "message": ..., ...})`` — a fixed
        ``code``/``message`` pair plus extra fields specific to that error.
        ``extra="allow"`` keeps those fields in the documented shape instead of
        dropping them.
      properties:
        code:
          title: Code
          type: string
        message:
          title: Message
          type: string
      required:
        - code
        - message
      title: ApiErrorDetail
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      description: >-
        Personal access token (izap_pat_…) sent as Authorization: Bearer
        <token>; dashboard session JWTs are also accepted.
      scheme: bearer
      type: http

````