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

# Set a UI template as the default for its operation

> Set a UI template as the default for its operation.

This will unset is_default for all other templates in the same operation,
then set is_default=true for the specified template.

Args:
    api_name: API name to determine which database to use (global or tenant)
    template_id: Unique identifier for the template

Returns:
    UITemplateSetDefaultResponse indicating success

Raises:
    HTTPException 404: If template not found



## OpenAPI

````yaml put /api/ui-templates/{api_name}/{template_id}/set-default
openapi: 3.1.0
info:
  title: Apigene
  description: Apigene API
  version: 1.0.0
  contact:
    name: Apigene Support
    url: https://app.apigene.ai
    email: support@apigene.ai
servers:
  - url: https://app.apigene.ai
security:
  - BearerAuth: []
paths:
  /api/ui-templates/{api_name}/{template_id}/set-default:
    put:
      tags:
        - UI Templates
      summary: Set a UI template as the default for its operation
      description: >-
        Set a UI template as the default for its operation.


        This will unset is_default for all other templates in the same
        operation,

        then set is_default=true for the specified template.


        Args:
            api_name: API name to determine which database to use (global or tenant)
            template_id: Unique identifier for the template

        Returns:
            UITemplateSetDefaultResponse indicating success

        Raises:
            HTTPException 404: If template not found
      operationId: ui_template_set_default
      parameters:
        - name: api_name
          in: path
          required: true
          schema:
            type: string
            title: Api Name
        - name: template_id
          in: path
          required: true
          schema:
            type: string
            title: Template Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UITemplateSetDefaultResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    UITemplateSetDefaultResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether operation was successful
        template_id:
          type: string
          title: Template Id
          description: Template ID that was set as default
      type: object
      required:
        - success
        - template_id
      title: UITemplateSetDefaultResponse
      description: Response for set-default action.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        'Authorization: Bearer {token}'

````