Skip to main content

Templates

Templates store reusable workload configurations. The manifest field uses the same shape as Create Workload; manifest.type must match the template type.

All template endpoints are scoped to an organization. Replace {org_slug} with your organization slug.

Authentication

Authorization: Bearer <YOUR_API_TOKEN>

Create Template

POST /tha/v3/orgs/{org_slug}/templates

FieldTypeDescription
namestringRequired. Template name
descriptionstringOptional description
typestringRequired. Workload type (e.g. RENTAL)
manifestobjectRequired. Full create-workload body; manifest.type must equal type

Example

curl -X POST https://api.targon.com/tha/v3/orgs/{org_slug}/templates \
-H "Authorization: Bearer <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "pytorch-rental",
"type": "RENTAL",
"manifest": {
"type": "RENTAL",
"name": "pytorch-rental",
"image": "pytorch/pytorch:latest",
"resource_name": "h200-small"
}
}'

Response

{ "uid": "tpl-abc123def456" }

List Templates

GET /tha/v3/orgs/{org_slug}/templates

QueryTypeDescription
limitintegerMax items
cursorstringPagination cursor
typestringFilter by workload type
visibilitystringFilter by visibility: PUBLIC or PRIVATE. Defaults to both.

Each item: uid, name, description, type, manifest (raw JSON), visibility.


Get Template

GET /tha/v3/orgs/{org_slug}/templates/{template_uid}

Returns the full Template object including created_at and updated_at.


Update Template

PATCH /tha/v3/orgs/{org_slug}/templates/{template_uid}

Optional fields: name, description, manifest.


Delete Template

DELETE /tha/v3/orgs/{org_slug}/templates/{template_uid}

Returns 204 No Content.