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

# Delete Template

> Deletes a single template. It is first read from Meta to resolve its name, then deleted by name plus template ID — so only the language version identified by `source_id` is removed, not every language sharing that name. Deleting the English version leaves the Turkish one untouched; call the endpoint once per `sourceId`.

**Deletion cannot be undone.** Meta removes the template permanently. Re-creating it starts a new review cycle (`PENDING`) and produces a new `sourceId`. Messages that still reference a deleted template will fail to send.

Success returns HTTP `200` with an envelope that carries no payload: `data` is null and, like every null field, is dropped from the response.



## OpenAPI

````yaml /public-openapi.json delete /wa/{app_id}/templates/{source_id}
openapi: 3.0.3
info:
  title: Connexease Public API
  version: 1.0.0
  description: >-
    Panel-independent API for managing WhatsApp Business operations from your
    own servers.


    Every endpoint is scoped to the organization resolved from your secret key.
    Read endpoints are uncached and proxy straight to the source.


    **On-premises installations** are served from your own domain with an extra
    `/public` segment: `https://{your_domain}/public/api/v1/...`.
    Authentication, bodies, responses, and error codes are identical.
servers:
  - url: https://public-api.gateway.connexease.com/api/v1
    description: Production
security:
  - secretKey: []
tags:
  - name: Analytics
    description: Organization-wide message volume.
  - name: Application
    description: The WhatsApp business profile linked to an application.
  - name: Template
    description: >-
      The full template lifecycle: create, list, inspect, update, delete, and
      measure.
  - name: Media
    description: >-
      Uploads that produce the single-use handle for template headers and the
      profile picture.
  - name: Developers
    description: Webhook configuration and API keys.
paths:
  /wa/{app_id}/templates/{source_id}:
    delete:
      tags:
        - Template
      summary: Delete Template
      description: >-
        Deletes a single template. It is first read from Meta to resolve its
        name, then deleted by name plus template ID — so only the language
        version identified by `source_id` is removed, not every language sharing
        that name. Deleting the English version leaves the Turkish one
        untouched; call the endpoint once per `sourceId`.


        **Deletion cannot be undone.** Meta removes the template permanently.
        Re-creating it starts a new review cycle (`PENDING`) and produces a new
        `sourceId`. Messages that still reference a deleted template will fail
        to send.


        Success returns HTTP `200` with an envelope that carries no payload:
        `data` is null and, like every null field, is dropped from the response.
      operationId: deleteTemplate
      parameters:
        - $ref: '#/components/parameters/AppId'
        - $ref: '#/components/parameters/SourceId'
      responses:
        '200':
          description: The template was deleted on Meta and soft-deleted locally.
          content:
            application/json:
              schema:
                type: object
                properties:
                  isSuccess:
                    type: boolean
                    enum:
                      - true
              example:
                isSuccess: true
        '400':
          description: Meta rejected a parameter (`META_037`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: >-
            Secret key missing or invalid (`ORGANIZATION_SECRET_010` / `011`),
            or Meta token invalid or expired (`META_034`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: Meta permission denied (`META_035`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: >-
            `app_id` not in the organization (`APPLICATION_004`), or `source_id`
            does not exist on Meta — already deleted or wrong ID (`META_075`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Meta rate limit (`META_036`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '502':
          description: >-
            General Meta-side failure while reading or deleting the template
            (`META_004`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  parameters:
    AppId:
      name: app_id
      in: path
      required: true
      description: >-
        Application ID. Must belong to the organization resolved from your
        secret key, otherwise the request returns `404` with `APPLICATION_004`.
      schema:
        type: string
        example: app_7poyXj8GXuv76e
    SourceId:
      name: source_id
      in: path
      required: true
      description: The template's Meta source ID.
      schema:
        type: string
        example: '1234567890123456'
  schemas:
    ErrorEnvelope:
      type: object
      description: >-
        Every failure shares this shape. `description` already has any `params`
        interpolated into it.
      properties:
        isSuccess:
          type: boolean
          enum:
            - false
        errors:
          type: object
          properties:
            code:
              type: string
              description: >-
                `VAL_*`, `WA_*`, `META_*`, `APPLICATION_*`,
                `ORGANIZATION_SECRET_*`, `REQ_001`, or `SYS_001`.
              example: META_075
            group:
              type: string
              enum:
                - VALIDATION
                - NOT_FOUND
                - CONFLICT
                - AUTHENTICATION
                - NOT_ALLOWED
                - LIMIT_EXCEEDED
                - SERVICE_UNAVAILABLE
                - SYSTEM
            description:
              type: string
              example: Template with 0000000000 not found in Meta.
            params:
              type: object
              additionalProperties: true
              description: >-
                Raw values interpolated into `description`. Present only on
                parametric messages.
            fields:
              type: object
              description: >-
                Field-level validation errors only. Field name (dot-joined for
                nested fields, list indices omitted) to its own `code` /
                `description` / `params`.
              additionalProperties:
                type: object
                properties:
                  code:
                    type: string
                  description:
                    type: string
                  params:
                    type: object
                    additionalProperties: true
          required:
            - code
            - group
            - description
      required:
        - isSuccess
        - errors
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: >-
        Secret key in `Bearer sk_...` format. Server-to-server only — never
        embed it in a browser or mobile client. The organization is resolved
        from the key, so `organization_id` is never passed explicitly.

````