Skip to content

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

NameTypeRequiredDescription
container_idstring (uuid) optionalThe container whose templates are wanted, together with the ones above it.
cursorstring optional
sizeinteger
  • default: 50
  • minimum: 1
  • maximum: 200
optional

Responses

Example bash
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

NameTypeRequiredDescription
Idempotency-Keystring (uuid) optionalA UUID; identical requests return the same result for 24 h.

Request body application/json — TemplateInput

NameTypeRequiredDescription
scope_typeTemplateScope
  • TENANT
  • HUB
  • COLLECTION
requiredWhere the template is defined and therefore who can use it: the whole workspace, one hub and everything under it, or one collection.
scope_idstring (uuid), or null optional
namestring
  • maxLength: 200
required
descriptionstring, or null
  • maxLength: 2000
optional
root_typeItemType
  • TASK
  • WORK_PACKAGE
  • ACTIVITY
requiredExtensible; /meta/capabilities returns the valid values.
nodesarray of TemplateNode required
typeItemType
  • TASK
  • WORK_PACKAGE
  • ACTIVITY
requiredExtensible; /meta/capabilities returns the valid values.
titlestring
  • maxLength: 500
required
notesstring, or null optional
due_offsetstring, or null optionalAn ISO-8601 duration from the instantiation's anchor - P3D is "three days in", -P1D is "the day before".
due_date_onlyboolean
  • default: false
optionalTrue for a node whose due date is a day rather than a moment.
assignee_idstring (uuid), or null optionalWho this step always belongs to.
childrenarray of TemplateNode optional
typeItemType
  • TASK
  • WORK_PACKAGE
  • ACTIVITY
requiredExtensible; /meta/capabilities returns the valid values.
titlestring
  • maxLength: 500
required
notesstring, or null optional
due_offsetstring, or null optionalAn ISO-8601 duration from the instantiation's anchor - P3D is "three days in", -P1D is "the day before".
due_date_onlyboolean
  • default: false
optionalTrue for a node whose due date is a day rather than a moment.
assignee_idstring (uuid), or null optionalWho this step always belongs to.
childrenarray of TemplateNode optional

Responses

Example bash
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

Path parameters

NameTypeRequiredDescription
templateIdstring (uuid) required

Responses

Example bash
curl -X GET "$HUBTASK_URL/templates/{templateId}" \  -H "Authorization: Bearer $HUBTASK_TOKEN"

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

NameTypeRequiredDescription
templateIdstring (uuid) required

Headers

NameTypeRequiredDescription
If-Matchstring optionalThe ETag of the state last read (optimistic locking).

Request body application/merge-patch+json — TemplateUpdate

NameTypeRequiredDescription
namestring
  • maxLength: 200
optional
descriptionstring, or null
  • maxLength: 2000
optional
nodesarray of TemplateNode optional
typeItemType
  • TASK
  • WORK_PACKAGE
  • ACTIVITY
requiredExtensible; /meta/capabilities returns the valid values.
titlestring
  • maxLength: 500
required
notesstring, or null optional
due_offsetstring, or null optionalAn ISO-8601 duration from the instantiation's anchor - P3D is "three days in", -P1D is "the day before".
due_date_onlyboolean
  • default: false
optionalTrue for a node whose due date is a day rather than a moment.
assignee_idstring (uuid), or null optionalWho this step always belongs to.
childrenarray of TemplateNode optional
typeItemType
  • TASK
  • WORK_PACKAGE
  • ACTIVITY
requiredExtensible; /meta/capabilities returns the valid values.
titlestring
  • maxLength: 500
required
notesstring, or null optional
due_offsetstring, or null optionalAn ISO-8601 duration from the instantiation's anchor - P3D is "three days in", -P1D is "the day before".
due_date_onlyboolean
  • default: false
optionalTrue for a node whose due date is a day rather than a moment.
assignee_idstring (uuid), or null optionalWho this step always belongs to.
childrenarray of TemplateNode optional

Responses

Example bash
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

NameTypeRequiredDescription
templateIdstring (uuid) required

Headers

NameTypeRequiredDescription
If-Matchstring optionalThe ETag of the state last read (optimistic locking).

Responses

  • 204 Deleted
  • 4XX An error per RFC 9457 Problem
Example bash
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

NameTypeRequiredDescription
templateIdstring (uuid) required

Headers

NameTypeRequiredDescription
Idempotency-Keystring (uuid) optionalA UUID; identical requests return the same result for 24 h.

Request body application/json — TemplateInstantiation

NameTypeRequiredDescription
collection_idstring (uuid) requiredThe collection the tree lands in.
parent_idstring (uuid), or null optionalThe entry the tree hangs from, when the template's root type is one that sits under another.
anchor_datestring (date), or null optionalThe day the relative dates count from, read in the caller's time zone.
titlestring, or null
  • maxLength: 500
optionalThe root entry's title, overriding the template's own.

Responses

Example bash
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"}'