openapi: 3.0.3 info: title: KuFlow Public API version: "2022-10-08" termsOfService: "https://kuflow.com/legal" contact: email: kuflow@kuflow.com description: | # Introduction This document contains the KuFlow REST API reference. This API is a fundamental part in the integration of external systems with KuFlow and is used, among others, by the different implementations of the Workers that connect to our network. # API Versioning A versioning strategy allows our clients to continue using the existing REST API and migrate their applications to the newer API when they are ready. The scheme followed is a simplification of *Semver* where only MAJOR versions are differentiated from MINOR or PATCH versions, i.e. a version number of only two levels is used. With this approach, you only have to migrate your applications if you want to upgrade to a MAJOR version of the KuFlow API. In case you want to upgrade to a MINOR version, you can do so without any incompatibility issues. The versioning of the api is done through the URI Path, that is, the version number is included in the URI Path. The URL structure would be as follows: ```bash https://{endpoint}/v{VERSION}/{api-path} ``` # Idempotency The API is designed to support idempotency in order to achieve a correct resilience in the implementation of its clients. The way to achieve this is very simple, in the methods that create resources, you simply have to specify a UUID in the input data and the API will respond by creating or returning the resource if it previously existed. With this mechanism, your systems can implement retry logic without worrying about performing data tradeoffs. # OpenAPI Specification This API is documented in OpenAPI format. This file allows you to create REST clients with the technology of your choice automatically. externalDocs: description: Find out more about KuFlow url: "https://kuflow.com" servers: - url: "https://api.kuflow.com/v2022-10-08" description: Live environment security: - BasicAuth: [] - BearerAuth: [] - OAuth2Auth: [] tags: - name: principal description: Operations about principals. externalDocs: description: Find out more about our principal model. url: "https://docs.kuflow.com/fine-grained-concepts/users-groups-roles" x-displayName: Principal - name: tenantUser description: Operations about tenant users. externalDocs: description: Find out more about our principal model. url: "https://docs.kuflow.com" x-displayName: Tenant User - name: process description: Operations about processes. externalDocs: description: Find out more about our process model. url: "https://docs.kuflow.com" x-displayName: Process - name: task description: Operations about tasks. externalDocs: description: Find out more about our task model. url: "https://docs.kuflow.com" x-displayName: Task - name: worker description: Operations about workers. externalDocs: description: Find out more about our workers. url: "https://docs.kuflow.com" x-displayName: Worker - name: robot description: Operations about robots. externalDocs: description: Find out more about our robots. url: "https://docs.kuflow.com" x-displayName: Robot - name: webhook description: Operations that Kuflow invokes towards external systems. externalDocs: description: Find out more about our webhooks. url: "https://docs.kuflow.com" x-displayName: Webhook - name: authentication description: Operations for handling authentication tokens. externalDocs: description: Find out more about our authentication process. url: "https://docs.kuflow.com/developers/authentication" x-displayName: Authentication x-tagGroups: - name: General tags: - principal - tenantUser - process - task - worker - robot - name: Authentication management tags: - authentication - name: Notification tags: - webhook paths: /authentications: post: summary: Create an authentication for the current principal. operationId: createAuthentication tags: - apiRestExternalV20221008Authentications - authentication requestBody: description: Authentication to be created. required: true content: application/json: schema: $ref: "#/components/schemas/Authentication" x-ms-requestBody-name: authentication responses: "200": description: Authentication Created. content: application/json: schema: $ref: "#/components/schemas/Authentication" default: $ref: "#/components/responses/DefaultError" /principals: get: summary: Find all accessible Principals description: | List all the Principals that have been created and the used credentials has access. Available sort query values: id, name operationId: findPrincipals tags: - apiRestExternalV20221008Principals - principal parameters: - $ref: "#/components/parameters/SizeQueryParam" - $ref: "#/components/parameters/PageQueryParam" - $ref: "#/components/parameters/SortQueryParam" - name: type description: Filter principals by type. in: query schema: $ref: "#/components/schemas/PrincipalType" - $ref: "#/components/parameters/GroupIdQueryParam" - $ref: "#/components/parameters/TenantIdQueryParam" responses: "200": description: Principals found paginated. content: application/json: schema: $ref: "#/components/schemas/PrincipalPage" default: $ref: "#/components/responses/DefaultError" /principals/{id}: get: summary: Get a Principal by ID description: Returns the requested Principal when has access to do it. operationId: retrievePrincipal tags: - apiRestExternalV20221008Principals - principal parameters: - $ref: "#/components/parameters/IdPathParam" responses: "200": description: Successful operation content: application/json: schema: $ref: "#/components/schemas/Principal" default: $ref: "#/components/responses/DefaultError" /tenant-users: get: summary: Find all accessible Tenant Users description: | List all the Tenant Users that have been created and the used credentials has access. Available sort query values: id, createdAt, lastModifiedAt operationId: findTenantUsers tags: - apiRestExternalV20221008TenantUser - tenantUser parameters: - $ref: "#/components/parameters/SizeQueryParam" - $ref: "#/components/parameters/PageQueryParam" - $ref: "#/components/parameters/SortQueryParam" - $ref: "#/components/parameters/GroupIdQueryParam" - $ref: "#/components/parameters/EmailQueryParam" - $ref: "#/components/parameters/TenantIdQueryParam" responses: "200": description: Tenant users found paginated. content: application/json: schema: $ref: "#/components/schemas/TenantUserPage" default: $ref: "#/components/responses/DefaultError" /tenant-users/{id}: get: summary: Get a Tenant User by ID description: Returns the requested TenantUser when has access to do it. operationId: retrieveTenantUser tags: - apiRestExternalV20221008TenantUser - tenantUser parameters: - $ref: "#/components/parameters/IdPathParam" responses: "200": description: Successful operation content: application/json: schema: $ref: "#/components/schemas/TenantUser" default: $ref: "#/components/responses/DefaultError" /processes: get: summary: Find all accessible Processes description: | List all the Processes that have been created and the credentials has access. Available sort query values: id, createdAt, lastModifiedAt operationId: findProcesses tags: - apiRestExternalV20221008Processes - process parameters: - $ref: "#/components/parameters/SizeQueryParam" - $ref: "#/components/parameters/PageQueryParam" - $ref: "#/components/parameters/SortQueryParam" - $ref: "#/components/parameters/TenantIdQueryParam" responses: "200": description: Processes found paginated content: application/json: schema: $ref: "#/components/schemas/ProcessPage" default: $ref: "#/components/responses/DefaultError" post: summary: Create a new process description: | Creates a process. This option has direct correspondence to the action of starting a process in the Kuflow GUI. When a process is created, the current user is assigned as the process initiator, if you want to change it, you can pass a valid initiator using the following options: * If you know the `principal ID` you can assign it to `initiator.id` * If you know the `user ID` you can assign it to `initiator.user.id` * If you know the `user email` you can assign it to `initiator.user.email` * If you know the `application ID` you can assign it to `initiator.application.id` If you want the method to be idempotent, please specify the `id` field in the request body. operationId: createProcess tags: - apiRestExternalV20221008Processes - process requestBody: description: Process to create required: true content: application/json: schema: $ref: "#/components/schemas/Process" x-ms-requestBody-name: process responses: "200": description: Process already created content: application/json: schema: $ref: "#/components/schemas/Process" "201": description: Process created content: application/json: schema: $ref: "#/components/schemas/Process" default: $ref: "#/components/responses/DefaultError" /processes/{id}: get: summary: Get a Process by ID description: Returns the requested Process when has access to do it. operationId: retrieveProcess tags: - apiRestExternalV20221008Processes - process parameters: - $ref: "#/components/parameters/IdPathParam" responses: "200": description: Successful operation content: application/json: schema: $ref: "#/components/schemas/Process" default: $ref: "#/components/responses/DefaultError" /processes/{id}/~actions/change-initiator: post: summary: Change process initiator description: | Change the current initiator of a process. Allows you to choose a user (by email or principal identifier) or an application (principal identifier). Only one option will be necessary. operationId: actionsProcessChangeInitiator tags: - apiRestExternalV20221008Processes - process parameters: - $ref: "#/components/parameters/IdPathParam" requestBody: description: Command to change the process initiator. required: true content: application/json: schema: $ref: "#/components/schemas/ProcessChangeInitiatorCommand" x-ms-requestBody-name: command responses: "200": description: Process with the new initiator. content: application/json: schema: $ref: "#/components/schemas/Process" default: $ref: "#/components/responses/DefaultError" /processes/{id}/~actions/save-element: post: summary: "Save a process element, aka: metadata" description: | Allow to save an element. If values already exist for the provided element code, it replaces them with the new ones, otherwise it creates them. The values of the previous elements that no longer exist will be deleted. If the process is already finished the invocations fails with an error. operationId: actionsProcessSaveElement tags: - apiRestExternalV20221008Processes - process parameters: - $ref: "#/components/parameters/IdPathParam" requestBody: description: Command to save an element. required: true content: application/json: schema: $ref: "#/components/schemas/ProcessSaveElementCommand" x-ms-requestBody-name: command responses: "200": description: Process updated. content: application/json: schema: $ref: "#/components/schemas/Process" default: $ref: "#/components/responses/DefaultError" /processes/{id}/~actions/delete-element: post: summary: Delete an element by code description: | Allow to delete a process element by specifying the item definition code. Remove all the element values. operationId: actionsProcessDeleteElement tags: - apiRestExternalV20221008Processes - process parameters: - $ref: "#/components/parameters/IdPathParam" requestBody: description: Command to delete an element. required: true content: application/json: schema: $ref: "#/components/schemas/ProcessDeleteElementCommand" x-ms-requestBody-name: command responses: "200": description: Task elements deleted. content: application/json: schema: $ref: "#/components/schemas/Process" default: $ref: "#/components/responses/DefaultError" /processes/{id}/~actions/complete: post: summary: Complete a Process description: | Complete a Process. The state of Process is set to 'completed'. If you are already in this state, no action is taken. operationId: actionsProcessComplete tags: - apiRestExternalV20221008Processes - process parameters: - $ref: "#/components/parameters/IdPathParam" responses: "200": description: Process completed. content: application/json: schema: $ref: "#/components/schemas/Process" default: $ref: "#/components/responses/DefaultError" /processes/{id}/~actions/cancel: post: summary: Cancel a Process description: | Cancel a Process. The Process state is set to 'cancelled'. All the active tasks will be marked as cancelled too. If you are already in this state, no action is taken. operationId: actionsProcessCancel tags: - apiRestExternalV20221008Processes - process parameters: - $ref: "#/components/parameters/IdPathParam" responses: "200": description: Process cancelled. content: application/json: schema: $ref: "#/components/schemas/Process" default: $ref: "#/components/responses/DefaultError" /processes/{id}/~actions/save-user-action-value-document: post: summary: Upload and save a document in a user action description: | Allow saving a user action document uploading the content. operationId: actionsProcessSaveUserActionValueDocument tags: - apiRestExternalV20221008Processes - process parameters: - $ref: "#/components/parameters/IdPathParam" - name: fileContentType description: Document content type in: query required: true schema: type: string - name: fileName description: Document name in: query required: true schema: type: string - name: userActionValueId description: User action value ID related to de document in: query required: true schema: type: string format: uuid requestBody: description: Document to save. required: true content: application/octet-stream: schema: type: string format: binary x-ms-requestBody-name: file responses: "200": description: Document Saved in user action. content: application/json: schema: $ref: "#/components/schemas/Process" "304": description: Untouched process default: $ref: "#/components/responses/DefaultError" /processes/{id}/~actions/save-entity-data: post: summary: Save JSON data description: | Allow to save a JSON validating that the data follow the related schema. If the data is invalid, then the json form is marked as invalid. operationId: actionsProcessSaveEntityData tags: - apiRestExternalV20221008Processes - process parameters: - $ref: "#/components/parameters/IdPathParam" requestBody: description: Command to save the JSON value. required: true content: application/json: schema: $ref: "#/components/schemas/ProcessSaveEntityDataCommand" x-ms-requestBody-name: command responses: "200": description: Process with the entity json data saved content: application/json: schema: $ref: "#/components/schemas/Process" default: $ref: "#/components/responses/DefaultError" /processes/{id}/~actions/save-entity-document: post: summary: Save an entity value document description: | Save a document in the process to later be linked into the JSON data. operationId: actionsProcessSaveEntityDocument tags: - apiRestExternalV20221008Processes - process parameters: - $ref: "#/components/parameters/IdPathParam" - name: fileContentType description: Document content type in: query required: true schema: type: string - name: fileName description: Document name in: query required: true schema: type: string - name: schemaPath description: | JSON Schema path related to the document. The uploaded document will be validated by the passed schema path. in: query required: true schema: type: string requestBody: description: Document to save. required: true content: application/octet-stream: schema: type: string format: binary x-ms-requestBody-name: file responses: "200": description: Save document response content: application/json: schema: $ref: "#/components/schemas/ProcessSaveEntityDocumentResponseCommand" default: $ref: "#/components/responses/DefaultError" /processes/{id}/~actions/download-entity-document: get: summary: Download document description: Given a process and a documentUri, download a document. operationId: actionsProcessDownloadEntityDocument tags: - apiRestExternalV20221008Processes - process parameters: - $ref: "#/components/parameters/IdPathParam" - name: documentUri description: Document URI to download. in: query required: true schema: type: string responses: "200": description: Document requested content: "application/octet-stream": schema: type: string format: binary default: $ref: "#/components/responses/DefaultError" /tasks: get: summary: Find all accessible Tasks description: | List all Tasks that have been created and the credentials has access. Available sort query values: id, createdAt, lastModifiedAt, claimedAt, completedAt, cancelledAt operationId: findTasks tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/SizeQueryParam" - $ref: "#/components/parameters/PageQueryParam" - $ref: "#/components/parameters/SortQueryParam" - name: processId description: Filter by an array of process ids. in: query schema: type: array items: type: string format: uuid style: form explode: true - name: state description: Filter by an array of task states. in: query schema: type: array items: $ref: "#/components/schemas/TaskState" style: form explode: true - name: taskDefinitionCode description: Filter by an array of task definition codes. in: query schema: type: array items: type: string style: form explode: true - $ref: "#/components/parameters/TenantIdQueryParam" responses: "200": description: Tasks found paginated. content: application/json: schema: $ref: "#/components/schemas/TaskPage" default: $ref: "#/components/responses/DefaultError" post: summary: Create a new Task in the selected Process description: | Create a Task and optionally fill its elements. We can fill in any type of element except documents. If you want to add document type elements, you can pass a reference to an existing document type element indicating its 'uri'. This will copy that document into the element. In case you want to add a new document, please use the corresponding API method. If you want that the task created is claimed you can a valid owner using the following options: * If you know the `principal ID` you can assign it to `owner.id` * If you know the `user ID` you can assign it to `owner.user.id` * If you know the `user email` you can assign it to `owner.user.email` * If you know the `application ID` you can assign it to `owner.application.id` If you want the method to be idempotent, please specify the `id` field in the request body. operationId: createTask tags: - apiRestExternalV20221008Tasks - task parameters: - name: activityToken description: | [DEPRECATED] When create a KuFlow Task backed with a Temporal.io servers, this value is required and must be set with the context task token of Temporal.io activity. It is no longer necessary because it will be never used for the latest SDKs versions in: query schema: type: string deprecated: true requestBody: description: Task to be created required: true content: application/json: schema: $ref: "#/components/schemas/Task" examples: example-one: summary: task with elements value: { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "taskDefinition": { "code": "string" }, "processId": "9e0ad09b-5150-48c0-aded-707587048fd9", "elementValues": { "element_code_1": [ { type: "STRING", "value": "string" } ], "element_code_2": [ { type: "NUMBER", "valid": false, "value": 1111 } ], "element_code_3": [ { type: "STRING", "value": "string" }, { type: "STRING", "value": "string" } ], "element_code_4": [ { type: "OBJECT", "value": { "form_field_1": "string", "form_field_2": "string" } } ], "element_code_5": [ { type: "DOCUMENT", "value": { "uri": "string" } } ], "element_code_6": [ { type: "DOCUMENT", "value": { "uri": "string" } } ], "element_code_7": [ { type: "PRINCIPAL", "value": { "id": "b90c9ae9-444c-4bfd-9594-7468955d2eda", "type": "USER" } } ], "element_code_8": [ { type: "PRINCIPAL", "value": { "id": "b90c9ae9-444c-4bfd-9594-7468955d2eda", "type": "USER" } }, { type: "PRINCIPAL", "value": { "id": "f4be313c-c0a2-426c-bdd3-c3113d7bbf37", "type": "USER" } }, ], }, tenantId: '859f5585-493f-44f8-b9b4-beb633bd9ac7' } x-ms-requestBody-name: task responses: "200": description: Task already created. content: application/json: schema: $ref: "#/components/schemas/Task" "201": description: Task created. content: application/json: schema: $ref: "#/components/schemas/Task" default: $ref: "#/components/responses/DefaultError" /tasks/{id}: get: summary: Get a task given it ID description: Allow to get a task by ID. operationId: retrieveTask tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" responses: "200": description: Task requested. content: application/json: schema: $ref: "#/components/schemas/Task" default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/claim: post: summary: Claim a task description: Allow to claim a task. operationId: actionsTaskClaim tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" responses: "200": description: Task claimed. content: application/json: schema: $ref: "#/components/schemas/Task" default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/assign: post: summary: Assign a task description: Allow to assign a task to a user or application. Only one option will be necessary. operationId: actionsTaskAssign tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" requestBody: description: Command to change the task owner. required: true content: application/json: schema: $ref: "#/components/schemas/TaskAssignCommand" x-ms-requestBody-name: command responses: "200": description: Task assigned. content: application/json: schema: $ref: "#/components/schemas/Task" default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/save-element: post: summary: Save an element description: | Allow to save an element i.e., a field, a decision, a form, a principal or document. In the case of document type elements, this method only allows references to be made to other existing document type elements for the purpose of copying that file into the element. To do this you need to pass a reference to the document using the 'uri' attribute. In case you want to add a new document, please use the corresponding API method. If values already exist for the provided element code, it replaces them with the new ones, otherwise it creates them. The values of the previous elements that no longer exist will be deleted. To remove an element, use the appropriate API method. operationId: actionsTaskSaveElement tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" requestBody: description: Command to save an element. required: true content: application/json: schema: $ref: "#/components/schemas/TaskSaveElementCommand" x-ms-requestBody-name: command responses: "200": description: Task with element filled content: application/json: schema: $ref: "#/components/schemas/Task" default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/save-element-value-document: post: summary: Save an element document description: | Allow to save an element document uploading the content. If it is a multiple element, and the ID referenced in the body does not exist or is empty, the document will be added to the element. If the element already exists (the ID referenced in the body corresponds to an existing one), it updates it. operationId: actionsTaskSaveElementValueDocument tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" - name: fileContentType description: Document content type in: query required: true schema: type: string - name: fileName description: Document name in: query required: true schema: type: string - name: elementDefinitionCode description: Element Definition Code in: query required: true schema: type: string - name: elementValueId description: Element Value ID in: query required: false schema: type: string format: uuid - name: elementValueValid description: Element Value ID in: query required: false schema: type: boolean default: true requestBody: description: Command to save a document element value. required: true content: application/octet-stream: schema: type: string format: binary x-ms-requestBody-name: file responses: "200": description: Task with element filled content: application/json: schema: $ref: "#/components/schemas/Task" default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/delete-element: post: summary: Delete an element by code description: | Allow to delete task element by specifying the item definition code. Remove all the element values. operationId: actionsTaskDeleteElement tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" requestBody: description: Command to delete an element. required: true content: application/json: schema: $ref: "#/components/schemas/TaskDeleteElementCommand" x-ms-requestBody-name: command responses: "200": description: Task elements deleted content: application/json: schema: $ref: "#/components/schemas/Task" default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/delete-element-value-document: post: summary: Delete an element document value description: | Allow to delete a specific document from an element of document type using its id. Note: If it is a multiple item, it will only delete the specified document. If it is a single element, in addition to the document, it will also delete the element. operationId: actionsTaskDeleteElementValueDocument tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" requestBody: description: Command to delete a document element value. required: true content: application/json: schema: $ref: "#/components/schemas/TaskDeleteElementValueDocumentCommand" x-ms-requestBody-name: command responses: "200": description: Task with elements deleted content: application/json: schema: $ref: "#/components/schemas/Task" default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/download-element-value-document: get: summary: Download document description: Given a task, download a document from an element of document type. operationId: actionsTaskDownloadElementValueDocument tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" - name: documentId description: Document ID to download. in: query required: true schema: type: string format: uuid responses: "200": description: Document requested content: "application/octet-stream": schema: type: string format: binary default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/download-element-value-form-rendered: get: summary: Download a Form rendered as PDF or Zip of PDFs (when the element is multiple) description: | Given a task, generate a PDF from a Form type element with the data filled in, if any. If there are multiple form values, they are packed into a ZIP. Important!: To use this feature, please contact to kuflow@kuflow.com operationId: actionsTaskDownloadElementValueRendered tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" - name: elementDefinitionCode description: Element definition code of a Form Element to download. in: query required: true schema: type: string responses: "200": description: Form requested as PDF or ZIP of PDFs. content: "application/pdf": schema: type: string format: binary "application/zip": schema: type: string format: binary default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/save-json-forms-value-data: post: summary: Save JSON data description: | Allow to save a JSON data validating that the data follow the related schema. If the data is invalid, then the json form is marked as invalid. operationId: actionsTaskSaveJsonFormsValueData tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" requestBody: description: Command to save the JSON value. required: true content: application/json: schema: $ref: "#/components/schemas/TaskSaveJsonFormsValueDataCommand" x-ms-requestBody-name: command responses: "200": description: Task with json data saved content: application/json: schema: $ref: "#/components/schemas/Task" default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/save-json-forms-value-document: post: summary: Save a JSON Forms document description: | Save a document in the task to later be linked into the JSON data. operationId: actionsTaskSaveJsonFormsValueDocument tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" - name: fileContentType description: Document content type in: query required: true schema: type: string - name: fileName description: Document name in: query required: true schema: type: string - name: schemaPath description: | JSON Schema path related to the document. The uploaded document will be validated by the passed schema path. in: query required: true schema: type: string requestBody: description: Document to save. required: true content: application/octet-stream: schema: type: string format: binary x-ms-requestBody-name: file responses: "200": description: Save document response content: application/json: schema: $ref: "#/components/schemas/TaskSaveJsonFormsValueDocumentResponseCommand" default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/download-json-forms-value-document: get: summary: Download document description: Given a task, download a document from a json form data. operationId: actionsTaskDownloadJsonFormsValueDocument tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" - name: documentUri description: Document URI to download. in: query required: true schema: type: string responses: "200": description: Document requested content: "application/octet-stream": schema: type: string format: binary default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/complete: post: summary: Complete a task description: Allow to complete a claimed task by the principal. operationId: actionsTaskComplete tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" responses: "200": description: Task completed content: application/json: schema: $ref: "#/components/schemas/Task" default: $ref: "#/components/responses/DefaultError" /tasks/{id}/~actions/append-log: post: summary: Append a log to the task description: | A log entry is added to the task. If the number of log entries is reached, the oldest log entry is removed. operationId: actionsTaskAppendLog tags: - apiRestExternalV20221008Tasks - task parameters: - $ref: "#/components/parameters/IdPathParam" requestBody: description: Log to be created. required: true content: application/json: schema: $ref: "#/components/schemas/Log" x-ms-requestBody-name: log responses: "200": description: Task with log entry added content: application/json: schema: $ref: "#/components/schemas/Task" default: $ref: "#/components/responses/DefaultError" /workers: post: summary: Create or update a worker description: | Register a worker in KuFlow, this allows the platform to have a catalogue of all registered workers. If already exist a worker for the same identity, the worker will be updated. operationId: createWorker tags: - apiRestExternalV20221008Workers - worker requestBody: description: Worker to create or update required: true content: application/json: schema: $ref: "#/components/schemas/Worker" x-ms-requestBody-name: worker responses: "200": description: Worker updated. content: application/json: schema: $ref: "#/components/schemas/Worker" "201": description: Worker created. content: application/json: schema: $ref: "#/components/schemas/Worker" default: $ref: "#/components/responses/DefaultError" /robots: get: summary: Find all accessible Robots description: | List all the Robots that have been created and the credentials has access. Available sort query values: createdAt, lastModifiedAt operationId: findRobots tags: - apiRestExternalV20221008Robots - robot parameters: - $ref: "#/components/parameters/SizeQueryParam" - $ref: "#/components/parameters/PageQueryParam" - $ref: "#/components/parameters/SortQueryParam" - $ref: "#/components/parameters/TenantIdQueryParam" - $ref: "#/components/parameters/RobotContextQueryParam" responses: "200": description: Robots found paginated content: application/json: schema: $ref: "#/components/schemas/RobotPage" default: $ref: "#/components/responses/DefaultError" /robots/{id}: get: summary: Get a Robot by ID description: Returns the requested Robot when has access to do it. operationId: retrieveRobot tags: - apiRestExternalV20221008Robots - robot parameters: - $ref: "#/components/parameters/IdPathParam" responses: "200": description: Successful operation content: application/json: schema: $ref: "#/components/schemas/Robot" default: $ref: "#/components/responses/DefaultError" /robots/{id}/~actions/download-source-code: get: summary: Download robot code description: Given a robot, download the source code. operationId: actionsRobotDownloadSourceCode tags: - apiRestExternalV20221008Robots - robot parameters: - $ref: "#/components/parameters/IdPathParam" responses: "200": description: Source code requested content: "application/octet-stream": schema: type: string format: binary default: $ref: "#/components/responses/DefaultError" /robots/{id}/~actions/download-asset: get: summary: Download robot asset description: Given a robot, download the requested asset. operationId: actionsRobotDownloadAsset tags: - apiRestExternalV20221008Robots - robot parameters: - $ref: "#/components/parameters/IdPathParam" - name: type description: The asset type. in: query required: true schema: $ref: "#/components/schemas/RobotAssetType" x-ms-parameter-location: method - name: version description: The asset version. in: query required: true schema: type: string x-ms-parameter-location: method - name: platform description: The asset platform. in: query required: true schema: $ref: "#/components/schemas/RobotAssetPlatform" x-ms-parameter-location: method - name: architecture description: The asset platform architecture. in: query required: true schema: $ref: "#/components/schemas/RobotAssetArchitecture" x-ms-parameter-location: method responses: "200": description: Source code requested content: "application/octet-stream": schema: type: string format: binary default: $ref: "#/components/responses/DefaultError" x-webhooks: events: post: summary: Event sent description: Information about a event produced in the platform operationId: webhook_handleWebhookEvent tags: - webhook requestBody: content: application/json: schema: $ref: "#/components/schemas/WebhookEvent" responses: "200": description: Return a 200 status to indicate that the data was received successfully components: parameters: IdPathParam: name: id description: The resource ID. in: path required: true schema: type: string format: uuid x-ms-parameter-location: method SizeQueryParam: name: size description: The number of records returned within a single API call. in: query required: false schema: type: integer default: 25 minimum: 0 maximum: 1000 x-ms-parameter-location: method PageQueryParam: name: page description: The page number of the current page in the returned records, 0 is the first page. in: query required: false schema: type: integer default: 0 minimum: 0 x-ms-parameter-location: method SortQueryParam: name: sort description: | Sorting criteria in the format: property{,asc|desc}. Example: createdAt,desc Default sort order is ascending. Multiple sort criteria are supported. Please refer to the method description for supported properties. in: query required: false schema: type: array items: type: string style: form explode: true x-ms-parameter-location: method GroupIdQueryParam: name: groupId description: Filter by group ids. in: query required: false schema: type: array items: type: string format: uuid style: form explode: true x-ms-parameter-location: method EmailQueryParam: name: email description: Filter by email. in: query required: false schema: type: array items: type: string format: email style: form explode: true x-ms-parameter-location: method TenantIdQueryParam: name: tenantId description: Filter by tenantId. in: query required: false schema: type: array items: type: string format: uuid style: form explode: true x-ms-parameter-location: method RobotContextQueryParam: name: filterContext description: Filter by the specified context. in: query required: false schema: $ref: '#/components/schemas/RobotFilterContext' style: form x-ms-parameter-location: method schemas: AuditedObjectType: description: Audited object Types. type: string enum: - AUTHENTICATION - TENANT_USER - PROCESS - PROCESS_PAGE_ITEM - TASK - TASK_PAGE_ITEM - WORKER - ROBOT deprecated: true x-ms-enum: modelAsString: false AbstractAudited: type: object properties: objectType: $ref: "#/components/schemas/AuditedObjectType" createdBy: description: Who create this model. type: string format: uuid createdAt: description: When this model was created. type: string format: date-time lastModifiedBy: description: Who was last update this model. type: string format: uuid lastModifiedAt: description: When this model type was last updated. type: string format: date-time PagedObjectType: description: Paged Model types. type: string enum: - PRINCIPAL_PAGE - TENANT_USER_PAGE - PROCESS_PAGE - TASK_PAGE - ROBOT_PAGE deprecated: true x-ms-enum: modelAsString: false DefaultError: description: Default error type: object properties: timestamp: description: Timestamp indicating when the error happened. type: string format: date-time status: description: HTTP Status type: integer message: description: Message Status type: string errors: description: Related error information. type: array items: $ref: "#/components/schemas/DefaultErrorInfo" required: - timestamp - status - message DefaultErrorInfo: type: object properties: code: type: string message: type: string location: type: string locationType: type: string required: - code - message WebhookEventProcessStateChangedData: type: object properties: processId: type: string format: uuid processState: $ref: "#/components/schemas/ProcessState" required: - processId - processState WebhookEventTaskStateChangedData: type: object properties: processId: type: string format: uuid taskId: type: string format: uuid taskCode: type: string taskState: $ref: "#/components/schemas/TaskState" required: - processId - taskId - taskCode - taskState WebhookEventProcessStateChanged: description: Process Events allOf: - $ref: "#/components/schemas/WebhookEvent" - type: object properties: data: $ref: "#/components/schemas/WebhookEventProcessStateChangedData" required: - data x-all-of-name: WebhookEventProcessStateChangedAllOf WebhookEventTaskStateChanged: description: Process Events allOf: - $ref: "#/components/schemas/WebhookEvent" - type: object properties: data: $ref: "#/components/schemas/WebhookEventTaskStateChangedData" required: - data x-all-of-name: WebhookEventTaskStateChangedAllOf WebhookType: description: Type of the Event. type: string enum: - PROCESS.STATE_CHANGED - TASK.STATE_CHANGED x-ms-enum: modelAsString: false x-enum-varnames: - PROCESS__STATE_CHANGED - TASK__STATE_CHANGED WebhookEvent: type: object properties: id: type: string format: uuid type: $ref: "#/components/schemas/WebhookType" timestamp: type: string format: date-time required: - id - type - timestamp discriminator: propertyName: type mapping: "PROCESS.STATE_CHANGED": "#/components/schemas/WebhookEventProcessStateChanged" "TASK.STATE_CHANGED": "#/components/schemas/WebhookEventTaskStateChanged" PageMetadata: type: object properties: size: type: integer minimum: 0 example: 25 page: type: integer minimum: 0 example: 0 totalElements: type: integer format: int64 example: 1096 totalPages: type: integer example: 110 required: - size - page - totalElements - totalPages Page: type: object properties: objectType: $ref: "#/components/schemas/PagedObjectType" metadata: $ref: "#/components/schemas/PageMetadata" required: - metadata AuthenticationType: type: string enum: - ENGINE - ENGINE_TOKEN - ENGINE_CERTIFICATE x-ms-enum: modelAsString: false Authentication: allOf: - $ref: "#/components/schemas/AbstractAudited" - type: object properties: id: type: string format: uuid type: $ref: "#/components/schemas/AuthenticationType" tenantId: type: string format: uuid description: Tenant id. This attribute is required when an OAuth2 authentication is used. token: type: string deprecated: true description: | Engine authentication token. @deprecated use engineToken.token expiredAt: type: string format: date-time deprecated: true description: | Engine authentication token expiration. @deprecated use engineToken.expiredAt engineToken: $ref: "#/components/schemas/AuthenticationEngineToken" engineCertificate: $ref: "#/components/schemas/AuthenticationEngineCertificate" x-all-of-name: AuthenticationAllOf AuthenticationEngineToken: type: object properties: token: type: string description: Engine authentication token expiredAt: type: string format: date-time required: - token - expiredAt AuthenticationEngineCertificate: type: object properties: namespace: type: string tls: type: object properties: serverRootCaCertificate: type: string clientCertificate: type: string clientPrivateKey: type: string required: - serverRootCaCertificate - clientCertificate - clientPrivateKey required: - namespace - tls ProcessState: description: Process state type: string enum: - RUNNING - COMPLETED - CANCELLED x-ms-enum: modelAsString: false TaskState: description: Task state type: string enum: - READY - CLAIMED - COMPLETED - CANCELLED x-ms-enum: modelAsString: false ProcessElementValueType: description: Process element value types. type: string enum: - STRING - NUMBER x-ms-enum: modelAsString: false ProcessSaveElementCommand: description: Command to save process element. type: object properties: elementDefinitionCode: type: string elementValues: type: array items: $ref: "#/components/schemas/ProcessElementValue" required: - elementDefinitionCode ProcessElementValue: type: object properties: valid: type: boolean default: true type: $ref: "#/components/schemas/ProcessElementValueType" required: - type discriminator: propertyName: type mapping: "STRING": "#/components/schemas/ProcessElementValueString" "NUMBER": "#/components/schemas/ProcessElementValueNumber" ProcessElementValueString: allOf: - $ref: "#/components/schemas/ProcessElementValue" - type: object properties: value: type: string x-all-of-name: ProcessElementValueStringAllOf ProcessElementValueNumber: allOf: - $ref: "#/components/schemas/ProcessElementValue" - type: object properties: value: type: number format: double x-all-of-name: ProcessElementValueNumberAllOf TaskSaveElementCommand: type: object properties: elementDefinitionCode: type: string elementValues: type: array items: $ref: "#/components/schemas/TaskElementValue" required: - elementDefinitionCode TaskElementValueType: type: string enum: - STRING - NUMBER - OBJECT - DOCUMENT - PRINCIPAL x-ms-enum: modelAsString: false TaskElementValue: type: object properties: valid: type: boolean default: true type: $ref: "#/components/schemas/TaskElementValueType" required: - type discriminator: propertyName: type mapping: "STRING": "#/components/schemas/TaskElementValueString" "NUMBER": "#/components/schemas/TaskElementValueNumber" "OBJECT": "#/components/schemas/TaskElementValueObject" "DOCUMENT": "#/components/schemas/TaskElementValueDocument" "PRINCIPAL": "#/components/schemas/TaskElementValuePrincipal" TaskElementValueString: allOf: - $ref: "#/components/schemas/TaskElementValue" - type: object properties: value: type: string x-all-of-name: TaskElementValueStringAllOf TaskElementValueNumber: allOf: - $ref: "#/components/schemas/TaskElementValue" - type: object properties: value: type: number format: double x-all-of-name: TaskElementValueNumberAllOf TaskElementValueObject: allOf: - $ref: "#/components/schemas/TaskElementValue" - type: object properties: value: type: object additionalProperties: true x-all-of-name: TaskElementValueObjectAllOf TaskElementValueDocument: allOf: - $ref: "#/components/schemas/TaskElementValue" - type: object properties: value: $ref: "#/components/schemas/TaskElementValueDocumentItem" x-all-of-name: TaskElementValueDocumentAllOf TaskElementValuePrincipal: allOf: - $ref: "#/components/schemas/TaskElementValue" - type: object properties: value: $ref: "#/components/schemas/TaskElementValuePrincipalItem" x-all-of-name: TaskElementValuePrincipalAllOf TaskElementValueDocumentItem: type: object properties: id: type: string format: uuid uri: type: string name: type: string contentPath: type: string contentType: type: string contentLength: type: integer format: int64 TaskElementValuePrincipalItem: type: object properties: id: type: string format: uuid type: $ref: "#/components/schemas/PrincipalType" name: type: string required: - id - type JsonFormsValueData: type: object description: json value filled that complain with the related json schema. additionalProperties: true JsonFormsValue: type: object description: | Json form values, used when the render type selected is JSON Forms. properties: valid: type: boolean description: true if the data complain the related json schema. data: $ref: "#/components/schemas/JsonFormsValueData" TaskSaveJsonFormsValueDataCommand: type: object properties: data: $ref: "#/components/schemas/JsonFormsValueData" TaskSaveJsonFormsValueDocumentResponseCommand: type: object properties: value: type: string description: | JSON value representing the uploaded file. Example: `kuflow-file:uri=xxx-yyy-zzz;type=application/json;size=500;name=file.json;` required: - value ProcessSaveEntityDataCommand: type: object properties: data: $ref: "#/components/schemas/JsonFormsValueData" required: - data ProcessSaveEntityDocumentResponseCommand: type: object properties: value: type: string description: | JSON value representing the uploaded file. Example: `kuflow-file:uri=xxx-yyy-zzz;type=application/json;size=500;name=file.json;` required: - value ProcessChangeInitiatorCommand: description: Command to change the process initiator, only one option is required. type: object properties: principalId: type: string format: uuid email: type: string format: email ProcessDefinitionSummary: type: object properties: id: type: string format: uuid version: type: string format: uuid name: type: string minLength: 1 maxLength: 50 required: - id Process: allOf: - $ref: "#/components/schemas/AbstractAudited" - type: object properties: id: description: Process ID. type: string format: uuid subject: description: Process subject. type: string minLength: 1 maxLength: 255 state: $ref: "#/components/schemas/ProcessState" processDefinition: $ref: "#/components/schemas/ProcessDefinitionSummary" elementValues: type: object description: Process element values, an ElementValueDocument is not allowed. additionalProperties: type: array items: $ref: "#/components/schemas/ProcessElementValue" entity: $ref: "#/components/schemas/JsonFormsValue" initiator: $ref: "#/components/schemas/Principal" relatedProcess: $ref: "#/components/schemas/RelatedProcess" tenantId: description: Tenant ID. type: string format: uuid required: - processDefinition x-all-of-name: ProcessAllOf RelatedProcess: type: object properties: incoming: description: Processes whose relationship target is the current process. type: array items: type: string format: uuid outcoming: description: Processes to which the current process relates. type: array items: type: string format: uuid ProcessPageItem: allOf: - $ref: "#/components/schemas/AbstractAudited" - type: object properties: id: description: Process ID. type: string format: uuid subject: description: Process subject. type: string minLength: 1 maxLength: 255 state: $ref: "#/components/schemas/ProcessState" processDefinition: $ref: "#/components/schemas/ProcessDefinitionSummary" elementValues: type: object description: Process element values, an ElementValueDocument is not allowed. additionalProperties: type: array items: $ref: "#/components/schemas/ProcessElementValue" initiator: $ref: "#/components/schemas/Principal" tenantId: description: Tenant ID. type: string format: uuid required: - processDefinition x-all-of-name: ProcessAllOf ProcessPage: allOf: - $ref: "#/components/schemas/Page" - type: object properties: content: type: array items: $ref: "#/components/schemas/ProcessPageItem" required: - content x-all-of-name: ProcessPageAllOf ProcessDeleteElementCommand: type: object properties: elementDefinitionCode: description: Code of task element to delete. type: string required: - elementDefinitionCode Task: allOf: - $ref: "#/components/schemas/AbstractAudited" - type: object properties: id: type: string format: uuid state: $ref: "#/components/schemas/TaskState" taskDefinition: $ref: "#/components/schemas/TaskDefinitionSummary" processId: type: string format: uuid elementValues: description: | Task element values, en ElementValueDocument is not allowed, used when the task render type selected is JSON Forms type: object additionalProperties: type: array items: $ref: "#/components/schemas/TaskElementValue" jsonFormsValue: $ref: "#/components/schemas/JsonFormsValue" logs: type: array items: $ref: "#/components/schemas/Log" owner: $ref: "#/components/schemas/Principal" tenantId: description: Tenant ID. type: string format: uuid required: - taskDefinition - processId x-all-of-name: TaskAllOf TaskPageItem: allOf: - $ref: "#/components/schemas/AbstractAudited" - type: object properties: id: type: string format: uuid state: $ref: "#/components/schemas/TaskState" taskDefinition: $ref: "#/components/schemas/TaskDefinitionSummary" processId: type: string format: uuid elementValues: description: Task element values, en ElementValueDocument is not allowed. type: object additionalProperties: type: array items: $ref: "#/components/schemas/TaskElementValue" jsonFormsValue: $ref: "#/components/schemas/JsonFormsValue" owner: $ref: "#/components/schemas/Principal" tenantId: description: Tenant ID. type: string format: uuid required: - taskDefinition - processId x-all-of-name: TaskAllOf TaskDefinitionSummary: description: In creation task, one of 'id, version or code' is mandatory. type: object properties: id: type: string format: uuid version: type: string format: uuid code: type: string name: type: string minLength: 1 maxLength: 50 TaskPage: allOf: - $ref: "#/components/schemas/Page" - type: object properties: content: type: array items: $ref: "#/components/schemas/TaskPageItem" required: - content x-all-of-name: TaskPageAllOf TaskDeleteElementValueDocumentCommand: type: object properties: documentId: description: Document ID to delete. type: string format: uuid required: - documentId TaskAssignCommand: description: Command to assign task, only one option is required. type: object properties: principalId: type: string format: uuid email: type: string format: email TaskDeleteElementCommand: type: object properties: elementDefinitionCode: description: Code of task element to delete. type: string required: - elementDefinitionCode LogLevel: type: string enum: - INFO - WARN - ERROR x-ms-enum: modelAsString: false Log: type: object properties: id: type: string format: uuid createdAt: description: When this model was created. type: string format: date-time message: type: string level: $ref: "#/components/schemas/LogLevel" required: - message - level PrincipalPage: allOf: - $ref: "#/components/schemas/Page" - type: object properties: content: type: array items: $ref: "#/components/schemas/Principal" required: - content x-all-of-name: PrincipalPageAllOf Principal: type: object properties: id: type: string format: uuid type: $ref: "#/components/schemas/PrincipalType" name: type: string user: $ref: "#/components/schemas/PrincipalUser" application: $ref: "#/components/schemas/PrincipalApplication" PrincipalType: type: string enum: - USER - APPLICATION - SYSTEM x-ms-enum: modelAsString: false PrincipalUser: type: object properties: id: type: string format: uuid email: type: string PrincipalApplication: type: object properties: id: type: string format: uuid TenantUserMetadata: type: object properties: valid: type: boolean value: type: object additionalProperties: true required: - valid - value TenantUser: allOf: - $ref: "#/components/schemas/AbstractAudited" - type: object properties: id: type: string format: uuid metadata: $ref: "#/components/schemas/TenantUserMetadata" principal: $ref: "#/components/schemas/Principal" tenantId: type: string format: uuid readOnly: true required: - id - principal - tenantId x-all-of-name: TenantUserAllOf TenantUserPage: allOf: - $ref: "#/components/schemas/Page" - type: object properties: content: type: array items: $ref: "#/components/schemas/TenantUser" required: - content x-all-of-name: TenantUserPageAllOf Worker: allOf: - $ref: "#/components/schemas/AbstractAudited" - type: object properties: id: type: string format: uuid identity: type: string minLength: 1 maxLength: 255 taskQueue: type: string minLength: 1 maxLength: 255 workflowTypes: type: array items: type: string minLength: 1 maxLength: 255 activityTypes: type: array items: type: string minLength: 1 maxLength: 255 hostname: type: string minLength: 1 maxLength: 255 ip: type: string minLength: 7 maxLength: 40 installationId: description: Installation Id. type: string format: uuid robotIds: description: Robot Ids that this worker implements. type: array items: type: string format: uuid tenantId: description: Tenant ID. type: string format: uuid required: - identity - taskQueue - hostname - ip x-all-of-name: WorkerAllOf Robot: allOf: - $ref: "#/components/schemas/AbstractAudited" - type: object properties: id: description: Robot ID. type: string format: uuid code: description: Robot Code. type: string minLength: 1 maxLength: 50 name: description: Robot name. type: string minLength: 1 maxLength: 50 description: description: Robot description. type: string minLength: 1 maxLength: 4000 sourceType: $ref: "#/components/schemas/RobotSourceType" sourceFile: $ref: "#/components/schemas/RobotSourceFile" environmentVariables: description: Environment variables to load when the robot is executed. type: object additionalProperties: type: string minLength: 1 maxLength: 4000 tenantId: description: Tenant ID. type: string format: uuid required: - id - code - name - sourceType x-all-of-name: RobotAllOf RobotSourceType: type: string description: Robot source type enum: - PACKAGE - ROBOT_FRAMEWORK_PYTHON_WHEEL x-ms-enum: modelAsString: false RobotAssetType: type: string description: Robot asset type enum: - PYTHON - PYTHON_PIP - NODEJS x-ms-enum: modelAsString: false values: - value: PYTHON name: Python - value: PYTHON_PIP name: PythonPip - value: NODEJS name: NodeJS RobotAssetPlatform: type: string description: Robot asset platform enum: - WINDOWS - MAC_OS - LINUX x-ms-enum: modelAsString: false values: - value: WINDOWS name: Windows - value: MAC_OS name: MacOS - value: LINUX name: Linux RobotAssetArchitecture: type: string description: Robot asset platform architecture enum: - X86_32 - X86_64 x-ms-enum: modelAsString: false values: - value: X86_32 name: X86Bit32 - value: X86_64 name: X86Bit64 x-enum-varnames: - X86_32 - X86_64 RobotSourceFile: type: object description: Robot source type properties: id: description: Robot ID. type: string format: uuid name: description: Source file name. type: string contentType: description: Source file content type. type: string contentLength: description: Source file length. type: integer format: int64 contentHash: description: Source file to check the integrity. type: string required: - id - name - contentType - contentLength - contentHash RobotPage: allOf: - $ref: "#/components/schemas/Page" - type: object properties: content: type: array items: $ref: "#/components/schemas/Robot" required: - content x-all-of-name: RobotPageAllOf RobotFilterContext: type: string description: | Robot filter context: * READY: filters out robots ready for execution for the current credentials * DEFAULT: filters out robots accessible for the current credentials (if no set this is the default option) enum: - READY - DEFAULT x-ms-enum: modelAsString: false responses: DefaultError: description: Unexpected error. content: application/json: schema: $ref: "#/components/schemas/DefaultError" securitySchemes: BasicAuth: type: http scheme: basic BearerAuth: type: http scheme: bearer OAuth2Auth: type: oauth2 flows: authorizationCode: authorizationUrl: https://auth.kuflow.com/realms/KuFlow/protocol/openid-connect/auth tokenUrl: https://auth.kuflow.com/realms/KuFlow/protocol/openid-connect/token scopes: openid: Grants read openid data access email: Grants read email data access