> ## 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.

# List UI templates for an operation

> List all UI templates for a specific operation.

Args:
    api_name: API name (also used as application_id for search)
    operation_id: Operation ID to filter templates

Returns:
    UITemplateListResponse with list of templates for the operation



## OpenAPI

````yaml get /api/ui-templates/{api_name}/operations/{operation_id}
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}/operations/{operation_id}:
    get:
      tags:
        - UI Templates
      summary: List UI templates for an operation
      description: |-
        List all UI templates for a specific operation.

        Args:
            api_name: API name (also used as application_id for search)
            operation_id: Operation ID to filter templates

        Returns:
            UITemplateListResponse with list of templates for the operation
      operationId: ui_templates_list_by_operation
      parameters:
        - name: api_name
          in: path
          required: true
          schema:
            type: string
            title: Api Name
        - name: operation_id
          in: path
          required: true
          schema:
            type: string
            title: Operation Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UITemplateListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    UITemplateListResponse:
      properties:
        templates:
          items:
            $ref: '#/components/schemas/UITemplateItem'
          type: array
          title: Templates
          description: List of templates
      type: object
      required:
        - templates
      title: UITemplateListResponse
      description: Response containing list of templates.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UITemplateItem:
      properties:
        id:
          type: string
          title: Id
          description: Template ID
        application_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Application Id
          description: Application/API name
        operation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Operation Id
          description: Operation ID
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: Template type
        is_default:
          type: boolean
          title: Is Default
          description: Whether this is the default template
          default: false
        html:
          type: string
          title: Html
          description: HTML content
        template_format:
          type: string
          title: Template Format
          description: 'Template format: mcp-app or handlebars'
          default: mcp-app
        csp_config:
          anyOf:
            - $ref: '#/components/schemas/CSPConfig'
            - type: 'null'
          description: Manual CSP configuration (if stored separately)
        ui_meta:
          anyOf:
            - $ref: '#/components/schemas/UIResourceMeta'
            - type: 'null'
          description: >-
            UI resource metadata with all advanced settings: CSP, permissions
            (camera, microphone, geolocation, clipboardWrite), domain, and
            prefersBorder
      type: object
      required:
        - id
        - html
      title: UITemplateItem
      description: Single template in list response.
    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
    CSPConfig:
      properties:
        resourceDomains:
          items:
            type: string
          type: array
          title: Resourcedomains
          description: >-
            Origins for static resources (images, scripts, stylesheets, fonts,
            media)
        connectDomains:
          items:
            type: string
          type: array
          title: Connectdomains
          description: Origins for network requests (fetch/XHR/WebSocket)
        frameDomains:
          items:
            type: string
          type: array
          title: Framedomains
          description: Origins for nested iframes
        baseUriDomains:
          items:
            type: string
          type: array
          title: Baseuridomains
          description: Allowed base URIs for the document
      type: object
      title: CSPConfig
      description: CSP configuration for UI templates.
    UIResourceMeta:
      properties:
        csp:
          anyOf:
            - $ref: '#/components/schemas/CSPConfig'
            - type: 'null'
          description: >-
            Content Security Policy configuration for external resources
            (images, scripts, fonts, API calls, iframes)
        permissions:
          anyOf:
            - $ref: '#/components/schemas/PermissionsConfig'
            - type: 'null'
          description: >-
            Sandbox permissions requested by the UI (camera, microphone,
            geolocation, clipboardWrite)
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
          description: >-
            Dedicated origin for view (host-dependent format). Used for isolated
            iframe contexts.
        prefersBorder:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Prefersborder
          description: >-
            Visual boundary preference: true=show border around iframe, false=no
            border (seamless integration)
      type: object
      title: UIResourceMeta
      description: >-
        UI resource metadata configuration per MCP Apps spec.


        Includes all advanced settings:

        - CSP: Content Security Policy for external resources

        - Permissions: Sandbox permissions (camera, microphone, geolocation,
        clipboardWrite)

        - Domain: Dedicated origin for the view

        - PrefersBorder: Visual boundary preference
    PermissionsConfig:
      properties:
        camera:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Camera
          description: Request camera access. Set to {} to request permission.
        microphone:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Microphone
          description: Request microphone access. Set to {} to request permission.
        geolocation:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Geolocation
          description: Request geolocation access. Set to {} to request permission.
        clipboardWrite:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Clipboardwrite
          description: Request clipboard write access. Set to {} to request permission.
      type: object
      title: PermissionsConfig
      description: >-
        Permissions configuration for UI templates.


        Each permission is an empty object {} when requested, or omitted if not
        needed.

        These permissions are requested from the host when the UI is loaded.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        'Authorization: Bearer {token}'

````