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.

Authentication

Authorization: Bearer <YOUR_API_KEY>

Create Template

POST /tha/v2/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/v2/templates \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-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/v2/templates

QueryTypeDescription
limitintegerMax items
cursorstringPagination cursor
typestringFilter by workload type
visibilitystringpublic or private

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


Get Template

GET /tha/v2/templates/{template_uid}

Returns the full Template object including created_at and updated_at.


Update Template

PATCH /tha/v2/templates/{template_uid}

Optional fields: name, description, manifest.


Delete Template

DELETE /tha/v2/templates/{template_uid}

Returns 204 No Content.