> ## 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 all UI templates for an API

> List all UI templates for a specific API/application.

Args:
    api_name: API name (also used as application_id for search)
    detailed: If True, returns full template data including HTML. If False, returns summary only.

Returns:
    UITemplateListResponse (if detailed=True) or UITemplateSummaryListResponse (if detailed=False)
    with list of all templates for the API



## OpenAPI

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

        Args:
            api_name: API name (also used as application_id for search)
            detailed: If True, returns full template data including HTML. If False, returns summary only.

        Returns:
            UITemplateListResponse (if detailed=True) or UITemplateSummaryListResponse (if detailed=False)
            with list of all templates for the API
      operationId: ui_templates_list_by_api
      parameters:
        - name: api_name
          in: path
          required: true
          schema:
            type: string
            title: Api Name
        - name: detailed
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              If true, returns full template data including HTML content. If
              false, returns summary without HTML.
            default: false
            title: Detailed
          description: >-
            If true, returns full template data including HTML content. If
            false, returns summary without HTML.
      responses:
        '200':
          description: >-
            List of templates (detailed or summary based on 'detailed' query
            parameter)
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/UITemplateListResponse'
                  - $ref: '#/components/schemas/UITemplateSummaryListResponse'
                title: Response Ui Templates List By Api
                oneOf:
                  - $ref: '#/components/schemas/UITemplateListResponse'
                  - $ref: '#/components/schemas/UITemplateSummaryListResponse'
        '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.
    UITemplateSummaryListResponse:
      properties:
        templates:
          items:
            $ref: '#/components/schemas/UITemplateSummaryItem'
          type: array
          title: Templates
          description: List of template summaries
      type: object
      required:
        - templates
      title: UITemplateSummaryListResponse
      description: Response containing summary list of templates (without HTML content).
    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.
    UITemplateSummaryItem:
      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
        has_html:
          type: boolean
          title: Has Html
          description: Whether the template has HTML content
        has_csp:
          type: boolean
          title: Has Csp
          description: Whether the template has CSP configuration
          default: false
        has_ui_meta:
          type: boolean
          title: Has Ui Meta
          description: Whether the template has UI metadata
          default: false
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: ISO timestamp when template was created
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
          description: ISO timestamp when template was last updated
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: User identifier (e.g. email) who created the template
      type: object
      required:
        - id
        - has_html
      title: UITemplateSummaryItem
      description: Summary of a template (without HTML content and full metadata).
    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}'

````