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
| Field | Type | Description |
|---|---|---|
name | string | Required. Template name |
description | string | Optional description |
type | string | Required. Workload type (e.g. RENTAL) |
manifest | object | Required. 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
| Query | Type | Description |
|---|---|---|
limit | integer | Max items |
cursor | string | Pagination cursor |
type | string | Filter by workload type |
visibility | string | public 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.