Skip to content
campaiDeveloper
campai.com

Misc · Todo · Topics

POST/{organizationId}/misc/todo/topics/{topicId}/workflow

Update todo topic workflow

Updates a todo topic’s workflow statuses and types using the supplied organization ID, topic ID, and revision. The endpoint returns no content on success.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • Callers must have organization access and the todoTopic.edit permission.

Request

Path parameters

  • organizationIdidrequired
  • topicIdidrequired

Body

Content-Type: application/json

  • revisionintegerrequired

    at least 0

  • statusesobject[]required

    2–100 items

    6 properties
    • _ididrequired
    • labelstringrequired

      1–80 characters

    • colorstringrequired
      22 values
      slate gray zinc neutral stone red orange amber yellow lime green emerald teal cyan sky blue indigo violet purple fuchsia pink rose
    • rolestringrequired
      regular review completed
    • orderintegerrequired

      at least 0

    • archivedAtstring · date-timerequirednullable
  • typesobject[]required

    1–50 items

    7 properties
    • _idid
    • namestringrequired

      1–80 characters

    • emojistringrequired

      at most 16 characters

    • orderintegerrequired

      at least 0

    • archivedAtstring · date-timerequirednullable
    • statusesid[]required

      2–30 items

    • statusTransitionsobject[]requirednullable

      at most 30 items

      2 properties
      • fromStatusidrequired
      • toStatusesid[]required

        1–30 items

Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/misc/todo/topics/YOUR_TOPIC_ID/workflow' \
  --header 'X-API-Key: YOUR_API_KEY'

No request that worked has been recorded yet, so the body is not shown.

Response

200 Successful response

No response body is specified.

What else happens

  • On success, updates the topic’s statuses, types, and revision in todoTopics.

Errors

Other errors

StatusErrorWhen
400The purpose of an existing workflow status cannot be changed. Add a replacement instead.Returns 400 BAD_REQUEST with key misc.todo.topics.invalidWorkflowUpdate if an existing status’s role is changed.
404The todo topic was not foundReturns 404 NOT_FOUND with key misc.todo.topics.notFound if the topic is not found in the organization.
409This topic changed while you were editing it. Reload it and apply your changes again.Returns 409 CONFLICT with key misc.todo.topics.changed if the supplied revision does not match the topic’s revision.
409This topic changed while you were editing it. Reload it and apply your changes again.Returns 409 CONFLICT with key misc.todo.topics.changed if the topic no longer matches the expected revision when the update is saved.
409Assign an eligible reviewer to every existing Todo of this type before enabling review. Reopen completed Todos to edit their reviewer.Returns 409 CONFLICT with key misc.todo.topics.reviewersRequired if review is being enabled for a type and an existing Todo of that type lacks an eligible reviewer.
409Types used by Todos must keep an active regular status, one completion status and at most one review status.Returns 409 CONFLICT with key misc.todo.topics.workflowInUse if a type used by Todos has no regular status, not exactly one completion status, or more than one review status.
409Status “status” is still used by Todos. Archive it instead.Returns 409 CONFLICT with key misc.todo.topics.statusInUse if a removed status is still referenced by a Todo.
409Status “status” cannot be removed from type “type” because Todos of that type still use it.Returns 409 CONFLICT with key misc.todo.topics.typeStatusInUse if a status is removed from a type while a Todo of that type still references it.
409Type “type” is still used by Todos. Archive it instead.Returns 409 CONFLICT with key misc.todo.topics.typeInUse if a removed type is still used by a Todo.

Marked words such as status are filled in with the actual value when the error happens.

Errors nearly every request can meet are listed under Errors.