Skip to content

Delete a workflow state

DELETE
/organizations/{orgId}/workflow/states/{stateId}
curl --request DELETE \
--url 'https://api.modeldesk.io/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/workflow/states/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0?version=1' \
--header 'Authorization: Bearer <token>'

Deletes a state and moves its items to moveTo, another state of the same category, each move with a timeline row by the admin; a state holding no items needs no moveTo, and its items then go to the first other state of its category. The last triage state, whose category may be empty, moves its items to a state of another open category (without moveTo, the first unstarted state). The duplicate state is never a state to move to and does not count as the state a category keeps; it and the last state of any other category cannot be deleted. The state is removed first, under the version check, so a stale request moves nothing. An item that still names the deleted state reads as being in the state its items moved to, cannot be moved into the deleted state, and is moved by the next change to the workflow’s settings. Organization admins only.

orgId
required
string format: uuid
stateId
required
string format: uuid
version
required
integer format: int64

The workflow version the change is based on.

moveTo
string format: uuid

The state the deleted state’s items move to; required while any item is in the state.

OK

Media typeapplication/json

An organization’s work item workflow: its states, its labels and the prefix item numbers are shown with.

object
ownerId
required
string format: uuid
states
required
Array<object>
object
id
required
string format: uuid
name
required
string
category
required

The fixed category of a workflow state. Open means anything but COMPLETED and CANCELED.

string
Allowed values: TRIAGE BACKLOG UNSTARTED STARTED COMPLETED CANCELED
order
required
integer
reserved

Present on the duplicate state, which a close enters only with the original named. Kept beside its role for readers that predate the role.

boolean
role

The meaning a workflow state has beyond its category; absent on an ordinary state. Such a state can be renamed and reordered within its category, never deleted. DUPLICATE is the canceled state a close enters only with the original named; NOT_A_PROBLEM is the canceled state recording that the team accepts a finding, which only a finding item enters, by a close. It leaves the model’s validity unchanged.

string
Allowed values: DUPLICATE NOT_A_PROBLEM
labels
required
Array<object>

A label of the organization’s workflow. Its name is unique in the organization, ignoring case.

object
id
required
string format: uuid
name
required
string
>= 1 characters <= 100 characters
colour
required

The colour a label is drawn in.

string
Allowed values: slate red blue yellow orange green purple
count

How many items carry the label; present where the workflow is read for its settings only.

integer format: int64
prefix
required

Written before every item number, as in GEO-231; derived from the organization’s name until an admin sets one.

string
/^[A-Z]{2,5}$/
earlierPrefixes
required

The prefixes the organization used before, so an address written with one still finds its item.

Array<string>
nextNumber
required

The number the next item takes.

integer format: int64
>= 1
version
required

Raised by every change to the settings; a settings write names the version it was read at, and one naming an older version is refused with workflow-stale.

integer format: int64

Example

{
"states": [
{
"category": "TRIAGE",
"role": "DUPLICATE"
}
],
"labels": [
{
"colour": "slate"
}
]
}

The state is the reserved duplicate state or the last of its category, or moveTo is missing while items are in the state, is the state itself or is in another category.

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}

The caller is not an organization admin, holds no seat in the organization, or is a service account.

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}

The organization is not there for the caller, or the workflow has no such state.

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}

The workflow changed since the version the request names; the problem carries the current version.

Media typeapplication/problem+json
Workflow stale

The workflow changed since the version the settings write named.

object
type
required

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string
type
required
string format: uri
Allowed values: https://modeldesk.io/problems/workflow-stale
version
required

The workflow’s current version.

integer format: int64

Example

{
"type": "https://modeldesk.io/problems/workflow-stale"
}

Error

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}