Opero Docs
API OperoProcesy

Uruchom instancję workflow

POST
/v1/workflows/runtime/targets/{targetType}/{targetId}/instances

Autoryzacja

api-token
AutoryzacjaBearer <token>

Token Opero API. Przekaż go jako Authorization: Bearer ek_...

In: header

Parametry ścieżki

targetType*tekst
targetId*tekst

ID rekordu docelowego

Parametry zapytania

moduleKey?tekst

Klucz modułu dynamicznego. Wymagany, gdy targetType ma wartość DYNAMIC_OBJECT_RECORD.

objectKey?tekst

Klucz obiektu dynamicznego. Wymagany, gdy targetType ma wartość DYNAMIC_OBJECT_RECORD.

Treść żądania

application/json

Definicje TypeScript

Użyj typu request body w TypeScript.

Treść odpowiedzi

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/workflows/runtime/targets/SALES_INVOICE/string/instances" \  -H "Content-Type: application/json" \  -d '{    "workflowId": "string"  }'
{  "data": {    "id": "string",    "organizationId": "string",    "workflowId": "string",    "workflow": {      "id": "string",      "key": "string",      "name": "string",      "description": "string"    },    "targetType": "SALES_INVOICE",    "targetId": "string",    "currentStageId": "string",    "currentStage": {      "id": "string",      "key": "string",      "name": "string",      "taskName": "string",      "description": "string",      "color": "string",      "icon": "string",      "position": 0,      "isInitial": true,      "isTerminal": true,      "isReadOnly": true,      "parameters": {},      "editAccessConfig": {        "mode": "everyone",        "overrideEditors": {          "membershipIds": [            "string"          ],          "roleIds": [            "string"          ]        }      },      "transitionAccessConfig": {        "mode": "assignee"      },      "actionAccessConfig": {        "hiddenActions": [          "string"        ]      },      "isActive": true    },    "startedByUserId": "string",    "authorUserId": "string",    "currentAssigneeMembershipId": "string",    "currentAssigneeRoleId": "string",    "assignees": [      {        "type": "membership",        "id": "string"      }    ],    "dueAt": "2019-08-24T14:15:22Z",    "metadata": {},    "startedSnapshot": {      "label": "string",      "summary": {}    },    "startedAt": "2019-08-24T14:15:22Z",    "completedAt": "2019-08-24T14:15:22Z",    "cancelledAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "availableTransitions": [      {        "id": "string",        "key": "string",        "name": "string",        "description": "string",        "fromStageId": "string",        "toStageId": "string",        "position": 0,        "color": "string",        "icon": "string",        "requiredComment": true,        "visibilityConfig": {          "logic": "AND",          "conditions": [            {              "logic": "AND",              "conditions": [],              "key": "amount_present",              "value1": "{{ record.snapshot.summary.status }}",              "operator": "EQUALS",              "value2": "APPROVED",              "reason": "Amount must be present before approving.",              "field": "status",              "value": {}            }          ],          "key": "amount_present",          "value1": "{{ record.snapshot.summary.status }}",          "operator": "EQUALS",          "value2": "APPROVED",          "reason": "Amount must be present before approving.",          "field": "status",          "value": {}        },        "conditionConfig": {          "logic": "AND",          "conditions": [            {              "logic": "AND",              "conditions": [],              "key": "amount_present",              "value1": "{{ record.snapshot.summary.status }}",              "operator": "EQUALS",              "value2": "APPROVED",              "reason": "Amount must be present before approving.",              "field": "status",              "value": {}            }          ],          "key": "amount_present",          "value1": "{{ record.snapshot.summary.status }}",          "operator": "EQUALS",          "value2": "APPROVED",          "reason": "Amount must be present before approving.",          "field": "status",          "value": {}        },        "eventConfig": {          "rules": [            {              "ruleId": "string",              "triggerType": "MANUAL",              "data": {}            }          ],          "scripts": [            {              "scriptId": "string",              "type": "BEFORE_WORKFLOW_TRANSITION",              "enabled": true,              "priority": 0,              "config": {}            }          ]        },        "isActive": true,        "toStageKey": "string",        "toStageName": "string",        "toStage": {          "id": "string",          "key": "string",          "name": "string",          "color": "string",          "icon": "string",          "assignmentMode": "single"        },        "assignment": {          "mode": "none",          "assignee": {            "type": "membership",            "id": "string"          },          "assignees": [            {              "type": "membership",              "id": "string"            }          ],          "candidates": {            "membershipMode": "specific",            "membershipIds": [              "string"            ],            "roleIds": [              "string"            ]          }        },        "availability": {          "canExecute": true,          "blockedReason": "string",          "conditionResult": {            "passed": true,            "failedConditionKey": "string",            "reason": "string",            "debug": {}          }        },        "scripts": [          {            "id": "string",            "key": "string",            "type": "string",            "executionMode": "SYNC",            "dependencies": {              "scripts": [                {                  "key": "string",                  "id": "string",                  "status": "RESOLVED"                }              ],              "queries": [                {                  "key": "string",                  "id": "string",                  "status": "RESOLVED"                }              ],              "actions": [                {                  "key": "string",                  "id": "string",                  "status": "RESOLVED"                }              ]            },            "code": "string",            "updatedAt": "2019-08-24T14:15:22Z"          }        ],        "scriptContext": {          "workflow": {},          "transition": {},          "record": {},          "event": {},          "user": {}        }      }    ],    "permissions": {      "canEdit": true,      "editBlockedReason": "EDIT_PERMISSION_REQUIRED",      "canTransition": true,      "transitionBlockedReason": "NOT_ASSIGNEE",      "canDelete": true,      "deleteBlockedReason": "DELETE_PERMISSION_REQUIRED",      "canView": true    },    "currentTask": {      "id": "string",      "status": "OPEN",      "title": "string",      "assignee": {        "type": "membership",        "id": "string"      },      "assignees": [        {          "type": "membership",          "id": "string"        }      ],      "reassignmentCandidates": {        "membershipMode": "specific",        "membershipIds": [          "string"        ],        "roleIds": [          "string"        ]      },      "canReassign": true,      "dueAt": "2019-08-24T14:15:22Z",      "openedAt": "2019-08-24T14:15:22Z"    }  }}
{  "error": {    "code": "NOT_FOUND",    "message": "Resource not found",    "meta": {      "partiallyApplied": true,      "failedPhase": "defaultForms",      "committedObjects": [        {          "id": "5e2af9bc-be0b-4ad8-af57-e8319fb115d3",          "key": "session",          "created": true        }      ],      "fieldsWritten": 1,      "fieldsDeleted": 0    },    "fieldErrors": {      "name": [        "Field \"name\" is required"      ]    },    "unavailableMutationScopes": [      "contractor.bankAccounts"    ],    "clientMutationId": "019f2e3a-7c8b-7a33-9fc8-90db2b5b1e50",    "relationTableErrors": {},    "idempotencyConflict": {},    "errors": [      {        "message": "relation \"foo\" does not exist"      }    ],    "impacts": [      {}    ],    "validation": {}  }}
{  "error": {    "code": "NOT_FOUND",    "message": "Resource not found",    "meta": {      "partiallyApplied": true,      "failedPhase": "defaultForms",      "committedObjects": [        {          "id": "5e2af9bc-be0b-4ad8-af57-e8319fb115d3",          "key": "session",          "created": true        }      ],      "fieldsWritten": 1,      "fieldsDeleted": 0    },    "fieldErrors": {      "name": [        "Field \"name\" is required"      ]    },    "unavailableMutationScopes": [      "contractor.bankAccounts"    ],    "clientMutationId": "019f2e3a-7c8b-7a33-9fc8-90db2b5b1e50",    "relationTableErrors": {},    "idempotencyConflict": {},    "errors": [      {        "message": "relation \"foo\" does not exist"      }    ],    "impacts": [      {}    ],    "validation": {}  }}
{  "error": {    "code": "NOT_FOUND",    "message": "Resource not found",    "meta": {      "partiallyApplied": true,      "failedPhase": "defaultForms",      "committedObjects": [        {          "id": "5e2af9bc-be0b-4ad8-af57-e8319fb115d3",          "key": "session",          "created": true        }      ],      "fieldsWritten": 1,      "fieldsDeleted": 0    },    "fieldErrors": {      "name": [        "Field \"name\" is required"      ]    },    "unavailableMutationScopes": [      "contractor.bankAccounts"    ],    "clientMutationId": "019f2e3a-7c8b-7a33-9fc8-90db2b5b1e50",    "relationTableErrors": {},    "idempotencyConflict": {},    "errors": [      {        "message": "relation \"foo\" does not exist"      }    ],    "impacts": [      {}    ],    "validation": {}  }}
{  "error": {    "code": "NOT_FOUND",    "message": "Resource not found",    "meta": {      "partiallyApplied": true,      "failedPhase": "defaultForms",      "committedObjects": [        {          "id": "5e2af9bc-be0b-4ad8-af57-e8319fb115d3",          "key": "session",          "created": true        }      ],      "fieldsWritten": 1,      "fieldsDeleted": 0    },    "fieldErrors": {      "name": [        "Field \"name\" is required"      ]    },    "unavailableMutationScopes": [      "contractor.bankAccounts"    ],    "clientMutationId": "019f2e3a-7c8b-7a33-9fc8-90db2b5b1e50",    "relationTableErrors": {},    "idempotencyConflict": {},    "errors": [      {        "message": "relation \"foo\" does not exist"      }    ],    "impacts": [      {}    ],    "validation": {}  }}
{  "error": {    "code": "NOT_FOUND",    "message": "Resource not found",    "meta": {      "partiallyApplied": true,      "failedPhase": "defaultForms",      "committedObjects": [        {          "id": "5e2af9bc-be0b-4ad8-af57-e8319fb115d3",          "key": "session",          "created": true        }      ],      "fieldsWritten": 1,      "fieldsDeleted": 0    },    "fieldErrors": {      "name": [        "Field \"name\" is required"      ]    },    "unavailableMutationScopes": [      "contractor.bankAccounts"    ],    "clientMutationId": "019f2e3a-7c8b-7a33-9fc8-90db2b5b1e50",    "relationTableErrors": {},    "idempotencyConflict": {},    "errors": [      {        "message": "relation \"foo\" does not exist"      }    ],    "impacts": [      {}    ],    "validation": {}  }}