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

# Detach a template from a state

> Remove a template's attachment and recompose the effective schema — nothing else.

Consults the detach referees FIRST: a template still named by a live door binding (a
preset version, a conversation config, a hook, a schedule) is a 409 that detaches nothing
and lists the referencing bindings — the attach-at-save contract's referee, so a binding
never faults at run time on a template detached out from under it.



## OpenAPI

````yaml /openapi.json delete /api/states/{name}/attachments/{template}
openapi: 3.1.0
info:
  description: The operator HTTP surface served under /api/*.
  title: tai42-skeleton API
  version: 14.0.2
servers: []
security: []
paths:
  /api/states/{name}/attachments/{template}:
    delete:
      tags:
        - states
      summary: Detach a template from a state
      description: >-
        Remove a template's attachment and recompose the effective schema —
        nothing else.


        Consults the detach referees FIRST: a template still named by a live
        door binding (a

        preset version, a conversation config, a hook, a schedule) is a 409 that
        detaches nothing

        and lists the referencing bindings — the attach-at-save contract's
        referee, so a binding

        never faults at run time on a template detached out from under it.
      operationId: delete_api_states_name_attachments_template
      parameters:
        - in: path
          name: name
          required: true
          schema:
            type: string
        - in: path
          name: template
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/DetachAck'
                required:
                  - data
                type: object
          description: Success.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Resource not found.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Conflict with the current resource state.
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    DetachAck:
      description: >-
        A template-detach confirmation — the ``state`` and ``template``
        detached.
      properties:
        detached:
          title: Detached
          type: boolean
        state:
          title: State
          type: string
        template:
          title: Template
          type: string
      required:
        - detached
        - state
        - template
      title: DetachAck
      type: object
    Error:
      properties:
        code:
          description: >-
            Stable machine-readable reason a client keys a dedicated error state
            on, present on refusals that opt in (e.g. a 501 not-configured
            refusal). Optional: absent when the error carries only a
            human-readable message.
          type: string
        error:
          type: string
      required:
        - error
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````