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

# Delete a message template

> Soft-deletes a workspace-owned message template. Fails with 409 when the entity is still referenced (active campaign steps, other AI entities embedding it). Requires the AI variable split to be enabled for the workspace; otherwise returns 403.

    > **Required scope:** `AI_VARIABLES_WRITE`
    >
    > **Rate limit:** 30 requests per minute



## OpenAPI

````yaml https://openapi.enginy.ai/definitions.json delete /v1/ai-variables/message-templates/{messageTemplateId}
openapi: 3.1.0
info:
  title: Enginy API
  version: 1.0.0
  description: Public API for Enginy platform
servers:
  - url: https://openapi.enginy.ai
    description: Configured server
security: []
tags:
  - name: AI Variables
    description: >-
      Manage AI variables and discover the entity fields you can reference in
      prompts and entity requests.
  - name: Inbox
    description: >-
      Inbox endpoints for listing contact threads, reading thread messages,
      managing tags, and sending manual replies.
  - name: Workflows
    description: >-
      Build, validate, publish, run, and inspect advanced (graph) workflows,
      plus the block/condition catalog needed to author a workflow plan.
paths:
  /v1/ai-variables/message-templates/{messageTemplateId}:
    delete:
      tags:
        - AI Variables
      summary: Delete a message template
      description: >-
        Soft-deletes a workspace-owned message template. Fails with 409 when the
        entity is still referenced (active campaign steps, other AI entities
        embedding it). Requires the AI variable split to be enabled for the
        workspace; otherwise returns 403.

            > **Required scope:** `AI_VARIABLES_WRITE`
            >
            > **Rate limit:** 30 requests per minute
      parameters:
        - schema:
            type: string
            minLength: 1
          required: true
          name: messageTemplateId
          in: path
      responses:
        '200':
          description: Message template deleted successfully
        '403':
          description: >-
            AI variable split not enabled for this workspace, or the entity is a
            default one and cannot be deleted
        '404':
          description: Message template not found in this workspace
        '409':
          description: Message template is in use and cannot be deleted
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````