https://manage.kontent.ai/v2/projects/{environment_id}/workflowshttps://manage.kontent.ai/v2/projects/{environment_id}/workflowshttps://manage.kontent.ai/v2/projects/{environment_id}/workflowhttps://manage.kontent.ai/v2/projects/{environment_id}/workflows/{workflow_identifier}https://manage.kontent.ai/v2/projects/{environment_id}/workflows/{workflow_identifier}environment_idSpecify the new workflow.
namecodenamescopes[]idnamecodenameenvironment_ididnameenvironment_ididnameenvironment_idworkflow_identifierSpecify what you want to update in the workflow.
namecodenamescopes[]idnamecodenameenvironment_idworkflow_identifiersteps[]published_steparchived_stepscopes[]steps[]published_stepscheduled_steparchived_stepcodenamescopes[]content_types[]idsteps[]idnamepublished_stepidnamecodenamescheduled_stepidnamecodenamearchived_stepidnamecodenamecodenametransitions_to[]steps[]published_steparchived_stepscopes[]steps[]published_stepscheduled_steparchived_stepcollections[]idcodenamecolortransitions_to[]stepidrole_ids[]unpublish_role_ids[]create_new_version_role_ids[]role_ids[]00000000-0000-0000-0000-000000000000.00000000-0000-0000-0000-000000000000.8bfdb62d-7aa1-473b-9d80-311ef93db108) or codename (e.g., codename/my-workflow).00000000-0000-0000-0000-000000000000.8bfdb62d-7aa1-473b-9d80-311ef93db108) or codename (e.g., codename/my-workflow).idnamecodenamescopes[]steps[]published_stepscheduled_steparchived_step00000000-0000-0000-0000-000000000000.{
"": {
"id": "8e38928b-50b6-4e9e-ab53-af35d6fcfcb8",
"name": "My workflow",
"codename": "my_workflow",
"scopes": [
{
"content_types": [
{
"id": "1cdb6e21-3330-4f0f-88cd-171098950e4f"
},
{
"id": "2ea20d43-5293-43a4-8bd2-9674a92b20ec"
}
],
"collections": [
{
"id": "b15b6050-80d8-406d-bf21-3012e4ad0ac5"
},
{
"id": "af665269-5b03-409d-b6e4-81a8b34e97fc"
}
]
}
],
"steps": {
"id": "b288d00b-f5cd-4afe-97fc-42b9264404f3",
"name": "Draft",
"codename": "draft",
"color": "red",
"transitions_to": [
{
"step": {
"id": "c199950d-99f0-4983-b711-6c4c91624b22"
}
},
{
"step": {
"id": "7a535a69-ad34-47f8-806a-def1fdf4d391"
}
}
],
"role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
]
},
"published_step": {
"id": "c199950d-99f0-4983-b711-6c4c91624b22",
"name": "Published",
"codename": "published",
"unpublish_role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
],
"create_new_version_role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
]
},
"scheduled_step": {
"id": "9d2b0228-4d0d-4c23-8b49-01a698857709",
"name": "Scheduled",
"codename": "scheduled"
},
"archived_step": {
"id": "7a535a69-ad34-47f8-806a-def1fdf4d391",
"name": "Archived",
"codename": "archived",
"role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
]
}
}
}[
{
"id": "eee6db3b-545a-4785-8e86-e3772c8756f9",
"name": "Draft",
"codename": "draft",
"transitions_to": [
"c199950d-99f0-4983-b711-6c4c91624b22",
"7a535a69-ad34-47f8-806a-def1fdf4d391"
]
},
{
"id": "9d2b0228-4d0d-4c23-8b49-01a698857709",
"name": "Scheduled",
"codename": "scheduled",
"transitions_to": []
},
{
"id": "c199950d-99f0-4983-b711-6c4c91624b22",
"name": "Published",
"codename": "published",
"transitions_to": []
},
{
"id": "7a535a69-ad34-47f8-806a-def1fdf4d391",
"name": "Archived",
"codename": "archived",
"transitions_to": []
}
]{
"id": "8e38928b-50b6-4e9e-ab53-af35d6fcfcb8",
"name": "My workflow",
"codename": "my_workflow",
"scopes": [
{
"content_types": [
{
"id": "1cdb6e21-3330-4f0f-88cd-171098950e4f"
},
{
"id": "2ea20d43-5293-43a4-8bd2-9674a92b20ec"
}
],
"collections": [
{
"id": "b15b6050-80d8-406d-bf21-3012e4ad0ac5"
},
{
"id": "af665269-5b03-409d-b6e4-81a8b34e97fc"
}
]
}
],
"steps": {
"id": "b288d00b-f5cd-4afe-97fc-42b9264404f3",
"name": "Draft",
"codename": "draft",
"color": "red",
"transitions_to": [
{
"step": {
"id": "c199950d-99f0-4983-b711-6c4c91624b22"
}
},
{
"step": {
"id": "7a535a69-ad34-47f8-806a-def1fdf4d391"
}
}
],
"role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
]
},
"published_step": {
"id": "c199950d-99f0-4983-b711-6c4c91624b22",
"name": "Published",
"codename": "published",
"unpublish_role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
],
"create_new_version_role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
]
},
"scheduled_step": {
"id": "9d2b0228-4d0d-4c23-8b49-01a698857709",
"name": "Scheduled",
"codename": "scheduled"
},
"archived_step": {
"id": "7a535a69-ad34-47f8-806a-def1fdf4d391",
"name": "Archived",
"codename": "archived",
"role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
]
}
}{
"id": "705c3bd8-29c6-466c-b42b-6c6c3887786e",
"name": "My workflow",
"codename": "my_workflow",
"scopes": [
{
"content_types": [
{
"id": "1aeb9220-f167-4f8e-a7db-1bfec365fa80"
}
],
"collections": [
{
"id": "b15b6050-80d8-406d-bf21-3012e4ad0ac5"
}
]
}
],
"steps": [
{
"id": "2044477d-36aa-4ad5-91de-eaa2927ab173",
"name": "First step",
"codename": "first_step",
"color": "sky-blue",
"transitions_to": [
{
"step": {
"id": "c236dedd-a216-47fa-b0c0-0ea33877f357"
}
}
],
"role_ids": []
},
{
"id": "c236dedd-a216-47fa-b0c0-0ea33877f357",
"name": "Second step",
"codename": "second_step",
"color": "rose",
"transitions_to": [
{
"step": {
"id": "c199950d-99f0-4983-b711-6c4c91624b22"
}
}
],
"role_ids": [
"e796887c-38a1-4ab2-a999-c40861bb7a4b"
]
}
],
"published_step": {
"id": "c199950d-99f0-4983-b711-6c4c91624b22",
"name": "Published",
"codename": "published",
"unpublish_role_ids": [
"e796887c-38a1-4ab2-a999-c40861bb7a4b"
],
"create_new_version_role_ids": []
},
"archived_step": {
"id": "7a535a69-ad34-47f8-806a-def1fdf4d391",
"name": "Archived",
"codename": "archived",
"role_ids": []
}
}{
"request_id": "703be4d0773e5647",
"error_code": 235,
"message": "The default workflow '00000000-0000-0000-0000-000000000000' cannot be deleted."
}// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client.listWorkflows().toPromise();
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client.listWorkflows().toPromise();
const steps = response.data.find(
(workflow) => workflow.codeName === 'default',
).steps;
{
"id": "8e38928b-50b6-4e9e-ab53-af35d6fcfcb8",
"name": "My workflow",
"codename": "my_workflow",
"scopes": [
{
"content_types": [
{
"id": "1cdb6e21-3330-4f0f-88cd-171098950e4f"
},
{
"id": "2ea20d43-5293-43a4-8bd2-9674a92b20ec"
}
],
"collections": [
{
"id": "b15b6050-80d8-406d-bf21-3012e4ad0ac5"
},
{
"id": "af665269-5b03-409d-b6e4-81a8b34e97fc"
}
]
}
],
"steps": {
"id": "b288d00b-f5cd-4afe-97fc-42b9264404f3",
"name": "Draft",
"codename": "draft",
"color": "red",
"transitions_to": [
{
"step": {
"id": "c199950d-99f0-4983-b711-6c4c91624b22"
}
},
{
"step": {
"id": "7a535a69-ad34-47f8-806a-def1fdf4d391"
}
}
],
"role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
]
},
"published_step": {
"id": "c199950d-99f0-4983-b711-6c4c91624b22",
"name": "Published",
"codename": "published",
"unpublish_role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
],
"create_new_version_role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
]
},
"scheduled_step": {
"id": "9d2b0228-4d0d-4c23-8b49-01a698857709",
"name": "Scheduled",
"codename": "scheduled"
},
"archived_step": {
"id": "7a535a69-ad34-47f8-806a-def1fdf4d391",
"name": "Archived",
"codename": "archived",
"role_ids": [
"e25d74b8-f81a-4faf-94b9-b0bf2b3802c6"
]
}
}// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.deleteWorkflow()
.byWorkflowId('f9f28df0-9dec-4ee3-b087-c501e4b75347')
//.byWorkflowCodename('my-workflow')
.toPromise();
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.addWorkflow()
.withData({
name: 'My workflow',
scopes: [
{
content_types: [
{
id: '1aeb9220-f167-4f8e-a7db-1bfec365fa80',
},
],
collections: [
{
id: 'b15b6050-80d8-406d-bf21-3012e4ad0ac5',
},
],
},
],
steps: [
{
name: 'First step',
codename: 'first_step',
color: 'sky-blue',
transitions_to: [
{
step: {
codename: 'second_step',
},
},
],
role_ids: [],
},
{
name: 'Second step',
codename: 'second_step',
color: 'rose',
transitions_to: [
{
step: {
codename: 'published',
},
},
],
role_ids: ['e796887c-38a1-4ab2-a999-c40861bb7a4b'],
},
],
published_step: {
unpublish_role_ids: ['e796887c-38a1-4ab2-a999-c40861bb7a4b'],
create_new_version_role_ids: [],
},
archived_step: {
role_ids: [],
},
})
.toPromise();
// Tip: Find more about JS/TS SDKs at https://kontent.ai/learn/javascript
import { ManagementClient } from '@kontent-ai/management-sdk';
const client = new ManagementClient({
environmentId: 'KONTENT_AI_ENVIRONMENT_ID',
apiKey: 'KONTENT_AI_MANAGEMENT_API_KEY',
});
const response = await client
.updateWorkflow()
.byWorkflowId('f9f28df0-9dec-4ee3-b087-c501e4b75347')
//.byWorkflowCodename('my-workflow')
.withData({
name: 'My workflow',
scopes: [
{
content_types: [
{
codename: 'article',
},
],
collections: [
{
id: 'b15b6050-80d8-406d-bf21-3012e4ad0ac5',
},
],
},
],
steps: [
{
name: 'First step',
codename: 'first_step',
color: 'sky-blue',
transitions_to: [
{
step: {
id: '16221cc2-bd22-4414-a513-f3e555c0fc93',
},
},
{
step: {
codename: 'archived',
},
},
],
role_ids: ['e796887c-38a1-4ab2-a999-c40861bb7a4b'],
},
{
name: 'Renamed Second step',
codename: 'second_step_renamed',
color: 'rose',
id: '16221cc2-bd22-4414-a513-f3e555c0fc93',
transitions_to: [
{
step: {
codename: 'published',
},
},
],
role_ids: [],
},
],
published_step: {
unpublish_role_ids: [],
create_new_version_role_ids: ['e796887c-38a1-4ab2-a999-c40861bb7a4b'],
},
archived_step: {
role_ids: ['e796887c-38a1-4ab2-a999-c40861bb7a4b'],
},
})
.toPromise();