DevelopersHow to connect an assistantKeys
Reference/Cards/Change

Move and give a card

PUThttps://api.getwerk.ai/api/v1/projects/{projectId}/cards/{cardId}/step-and-holder

Moves a card to another step and changes its holder in one request, which makes one notice.

Both changes are made or neither: a card already on that step, or already held by that person, refuses the whole request.

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.

cardIdstring, uuidRequired

The card'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.

stepIdstringRequired

The step to move the card to, by its id in the project's steps.

Up to 64 characters
placeobject

Where the card goes among the cards of its new step and holder; left out, Werk places it.

Show properties of placeHide properties of place
abovestring, uuid or nullRequired

The card shown right above the new place, or null at the top.

belowstring, uuid or nullRequired

The card shown right below the new place, or null at the bottom.

personIdstring, uuid or nullRequired

The new holder, a person of the project; null frees the card.

Response

200 The card after the change.

itemobject

The card as the key's person reads it after the change.

Show properties of itemHide properties of item
outcomeenum

completed when the card is on its project's last step, not_completed when it was archived before it, open otherwise.

Allowed valuesopencompletednot_completed
idstring, uuid

The card's id.

refstring or null

The card's number as people write it, with # before it.

titlestring

The card's title, as written.

languagestring or null

The language the card's title and description are written in.

titleTranslationobject

The title in the reader's language, when it is written in another.

Show properties of titleTranslationHide properties of titleTranslation
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.

statusobject

The step the card is on, with where that step sits in the work.

Show properties of statusHide properties of status
keystring

The id of the step the card is on.

At least 1 character
labelstring

The step's name.

At least 1 character
categoryenum

open on a new step, done on the project's last step, active on any other step.

Allowed valuesopenactivedone
bucketenum

The kind of step the card is on; a step that ends the work reads in_progress while it is not the project's last step.

Allowed valuesnewin_progresswaitingresolvedclosed
labelLanguagestring

The language the step's name is written in; absent for a step name Werk writes in the reader's language itself.

From 2 to 64 characters
labelTranslationobject

The step's name 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.

dueNoticeLeadenum

How long before the due date its holder and followers get the due notice; none sends no notice.

Allowed valuesnoneat_due15_minutes1_hour2_hours1_day2_days
dueSetByobject or null

Who set the due moment; present only for a due date with a time.

Show properties of dueSetByHide properties of dueSetBy
displayNamestring

That person's name.

dueobject or null

The card's due date, or null when it has none.

Show properties of dueHide properties of due

One of 2 shapes, told apart by kind:

kinddate
kindenum

date for a due day with no time, datetime for a due moment.

Allowed valuesdate
datestring, date

The due day, as YYYY-MM-DD.

kinddatetime
kindenum

date for a due day with no time, datetime for a due moment.

Allowed valuesdatetime
atstring, date-time

The due moment, as an ISO 8601 date and time with its offset.

enteredTimeZonestring or null

The time zone the due moment was given in, when known.

assigneeobject or null

The card's holder, or null when the card is free.

Show properties of assigneeHide properties of assignee
personIdstring, uuid

The holder's person id.

displayNamestring

The holder's name as the project shows it.

initialsstring

The holder's initials, for an avatar with no photo.

photoobject

The holder's photo, when they have one.

Show properties of photoHide properties of photo
personIdstring, uuid

The person whose photo it is.

versioninteger

The photo's version, which changes with the photo; its read takes it to fetch the current one.

At least 1
versioninteger

The card's version, which grows with every change to it.

At least 1
numberinteger or null

The card's number in its project, unique there and never reused.

At least 1
currentStepobject or null

The card's step among its project's steps, as the project defines it.

Show properties of currentStepHide properties of currentStep
idstring

The step's id; a change of step sends it as stepId.

At least 1 character
labelstring

The step's name.

At least 1 character
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
labelLanguagestring

The language the step's name is written in; absent for a step name Werk writes in the reader's language itself.

From 2 to 64 characters
labelTranslationobject

The step's name 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.

archivedboolean

True when the card is archived: it has left the working lists and stays readable and searchable.

countsobject

How much the card holds.

Show properties of countsHide properties of counts
photosinteger

Photos on the card.

At least 0
updatesinteger

Updates on the card.

At least 0
documentsinteger

Documents on the card.

At least 0
checklistobject

The card's list: its items checked and in all; absent when the card has no list.

Show properties of checklistHide properties of checklist
doneinteger

List items checked.

At least 0
totalinteger

List items in all.

At least 0
allowedActionsarray of enums

The changes the key's person may make to this card by hand now, by action name.

Allowed valuestake_cardassign_cardgive_back_cardmove_cardarchive_cardunarchive_cardedit_cardset_card_dueadd_updatecreate_reminderlink_duplicateadd_entriesrename_entryremove_entryreorder_entriesfollow_cardunfollow_cardfollow_invitationtick_entryuntick_entryset_due_notice

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).
400invalid_card_queryThe request about cards or their files is not in the form its route takes, or names a day of a filter while the signed-in person's profile has no time zone; 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).
401session_revokedThe request carries no session the server holds, or its session has ended.
401session_expiredThe session has expired.
403actor_not_allowedThe signed-in person may not make this change to the card.
403not_permittedThe signed-in person's role, or whose the record is, does not allow this request.
403not_a_memberThe signed-in person is not in the project.
404conversation_not_foundThe project the request names, or its chat, is not one the signed-in person is in.
404item_not_foundThe card the request names, or its list, is not one the signed-in person can see.
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.
409card_archivedThe card is archived, so it does not take this change.
409project_profile_changedThe project's setup changed while the cards were read.
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/cards/6e2a8d43-1c7b-4f95-a3d6-0b4e9c1f7a25/step-and-holder" \
  -H "Authorization: Bearer wk_key_..." \
  -H "Content-Type: application/json" \
  -d '{
    "clientRequestId": "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4f05",
    "stepId": "in_progress",
    "personId": "c4b7e9a1-2d6f-4c83-b5a0-7e1f3d9c2b64"
  }'
TypeScript
const res = await fetch("https://api.getwerk.ai/api/v1/projects/2f6c9e41-7a3b-4d58-9c1e-0b8d4f2a6e73/cards/6e2a8d43-1c7b-4f95-a3d6-0b4e9c1f7a25/step-and-holder", {
  method: "PUT",
  headers: {
    Authorization: "Bearer wk_key_...",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "clientRequestId": "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4f05",
    "stepId": "in_progress",
    "personId": "c4b7e9a1-2d6f-4c83-b5a0-7e1f3d9c2b64"
  }),
});
const answer = await res.json();
200JSON
{
  "item": {
    "outcome": "open",
    "id": "6e2a8d43-1c7b-4f95-a3d6-0b4e9c1f7a25",
    "ref": "#15",
    "title": "Paint the hallway",
    "language": "en-US",
    "status": {
      "key": "in_progress",
      "label": "In progress",
      "category": "active",
      "bucket": "in_progress"
    },
    "dueNoticeLead": "at_due",
    "due": null,
    "assignee": {
      "personId": "c4b7e9a1-2d6f-4c83-b5a0-7e1f3d9c2b64",
      "displayName": "Lucia Ferraro",
      "initials": "LF"
    },
    "version": 2,
    "number": 15,
    "currentStep": {
      "id": "in_progress",
      "label": "In progress",
      "bucket": "in_progress"
    },
    "archived": false,
    "counts": {
      "photos": 0,
      "updates": 0,
      "documents": 0
    }
  }
}