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

# Validate a template draft

> Check a WhatsApp template draft for errors without saving it. Takes the same body as POST /v1/templates.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/templates/validate
openapi: 3.0.0
info:
  title: Flowella REST API
  version: 2.1.0
  description: >-
    Public v1 HTTP API for Flowella. Authenticate with `Authorization: Bearer
    <api_key>` (`flo_` prefix) or an OAuth access token (`fla_` prefix).
    Canonical base: `https://api.flowella.io/v1`. Legacy
    `https://app.flowella.io/api/v1/...` requests are permanently redirected
    (308) to the canonical host, preserving method and body.
servers:
  - url: https://api.flowella.io
    description: Canonical API host
  - url: https://app.flowella.io
    description: Legacy app host — /api/v1 permanently redirects (308) to the API host /v1
security: []
tags:
  - name: System
    description: Health and auth checks
  - name: Account
    description: Credential and organisation details
  - name: Messages
    description: Send WhatsApp messages
  - name: Conversations
    description: Inbox conversations
  - name: Contacts
    description: CRM contacts
  - name: Templates
    description: WhatsApp templates and bulk send
  - name: Analytics
    description: Usage and delivery metrics
paths:
  /v1/templates/validate:
    post:
      tags:
        - Templates
      summary: Validate a template draft
      description: >-
        Checks a template draft without saving it: name format, language code,
        components and variable examples, carousel rules, and whether the same
        name and language already exist on the WhatsApp Business Account. Takes
        the same body as POST /v1/templates. Fix every issue before creating or
        submitting.
      operationId: v1ValidateTemplate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 512
                  pattern: ^[a-z0-9_]+$
                  description: >-
                    Template name: lowercase letters, numbers, and underscores
                    only.
                language:
                  type: string
                  minLength: 2
                  maxLength: 32
                  description: Language code, for example en, en_US, tr, pt_BR.
                category:
                  type: string
                  enum:
                    - MARKETING
                    - UTILITY
                    - AUTHENTICATION
                  default: UTILITY
                  description: 'Template category: UTILITY, MARKETING, or AUTHENTICATION.'
                components:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - HEADER
                          - BODY
                          - FOOTER
                          - BUTTONS
                          - CAROUSEL
                    required:
                      - type
                  description: >-
                    Ordered components: HEADER, BODY, FOOTER, BUTTONS, CAROUSEL.
                    HEADER format TEXT (text; example.header_text for {{1}}),
                    IMAGE, VIDEO or DOCUMENT (example.header_handle
                    ["https://..."], uploaded to Meta on submit; not http, and a
                    wrong file type fails submit), or LOCATION. Carousel card
                    headers too. Buttons: QUICK_REPLY (text, max 10, adjacent),
                    URL (text, https url, example for {{1}}, max 2),
                    PHONE_NUMBER (text, phone_number, 1), FLOW (text, flow_id,
                    1), COPY_CODE (example up to 20 chars, 1), OTP (otp_type
                    COPY_CODE or ONE_TAP, alone, AUTHENTICATION).
                wabaId:
                  type: string
                  minLength: 1
                  description: >-
                    WhatsApp Business Account id. Omit to use the WABA of
                    whatsappChannelId or the default channel.
                whatsappChannelId:
                  type: string
                  format: cuid
                  description: >-
                    WhatsApp channel id from GET /v1/channels. Omit to use the
                    default number where optional.
                headerDocumentFileName:
                  type: string
                  nullable: true
                  maxLength: 255
                  description: >-
                    File name shown on WhatsApp for a DOCUMENT header, for
                    example flowella-playbook.pdf. Sanitised to 60 characters
                    with a supported extension (pdf added when missing).
                    Flowella-side only: it is not sent to Meta for review. Empty
                    string or null clears it. When unset, the slugged template
                    name is used.
                  example: flowella-playbook.pdf
              required:
                - name
                - language
              example:
                name: order_update
                language: en_US
                category: UTILITY
                wabaId: '1234567890'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                    description: True when create and submit would accept this draft.
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                        field:
                          type: string
                          nullable: true
                        message:
                          type: string
                      required:
                        - code
                        - field
                        - message
                  warnings:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                        field:
                          type: string
                          nullable: true
                        message:
                          type: string
                      required:
                        - code
                        - field
                        - message
                required:
                  - valid
                  - issues
                  - warnings
                example:
                  valid: false
                  issues:
                    - code: INVALID_COMPONENTS
                      field: components
                      message: Body variable sample is missing for {{1}}.
                  warnings: []
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      requestId:
                        type: string
                      details:
                        nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
                description: >-
                  Machine codes include INVALID_TEMPLATE_NAME and
                  INVALID_TEMPLATE_COMPONENTS. requestId is copied from
                  X-Request-Id when present.
                example:
                  error:
                    code: INVALID_TEMPLATE_COMPONENTS
                    message: INVALID_TEMPLATE_COMPONENTS
                    requestId: req_019abc
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      requestId:
                        type: string
                      details:
                        nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
                description: >-
                  Machine codes include INVALID_TEMPLATE_NAME and
                  INVALID_TEMPLATE_COMPONENTS. requestId is copied from
                  X-Request-Id when present.
                example:
                  error:
                    code: INVALID_TEMPLATE_COMPONENTS
                    message: INVALID_TEMPLATE_COMPONENTS
                    requestId: req_019abc
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Organization API key (`flo_…`) or OAuth access token (`fla_…`). Paste
        the full token; Scalar sends `Authorization: Bearer <token>`.

````

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