Save a step template
Saves a list of steps as a template of the key's person's own, for their next projects.
Changing a project's steps later never changes its template.
Authorization
Authorization: Bearer <key> Authentication
Headers
The language tag Werk writes the answer's own words in, such as step names and history lines, matched to a language it serves; a card's text stays as written. At a project's paths, the reads of its cards and steps, of a card, its update photos, a file and its reminders, and of follow and reminder invitations, and a document's read-now and consent, take the language of the person's chat with Werk in that project first, while it has one. Without either, the language Werk uses with the person the key or the connection acts for.
Body
An id the caller makes for this request. Sent again with the same request, it returns the first answer and changes nothing twice; sent with a different request, it is refused.
The template's name.
The steps, in order: the first must be an open step and the last one that ends the work.
Show properties of stepsHide properties of steps
The step's id: an existing step's id keeps that step and its cards, a new id adds a step.
The step's name: one of Werk's own words, or a name as written.
Show properties of labelHide properties of label
One of 2 shapes, told apart by kind:
kindlocale_locale_key for one of Werk's own words, written in each reader's language; text for a name as written.
Which of Werk's own words names the step.
kindtextlocale_key for one of Werk's own words, written in each reader's language; text for a name as written.
The step's name, as written.
The kind of step: the first step must be new, in_progress or waiting, and the last resolved or closed.
Response
201 The saved template.
The saved template.
Show properties of templateHide properties of template
The template's id, which a new project takes as templateId.
True for one of Werk's own templates, false for one the key's person saved.
The template's name, in the reader's language for one of Werk's own.
The name as stored: one of Werk's own words, or a name as written.
Show properties of nameSourceHide properties of nameSource
One of 2 shapes, told apart by kind:
kindlocale_locale_key for one of Werk's own words, text for a name as written.
Which of Werk's own words names the template.
kindtextlocale_key for one of Werk's own words, text for a name as written.
The name, as written.
The template's steps, in order.
Show properties of stepsHide properties of steps
The step's id; a card's step names it as stepId.
The step's name, in the reader's language when it is one of Werk's own words.
The language a name the project wrote is written in; absent for one of Werk's own words.
A name the project wrote, in the reader's language, when it is written in another.
Show properties of labelTranslationHide properties of labelTranslation
The reader's language the text is translated into.
ready when text holds the translation, pending while it is being made, failed when it could not be made, paused when no plan pays for translations now.
The translated text, present once ready.
The name as stored: one of Werk's own words, or a name as written. A change of steps sends it back as label.
Show properties of labelSourceHide properties of labelSource
One of 2 shapes, told apart by kind:
kindlocale_locale_key for one of Werk's own words, text for a name as written.
Which of Werk's own words names the step.
kindtextlocale_key for one of Werk's own words, text for a name as written.
The name, as written.
The kind of step: new for an open step, in_progress or waiting for one in between, resolved or closed for one that ends the work.
The step's place among the project's steps, from 0.
Errors
invalid_query The query is not in the form the route takes; the limit is in the unit of the input details.field names (characters for a text, entries for a list, the value for a number).too_few_project_steps The project would have fewer steps than a project needs.too_many_project_steps The project would hold more steps than a project holds.duplicate_project_step Two of the steps sent are the same step.project_first_step_not_open The steps sent put a step that is not of an open kind first.project_last_step_not_finished The steps sent put a step that is not of a finished kind last.invalid_project_step_label A step's name is missing, empty once trimmed, or longer in characters than it holds.invalid_project_request The project request is not in the form the route takes; the limit is in the unit of the input details.field names (characters for a text, entries for a list, the value for a number).session_revoked The request carries no session the server holds, or its session has ended.session_expired The session has expired.session_changed The session changed while the request was in flight.request_conflict The request id was already used with another request, or the change it asks could not be made to the record it names.request_erased The request id belongs to a request whose record was erased.payload_too_large The request body has more bytes than the route takes.rate_limited More requests of this kind were sent than Werk takes within the time it counts them over.server_error The server could not complete the request, and it is not known whether a write it holds was made.curl -X POST "https://api.getwerk.ai/api/v1/step-templates" \
-H "Authorization: Bearer wk_key_..." \
-H "Content-Type: application/json" \
-d '{
"clientRequestId": "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4c07",
"name": "Kitchen visit",
"steps": [
{
"id": "open",
"label": {
"kind": "locale_key",
"key": "project_steps.steps.open"
},
"bucket": "new"
},
{
"id": "measured",
"label": {
"kind": "text",
"text": "Measured"
},
"bucket": "in_progress"
},
{
"id": "done",
"label": {
"kind": "locale_key",
"key": "project_steps.steps.done"
},
"bucket": "resolved"
}
]
}'const res = await fetch("https://api.getwerk.ai/api/v1/step-templates", {
method: "POST",
headers: {
Authorization: "Bearer wk_key_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
"clientRequestId": "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4c07",
"name": "Kitchen visit",
"steps": [
{
"id": "open",
"label": {
"kind": "locale_key",
"key": "project_steps.steps.open"
},
"bucket": "new"
},
{
"id": "measured",
"label": {
"kind": "text",
"text": "Measured"
},
"bucket": "in_progress"
},
{
"id": "done",
"label": {
"kind": "locale_key",
"key": "project_steps.steps.done"
},
"bucket": "resolved"
}
]
}),
});
const answer = await res.json();{
"template": {
"id": "c1f5b9d3-8a2e-4c4a-96f8-1a7b9e3c5f97",
"builtIn": false,
"name": "Kitchen visit",
"nameSource": {
"kind": "text",
"text": "Kitchen visit"
},
"steps": [
{
"id": "open",
"label": "Pending",
"labelSource": {
"kind": "locale_key",
"key": "project_steps.steps.open"
},
"bucket": "new",
"position": 0
},
{
"id": "measured",
"label": "Measured",
"labelSource": {
"kind": "text",
"text": "Measured"
},
"bucket": "in_progress",
"position": 1
},
{
"id": "done",
"label": "Done",
"labelSource": {
"kind": "locale_key",
"key": "project_steps.steps.done"
},
"bucket": "resolved",
"position": 2
}
]
}
}Send a requestPOST
It is sent with the key you give, as you. A change made here is real.
The request could not be sent, or its response could not be read.