Workflow Assignments
4 Endpunkte. Basis-URL: https://xapi.ambertech.cloud/api/v1
List workflow assignments for a space#
GET
/workflow-assignmentsTokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
spaceIdPflicht | Query | string | – |
Antworten
- 200Assignments returned
Beispiel (cURL)
curl -X GET "https://xapi.ambertech.cloud/api/v1/workflow-assignments" \
-H "Authorization: Bearer $XISUITE_TOKEN"Create a workflow assignment#
POST
/workflow-assignmentsTokenRequest-Body
| Name | Typ | Beschreibung |
|---|---|---|
space_idPflicht | string | Space to assign the workflow to |
task_type_level_idPflicht | string | Hierarchy level ID or '*' for space-wide default |
workflow_idPflicht | string | Workflow to assign |
is_default | boolean | True only when task_type_level_id = '*' |
apply_to_existing | boolean | When true, migrate all existing tasks of this type to the workflow initial status |
Antworten
- 201Assignment created
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/workflow-assignments" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"space_id":"…","task_type_level_id":"*","workflow_id":"…"}'Update a workflow assignment (409 if tasks exist without migration_map)#
PUT
/workflow-assignments/{id}TokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
workflow_id | string | New workflow to assign |
migration_map | object | When workflow_id changes and the current workflow has statuses not in the new workflow, supplying migration_map runs a server-side migration in a single transaction: each orphan task is reassigned to the mapped status. Map shape: { '<orphan_status_id>': '<new_status_id>' }. Missing entries → 400; the server returns suggested_mappings on the 409 to help the UI prefill the picker. |
Antworten
- 200Assignment updated
- 409Tasks exist on this assignment — migration_map required. Response body shape: { message, data: { affected_count, orphan_statuses, suggested_mappings } } where suggested_mappings maps each orphan status id to a best-effort target status id in the new workflow (null when no candidate exists).
Beispiel (cURL)
curl -X PUT "https://xapi.ambertech.cloud/api/v1/workflow-assignments/{id}" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"workflow_id":"…","migration_map":{}}'Delete a workflow assignment (409 if tasks exist without ?acknowledge_orphaned_tasks=true)#
DELETE
/workflow-assignments/{id}TokenParameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | – |
acknowledge_orphaned_tasks | Query | string | Pass true to proceed when orphaned tasks exist |
Antworten
- 200Assignment deleted
- 409Tasks exist on this assignment — pass ?acknowledge_orphaned_tasks=true to force. Response body shape: { message, data: { affected_count, orphan_statuses, suggested_mappings } } where suggested_mappings is always an empty object on delete (no target workflow exists).
Beispiel (cURL)
curl -X DELETE "https://xapi.ambertech.cloud/api/v1/workflow-assignments/{id}" \
-H "Authorization: Bearer $XISUITE_TOKEN"