Templates API
The template routes use /api/v1 and are for platform administrators only (the admin role in the panel's own organization). Any other caller, a reseller included, gets 404 not_found. They expose stored catalog records, including custom entries. Hidden templates (metadata.hidden) are never stored, so no caller, an admin included, receives them from the list or detail route, and deploying one is answered as not_found. A catalog template that is removed or hidden while services still use it keeps its stored record for those services only (redeploy, recreate, move and backups keep working), and the list, search, count and detail routes leave it out and a new deploy of it is answered as not_found too. A returned record is not a guarantee that it can be deployed on the current host.
List Templates
GET /api/v1/templates
| Parameter | Meaning |
|---|---|
category | Optional catalog category filter. |
search | Optional search text |
customerId | Optional customer UUID. Each template then carries planAccess for that customer's plan (below) |
limit | Default 50; values outside 1–100 fall back to 50 |
offset | Default 0; negative values become 0 |
curl 'https://panel.example.com/api/v1/templates?category=ai-agents&limit=50&offset=0' \
-H "Authorization: Bearer ${PANEL_API_KEY}"
The response contains data and pagination: {total, limit, offset}. Pagination counts catalog records matching the filter, not deployable cards. The handler does not implement featured or sort query parameters.
One request never returns more than 100 templates. A request without limit gets the first 50, and limit=1000 also gets 50, not an error. To read the whole catalog, repeat the request with limit=100 and offset increased by the number of rows received, until you have pagination.total rows or a page comes back empty. The panel's Templates page, command palette and service toolkit card read the catalog this way.
offset=0
while :; do
page=$(curl -s "https://panel.example.com/api/v1/templates?limit=100&offset=${offset}" \
-H "Authorization: Bearer ${PANEL_API_KEY}")
n=$(echo "$page" | jq '.data | length')
echo "$page" | jq -r '.data[].name'
offset=$((offset + n))
[ "$n" -eq 0 ] || [ "$offset" -ge "$(echo "$page" | jq '.pagination.total')" ] && break
done
Templates for one customer's plan
With customerId, each template in the list, and the detail route GET /api/v1/templates/{id}?customerId=…, carries a planAccess object. It is the answer a deploy for that customer would get, from the same rule:
"planAccess": { "allowed": false, "plan": "Starter", "reason": "category_not_in_plan" }
reason | Meaning |
|---|---|
category_not_in_plan | The plan's category list does not include the template's category |
exception_denied | A per-template exception on the plan leaves the template out |
tools_category | The template is in Tools, which no plan offers |
no_active_plan | The customer has no active plan; every template is refused, and plan is absent |
reason is absent when allowed is true. The plan is the one the customer's active subscription names. An unknown customer is answered 404 not_found. A customerId that is not a UUID is 400 validation_failed, and a plan that cannot be read is 503 service_unavailable rather than a list with nothing marked. The admin MCP tools list_templates and get_template take customer_id and return the same planAccess.
Get Template Detail
GET /api/v1/templates/{id}
Use the UUID id from the list. name is the slug (for example uptime-kuma), while displayName is the label. The route does not resolve a slug to a UUID.
Both list and detail return id, name, displayName, description, category, icon, tags, isCurated, isCustom, trending, featured, featuredOrder, gpuRequired, spec, createdBy, createdAt, and updatedAt. Optional links include website, github, and documentation, plus support (maintained or beta) on catalog templates. Custom templates have no support, and a request cannot set it. Catalog templates also return license (the upstream licence, information only), an optional one-line licenseNote, and lowProminence: true for a template that is never featured and is listed last in its category; a custom template returns none of the three. spec contains the Compose or Git definition, minResources, securityProfile, and variables.
Variable Schema
Read spec.variables, rather than a top-level variables field:
| Field | Meaning |
|---|---|
name | Substitution key |
displayName | Form label |
type | string, integer, boolean, password, or select |
default | String default |
required | Whether a value is required |
description | Help text |
options | For selects, objects with value and label |
locked, hidden | Optional form behavior flags |
content, mount | Optional file-variable fields |
Deployment accepts a string-to-string map, including values for integer and boolean variables. Follow the selected template's actual schema and validation errors; do not assume arbitrary min/max/pattern objects are part of this API.
Get Template Logo
The record's icon field carries the icon. There is no dedicated unauthenticated /templates/{id}/logo handler in this interface.
Deploy from Template
POST /api/v1/templates/{id}/deploy
Pick a deployable record, copy its UUID into the URL, and supply the variables it requires. The UUID below is illustrative; replace it with one from your panel.
curl -X POST https://panel.example.com/api/v1/templates/10000000-0000-4000-8000-000000000001/deploy \
-H "Authorization: Bearer ${PANEL_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{"name":"my-monitor","variables":{"SERVICE_NAME":"my-monitor"}}'
The body supports name, description, variables, optional customerId, resourceLimits, securityMode, and aiSource. Customer assignment is optional for an admin deployment; use an actual customer UUID when assigning one.
aiSource is provider_ai, local_ai, byo or none; omitted, the panel uses Provider AI when one is configured and Local AI otherwise. The server uses exactly the value sent and never derives it from variables: a request with "aiSource": "local_ai" and a provider key in variables is a Local AI deployment, and the app starts on the local model. Send "aiSource": "byo" to make the app use a key passed in variables. (The deploy page switches its selection to "Bring your own key" when a key is typed; that is the page's behavior, not the API's.)
resourceLimits (cpuCores, memoryMB, diskMB) must not be below the template's spec.minResources. If cpuCores or memoryMB is lower, the request is refused with 400 validation_failed and a message naming the minimum. If resourceLimits is omitted, the service runs with the template's minimum CPU and memory as its limits. A template whose spec.minResources.memoryMB is more than the server has free (available memory less 512 MB kept for the panel) is refused with 400 resource_insufficient; for an operator the message gives the free memory and the need, for a customer it does not. A server with fewer CPU cores than spec.minResources.cpuCores is not refused: the 202 response carries warnings: [{"code": "cpu_below_minimum", "message": "..."}], the app runs slowly, and the CPU floor for resourceLimits is the server's core count. GET /system/resources returns availableMemoryMB and memoryReserveMB so a client can make the same check before deploying. With a customerId, a deployment the customer's plan has no room for is refused with 403 quota_exceeded, and one for a customer whose plan has no free service place left with 403 service_limit_reached. A template the customer's plan does not offer (or any template, for a customer without an active plan) is refused with 403 template_not_in_plan; the plan is read from the customer's subscription, never from the request. Nothing is created in any of these cases. Without a customerId the service is the platform's own and no plan applies. See Templates a plan offers.
A template whose manifest sets spec.gpu_required (today vLLM) needs an NVIDIA GPU. When resourceLimits.gpus is left out, or sent as {"mode": ""}, the service gets every GPU of the server, as if you had sent {"mode": "all"}. A gpus choice you send (all, or devices with deviceIds) is kept. On a server whose Docker has no NVIDIA runtime (no NVIDIA Container Toolkit), the request is refused with 400 gpu_required and nothing is created. The MCP deploy_template tools apply the same rule.
Successful deployment queues work and returns 202 Accepted:
{
"serviceId": "20000000-0000-4000-8000-000000000002",
"deploymentId": "30000000-0000-4000-8000-000000000003",
"status": "pending"
}
Git-backed templates additionally return deployType: "git". Compose-backed results can include generatedSecrets; treat that response as sensitive and do not record it in logs, screenshots, or support messages. Poll service/deployment status to confirm completion.
Variable Validation
Invalid requests commonly return 400 with a validation_failed domain error. An unresolved-variable failure instead returns string error: "unresolved_variables", a message, and unresolvedVariables. Correct the payload using the selected record; there is no universal 422 field-error map.
Template Categories
Read categories from catalog records and use the category list filter. There is no separate category-count endpoint in this handler. See the template overview for the distinction between source manifests, hidden manifests, browser cards, and deployable entries.