> ## Documentation Index
> Fetch the complete documentation index at: https://kapso-1adbad2d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit a WhatsApp template for approval

> Submits a draft template to WhatsApp for approval. Only draft templates can be submitted.



## OpenAPI

````yaml api/legacy/openapi-whatsapp.yaml post /whatsapp_templates/{template_id}/submit
openapi: 3.0.3
info:
  title: Kapso External API - WhatsApp API
  description: >-
    API for programmatically interacting with Kapso agents, executions, and
    WhatsApp conversations. This specification includes only WhatsApp API
    endpoints.
  version: 1.0.0
  contact:
    name: Kapso Support
servers:
  - url: https://app.kapso.ai/api/v1
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /whatsapp_templates/{template_id}/submit:
    post:
      tags:
        - WhatsApp Templates
      summary: Submit a WhatsApp template for approval
      description: >-
        Submits a draft template to WhatsApp for approval. Only draft templates
        can be submitted.
      operationId: submitWhatsappTemplate
      parameters:
        - name: template_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                whatsapp_config_id:
                  type: string
                  format: uuid
                  description: >-
                    Optional specific WhatsApp configuration to use for
                    submission
                customer_id:
                  type: string
                  format: uuid
                  description: >-
                    Optional customer ID whose WhatsApp config to use for
                    submission
      responses:
        '200':
          description: Template submitted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  message:
                    type: string
                    example: Template submitted successfully
                  template_id:
                    type: string
                    format: uuid
                  template_name:
                    type: string
                  submission_id:
                    type: string
                    description: WhatsApp submission ID
                  data:
                    $ref: '#/components/schemas/WhatsappTemplate'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Template not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error (e.g., template not in draft status)
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: error
                  message:
                    type: string
                    example: Failed to submit template
                  error:
                    type: string
                    example: Only draft templates can be submitted
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: error
                  message:
                    type: string
                    example: 'Failed to submit template: Internal Error'
components:
  schemas:
    WhatsappTemplate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: template-123abc
        name:
          type: string
          example: appointment_reminder
        language_code:
          type: string
          example: en_US
        category:
          type: string
          enum:
            - MARKETING
            - UTILITY
            - AUTHENTICATION
          example: UTILITY
        status:
          type: string
          enum:
            - draft
            - submitted
            - approved
            - rejected
            - disabled
            - removed
          example: approved
        content:
          type: string
          example: Hello {{1}}, your appointment is confirmed for {{2}}.
        parameter_count:
          type: integer
          example: 2
        business_account_id:
          type: string
          nullable: true
          example: '123456789012345'
          description: WhatsApp Business Account ID this template belongs to
        whatsapp_config_ids:
          type: array
          items:
            type: string
            format: uuid
          example:
            - config-123abc
            - config-456def
          description: Array of WhatsApp config IDs this template is associated with
        components:
          type: array
          description: Raw WhatsApp template components structure
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - HEADER
                  - BODY
                  - FOOTER
                  - BUTTONS
              format:
                type: string
                enum:
                  - TEXT
                  - IMAGE
                  - VIDEO
                  - DOCUMENT
                  - LOCATION
              text:
                type: string
              example:
                type: object
              buttons:
                type: array
                items:
                  type: object
        metadata:
          type: object
          description: Additional metadata about the template
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
          example: Resource not found
        status:
          type: integer
          example: 404
        message:
          type: string
          example: The requested resource could not be found
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key required for all endpoints

````