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

# Approve a prompt template

> Approves a proposed version (administrators only). Request guardrails then leave its constants unscored. Other approved versions of the same name are retired; an app has at most 10 approved templates.
The body must carry the content_hash of the version reviewed, as GET returned it: a proposed version can change in place, and the approval is refused with 409 (title "Prompt Template Changed") when it no longer matches. A request without it is a 400.



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml post /apps/{id}/prompt-templates/{template_id}/approve
openapi: 3.0.1
info:
  title: Midsommar API
  description: This is the API for the Midsommar user and group management system.
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    url: http://www.swagger.io/support
    email: support@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: //localhost:8080/api/v1
security: []
paths:
  /apps/{id}/prompt-templates/{template_id}/approve:
    post:
      tags:
        - apps
      summary: Approve a prompt template
      description: >-
        Approves a proposed version (administrators only). Request guardrails
        then leave its constants unscored. Other approved versions of the same
        name are retired; an app has at most 10 approved templates.

        The body must carry the content_hash of the version reviewed, as GET
        returned it: a proposed version can change in place, and the approval is
        refused with 409 (title "Prompt Template Changed") when it no longer
        matches. A request without it is a 400.
      parameters:
        - name: id
          in: path
          description: App ID
          required: true
          schema:
            type: integer
        - name: template_id
          in: path
          description: Template ID
          required: true
          schema:
            type: integer
      requestBody:
        description: The reviewed version's content_hash
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/api.AppPromptTemplateApproveInput'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.AppPromptTemplateResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.ErrorResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    api.AppPromptTemplateApproveInput:
      type: object
      properties:
        content_hash:
          type: string
          description: |-
            ContentHash is the content_hash of the version the administrator
            reviewed, as the API returned it with the parts shown. Required.
    api.AppPromptTemplateResponse:
      type: object
      properties:
        app_id:
          type: integer
        approved_at:
          type: string
        approved_by:
          type: integer
        content_hash:
          type: string
          description: |-
            ContentHash identifies this version's reviewed content (name,
            version, placement, parts, expiry). Approving takes it back.
        created_at:
          type: string
        created_by:
          type: integer
        expires_after_days:
          type: integer
        id:
          type: integer
        last_matched_at:
          type: string
        name:
          type: string
        parts:
          type: array
          items:
            $ref: '#/components/schemas/templates.Part'
        placement:
          $ref: '#/components/schemas/templates.Placement'
        ref:
          type: string
        status:
          type: string
        updated_at:
          type: string
        version:
          type: integer
    api.ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
              title:
                type: string
      description: Error response model
    templates.Part:
      type: object
      properties:
        const:
          type: string
        slot:
          type: string
    templates.Placement:
      type: object
      properties:
        anchor:
          type: string
        message:
          type: string
        role:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````