Get a UI template by ID
Get a UI template by ID with CSP configuration from database.
Database is determined from the template_id (format: ::::). The api_name URL parameter is ignored for DB routing.
CSP Configuration:
- Only uses manually configured CSP stored in the database (csp_config or ui_meta.csp)
- If no CSP is configured, returns empty CSP (self-contained, no external resources)
- All CSP fields are always included (empty arrays as placeholders when not needed)
Args: api_name: API name (ignored, kept for URL compatibility) template_id: Unique identifier for the template
Returns: UITemplateResponse with template ID, HTML content, and CSP configuration (all fields included)
Raises: HTTPException 404: If template not found
Authorizations
JWT Authorization header using the Bearer scheme. Example: 'Authorization: Bearer {token}'
Response
Successful Response
Response containing UI template data with all advanced settings.
Includes:
- HTML content for rendering
- UI metadata (ui_meta) with all advanced settings:
- CSP: Content Security Policy
- Permissions: camera, microphone, geolocation, clipboardWrite
- Domain: Dedicated origin for view
- PrefersBorder: Visual boundary preference
Template ID
HTML content
Whether this is the default template for the operation
UI resource metadata with all advanced settings: CSP, permissions (camera, microphone, geolocation, clipboardWrite), domain, and prefersBorder
Template format: mcp-app or handlebars
