Template Operations
List Templates
- System templates (available to all users)
- User’s private templates
- Templates shared with user’s teams
- Templates shared with user’s organizations
- Public templates
templates:read scope)
Response:
Template identifier (URL-safe, unique)
Human-readable template name
Template description
Category (e.g., “web”, “database”, “ai”)
Primary container image
Primary container port
CPU request (e.g., “100m”)
CPU limit (e.g., “500m”)
Memory request (e.g., “128Mi”)
Memory limit (e.g., “512Mi”)
HTTP health check path (e.g., “/health”)
Whether the template is enabled
Whether a ConfigMap is synced for this template
Whether this is a built-in system template
Array of environment variable definitions
Visibility scope:
private, team, org, or publicOrganization ID (for org-scoped templates)
Team ID (for team-scoped templates)
Organization name
Team name
Full YAML specification
Get Template Details
Template name
spec field with YAML specification.
Example:
Create Template
templates:write scope)
Request Body:
Template identifier (must be URL-safe, alphanumeric + hyphens)
Human-readable name
Template description
Category for grouping (e.g., “web”, “database”)
Container image
Container port (default: 8080)
CPU request (default: “100m”)
CPU limit (default: “500m”)
Memory request (default: “128Mi”)
Memory limit (default: “512Mi”)
HTTP health check path (default: ”/”)
Enable the template (default: true)
Whether to sync a ConfigMap
Array of environment variable definitions
Visibility scope:
private, team, org, or public (default: private)Organization ID (required for org visibility)
Team ID (required for team visibility)
Full YAML specification (JSON string)
Array of secret definitions (values stored in Vault)
privatevisibility: No special permissions requiredteamvisibility: Requiresteam_adminroleorgvisibility: Requiresorg_ownerororg_adminrolepublicvisibility: Requiresplatform_adminrole
- Template creation triggers automatic sync to Kubernetes ConfigMap
- Secret values are stripped from spec and stored separately in Vault
- If sync fails, template creation is rolled back
Update Template
Template name (cannot be changed)
name is ignored).
Response: 200 OK
Example:
Delete Template
Template name
AI Template Generation
Generate Template with AI
templates:write scope)
Request Body:
Natural language description of the desired template (e.g., “Create a PostgreSQL database with persistent storage”)
Generated template name
Human-readable name
Template description
Template category
Full YAML specification
- AI generation can take 15-30 seconds
- Requires Anthropic API key in server configuration
- Generated template is automatically saved to the database
- Uses organization’s
aiContextfield for personalized results - If template name already exists, it’s updated instead of creating a duplicate
AI template generation requires
ANTHROPIC_API_KEY to be configured on the server. If not configured, this endpoint returns 503 Service Unavailable.Template Specification Format
Templates use a YAML-based specification format that defines services, resources, volumes, and secrets:Services
Each service defines a container:Service name (used in DNS)
Container image
Port the container listens on
HTTP health check path
CPU and memory requests/limits
Environment variables
Secret references (values in Vault)
Volume mounts
Environment Variables
Environment variables can be defined at deployment time:Secrets
Secrets are defined in templates but values are stored in Vault:Template Visibility Scopes
Templates support four visibility levels:Private
Visible only to the creating user.Team
Visible to all members of a specific team.Organization
Visible to all members of an organization.Public
Visible to all users (system templates).Error Responses
Human-readable error message
Common Error Codes
- 400 Bad Request - Invalid template name or spec format
- 403 Forbidden - Insufficient permissions for visibility scope or attempting to modify system template
- 404 Not Found - Template not found or not accessible
- 409 Conflict - Template name already exists
- 500 Internal Server Error - ConfigMap sync failed or database error
- 503 Service Unavailable - Template storage not configured or AI generation unavailable