DevelopersHow to connect an assistantKeys
Reference/Projects/Change

Change a project's steps

PUThttps://api.getwerk.ai/api/v1/projects/{projectId}/steps

Replaces the project's steps with a new list.

The project's owner and admins may change them. A card on a removed step moves to a step beside it, and each move is one entry in that card's history. Refused when the project's settings changed since they were read.

Authorization

AuthorizationheaderRequired

Authorization: Bearer <key> Authentication

Headers

Werk-Localestring

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.

Path parameters

projectIdstring, uuidRequired

The project's id.

Body

clientRequestIdstring, uuidRequired

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.

expectedConfigVersionintegerRequired

The project's projectConfigVersion as last read; when its settings changed since, the change is refused.

At least 1
stepsarray of objectsRequired

The project's whole new list of steps, in order. A step left out is removed, and its cards move to the step before it, or after it when it was the first.

From 2 to 100 items
Show properties of stepsHide properties of steps
idstringRequired

The step's id: an existing step's id keeps that step and its cards, a new id adds a step.

Up to 64 characters
labelobjectRequired

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_key
kindenumRequired

locale_key for one of Werk's own words, written in each reader's language; text for a name as written.

Allowed valueslocale_key
keyenumRequired

Which of Werk's own words names the step.

Allowed valuesproject_steps.steps.openproject_steps.steps.in_progressproject_steps.steps.waiting_partsproject_steps.steps.doneproject_steps.steps.paidproject_steps.steps.in_review
kindtext
kindenumRequired

locale_key for one of Werk's own words, written in each reader's language; text for a name as written.

Allowed valuestext
textstringRequired

The step's name, as written.

From 1 to 60 characters
bucketenumRequired

The kind of step: the first step must be new, in_progress or waiting, and the last resolved or closed.

Allowed valuesnewin_progresswaitingresolvedclosed

Response

200 The project's steps after the change.

capabilitiesobject

What the key's person may do with the project now.

Show properties of capabilitiesHide properties of capabilities
inviteboolean

True when the key's person may invite people to the project.

managePeopleboolean

True when they may manage the project's people.

changeRolesboolean

True when they may make a person an admin or a member.

removePeopleboolean

True when they may remove people from the project.

editListsboolean

True when they may change the project's steps.

archiveboolean

True when they may archive the project.

restoreboolean

True when they may bring the project back from the archive.

deleteboolean

True when they may delete the project.

transferOwnershipboolean

True when they may hand the project to another person and leave it.

renameboolean

True when they may rename the project.

changePhotoboolean

True when they may change the project's photo.

leaveboolean

True when they may leave the project.

configVersioninteger

The version of the project's settings (its name, steps and archive), which grows with each change to them; such a change sends it as expectedConfigVersion.

At least 1
stepsarray of objects

The project's steps, in order.

From 2 to 100 items
Show properties of stepsHide properties of steps
idstring

The step's id; a card's step names it as stepId.

Up to 64 characters
labelstring

The step's name, in the reader's language when it is one of Werk's own words.

From 1 to 60 characters
labelLanguagestring

The language a name the project wrote is written in; absent for one of Werk's own words.

From 2 to 64 characters
labelTranslationobject

A name the project wrote, in the reader's language, when it is written in another.

Show properties of labelTranslationHide properties of labelTranslation
languagestring

The reader's language the text is translated into.

From 2 to 64 characters
stateenum

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.

Allowed valuesreadypendingfailedpaused
textstring

The translated text, present once ready.

labelSourceobject

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_key
kindenum

locale_key for one of Werk's own words, text for a name as written.

Allowed valueslocale_key
keyenum

Which of Werk's own words names the step.

Allowed valuesproject_steps.steps.openproject_steps.steps.in_progressproject_steps.steps.waiting_partsproject_steps.steps.doneproject_steps.steps.paidproject_steps.steps.in_review
kindtext
kindenum

locale_key for one of Werk's own words, text for a name as written.

Allowed valuestext
textstring

The name, as written.

From 1 to 60 characters
bucketenum

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.

Allowed valuesnewin_progresswaitingresolvedclosed
positioninteger

The step's place among the project's steps, from 0.

From 0 to 99
cardCountinteger

How many cards are on the step.

At least 0

Errors

400invalid_queryThe 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).
400too_few_project_stepsThe project would have fewer steps than a project needs.
400too_many_project_stepsThe project would hold more steps than a project holds.
400duplicate_project_stepTwo of the steps sent are the same step.
400project_first_step_not_openThe steps sent put a step that is not of an open kind first.
400project_last_step_not_finishedThe steps sent put a step that is not of a finished kind last.
400invalid_project_step_labelA step's name is missing, empty once trimmed, or longer in characters than it holds.
400invalid_project_requestThe 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).
400invalid_project_stepsThe steps sent leave no step of the right kind for the cards of a step they remove.
401session_revokedThe request carries no session the server holds, or its session has ended.
401session_expiredThe session has expired.
403project_not_permittedThe signed-in person's role in the project does not allow this request on the project.
404conversation_not_foundThe project the request names, or its chat, is not one the signed-in person is in.
409session_changedThe session changed while the request was in flight.
409project_deletedThe project is being deleted.
409project_archivedThe project is archived, so it does not take this request.
409request_conflictThe request id was already used with another request, or the change it asks could not be made to the record it names.
409request_erasedThe request id belongs to a request whose record was erased.
409project_config_changedThe project's setup, or the projects the request covers, changed after the version the request names or while it ran.
413payload_too_largeThe request body has more bytes than the route takes.
rate_limitedMore requests of this kind were sent than Werk takes within the time it counts them over.
500server_errorThe server could not complete the request, and it is not known whether a write it holds was made.
curl
curl -X PUT "https://api.getwerk.ai/api/v1/projects/2f6c9e41-7a3b-4d58-9c1e-0b8d4f2a6e73/steps" \
  -H "Authorization: Bearer wk_key_..." \
  -H "Content-Type: application/json" \
  -d '{
    "clientRequestId": "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4b05",
    "expectedConfigVersion": 6,
    "steps": [
      {
        "id": "open",
        "label": {
          "kind": "locale_key",
          "key": "project_steps.steps.open"
        },
        "bucket": "new"
      },
      {
        "id": "in_progress",
        "label": {
          "kind": "locale_key",
          "key": "project_steps.steps.in_progress"
        },
        "bucket": "in_progress"
      },
      {
        "id": "waiting_parts",
        "label": {
          "kind": "locale_key",
          "key": "project_steps.steps.waiting_parts"
        },
        "bucket": "waiting"
      },
      {
        "id": "done",
        "label": {
          "kind": "locale_key",
          "key": "project_steps.steps.done"
        },
        "bucket": "resolved"
      },
      {
        "id": "paid",
        "label": {
          "kind": "locale_key",
          "key": "project_steps.steps.paid"
        },
        "bucket": "closed"
      }
    ]
  }'
TypeScript
const res = await fetch("https://api.getwerk.ai/api/v1/projects/2f6c9e41-7a3b-4d58-9c1e-0b8d4f2a6e73/steps", {
  method: "PUT",
  headers: {
    Authorization: "Bearer wk_key_...",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "clientRequestId": "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4b05",
    "expectedConfigVersion": 6,
    "steps": [
      {
        "id": "open",
        "label": {
          "kind": "locale_key",
          "key": "project_steps.steps.open"
        },
        "bucket": "new"
      },
      {
        "id": "in_progress",
        "label": {
          "kind": "locale_key",
          "key": "project_steps.steps.in_progress"
        },
        "bucket": "in_progress"
      },
      {
        "id": "waiting_parts",
        "label": {
          "kind": "locale_key",
          "key": "project_steps.steps.waiting_parts"
        },
        "bucket": "waiting"
      },
      {
        "id": "done",
        "label": {
          "kind": "locale_key",
          "key": "project_steps.steps.done"
        },
        "bucket": "resolved"
      },
      {
        "id": "paid",
        "label": {
          "kind": "locale_key",
          "key": "project_steps.steps.paid"
        },
        "bucket": "closed"
      }
    ]
  }),
});
const answer = await res.json();
200JSON
{
  "capabilities": {
    "invite": true,
    "managePeople": true,
    "changeRoles": true,
    "removePeople": true,
    "editLists": true,
    "archive": true,
    "restore": false,
    "delete": true,
    "transferOwnership": true,
    "rename": true,
    "changePhoto": true,
    "leave": true
  },
  "configVersion": 7,
  "steps": [
    {
      "id": "open",
      "label": "Pending",
      "labelSource": {
        "kind": "locale_key",
        "key": "project_steps.steps.open"
      },
      "bucket": "new",
      "position": 0,
      "cardCount": 1
    },
    {
      "id": "in_progress",
      "label": "In progress",
      "labelSource": {
        "kind": "locale_key",
        "key": "project_steps.steps.in_progress"
      },
      "bucket": "in_progress",
      "position": 1,
      "cardCount": 1
    },
    {
      "id": "waiting_parts",
      "label": "Waiting for parts",
      "labelSource": {
        "kind": "locale_key",
        "key": "project_steps.steps.waiting_parts"
      },
      "bucket": "waiting",
      "position": 2,
      "cardCount": 1
    },
    {
      "id": "done",
      "label": "Done",
      "labelSource": {
        "kind": "locale_key",
        "key": "project_steps.steps.done"
      },
      "bucket": "resolved",
      "position": 3,
      "cardCount": 3
    },
    {
      "id": "paid",
      "label": "Paid",
      "labelSource": {
        "kind": "locale_key",
        "key": "project_steps.steps.paid"
      },
      "bucket": "closed",
      "position": 4,
      "cardCount": 1
    }
  ]
}