API reference · Hubtask API 0.1.0
templates
GET /templates
List templates
The templates the caller may use, newest first. Naming a container answers the ones defined along that container's path - the collection's, its hub's and the workspace-wide ones - because that is the set a person picking a template in a collection can choose from. Naming none answers the workspace-wide ones alone.
Query parameters
Responses
200The templates TemplatePage4XXAn error per RFC 9457 Problem
curl -X GET "$HUBTASK_URL/templates" \ -H "Authorization: Bearer $HUBTASK_TOKEN" POST /templates
Create template
Defines a template: a name, a scope, and the tree it stamps out. The tree is validated here rather than at instantiation - a template that cannot produce anything is one nobody can fix from a failed instantiation - so the types have to be permitted under one another by this installation's capability profiles, and the tree has to stay inside the node cap in /meta/capabilities. A node's due date is relative: an ISO-8601 duration from the anchor of the instantiation, such as P3D for "three days in". Absolute dates are deliberately not stored: a template outlives the week it was written in.
Headers
Request body application/json — TemplateInput
curl -X POST "$HUBTASK_URL/templates" \ -H "Authorization: Bearer $HUBTASK_TOKEN" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "scope_type": "TENANT", "scope_id": "018f6e2a-2b7c-7c1e-9b1a-3d5e6f7a8b9c", "name": "string", "description": "string", "root_type": "TASK", "nodes": [ { "type": "TASK", "title": "string" } ]}' GET /templates/{templateId}
Get template
PATCH /templates/{templateId}
Update template
Changes a template. A merge patch: a member that is not sent is not touched. The node tree is one member and travels whole - a tree is a shape rather than a list of settings, and half of one is a different shape.
Path parameters
Headers
Request body application/merge-patch+json — TemplateUpdate
curl -X PATCH "$HUBTASK_URL/templates/{templateId}" \ -H "Authorization: Bearer $HUBTASK_TOKEN" \ -H 'If-Match: "<the ETag you read>"' \ -H "Content-Type: application/merge-patch+json" \ -d '{ "name": "string", "description": "string", "nodes": [ { "type": "TASK", "title": "string" } ]}' DELETE /templates/{templateId}
Delete template
Removes a template for good. The trees it has already stamped out are ordinary entries and outlive it, and a template defined later under the same name is a new template rather than the old one coming back. While a legal hold covers the template's scope it is kept, unreadable, until the hold is released.
Path parameters
Headers
Responses
204Deleted4XXAn error per RFC 9457 Problem
curl -X DELETE "$HUBTASK_URL/templates/{templateId}" \ -H "Authorization: Bearer $HUBTASK_TOKEN" \ -H 'If-Match: "<the ETag you read>"' POST /templates/{templateId}:instantiate
Instantiate template
Stamps the template out into a collection: an entry tree whose relative dates have become absolute ones, anchored either at a date the request names or at the moment of the call. The anchor is a date rather than an instant - "+3 days for a project starting Monday" is about days - and it is read in the caller's own time zone. What the target collection cannot carry is reported rather than dropped silently: an assignee who cannot see it, a label it does not have. Idempotent under its Idempotency-Key.
Path parameters
Headers
Request body application/json — TemplateInstantiation
Responses
201The tree the template produced TemplateInstance4XXAn error per RFC 9457 Problem
curl -X POST "$HUBTASK_URL/templates/{templateId}:instantiate" \ -H "Authorization: Bearer $HUBTASK_TOKEN" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "collection_id": "018f6e2a-2b7c-7c1e-9b1a-3d5e6f7a8b9c", "parent_id": "018f6e2a-2b7c-7c1e-9b1a-3d5e6f7a8b9c", "anchor_date": "2026-09-16", "title": "string"}'