Approval API
The WSO2 Identity Server - Workflow Approval API Definition (version v2).
Download the OpenAPI definition (YAML)
Security schemes
BasicAuth: HTTP basic
OAuth2: oauth2
authorizationCode flow, token URL https://localhost:9443/oauth2/token, authorization URL https://localhost:9443/oauth2/authorize
2 scopes
| Scope | Description |
|---|---|
internal_approval_task_view | View approval tasks |
internal_approval_task_update | Update approval tasks |
me
Operations for the authenticated user.
Retrieves available approvals for the authenticated user
GET /me/approval-tasks
Retrieve the available approval tasks in the system for the authenticated user. This API returns the following types of approvals:
- READY - Tasks that are claimable by the user. If a particular task is in the READY state, the user is eligible to self-assign the task and complete it.
- RESERVED - Tasks that are assigned to the user and to be approved by this user.
- COMPLETED - Tasks that are already completed (approved or denied) by this user.
A user can also invoke the endpoint with the following query parameters.
Scopes: internal_approval_task_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer (int32) | Maximum number of records to return | |
offset | query | integer (int32) | Number of records to skip for pagination | |
status | query | array of any | Approval task's status to filter tasks by their status:
Allowed values: | |
operationType | query | array of string | Filter approval tasks by operation type. | |
filter | query | string | Filter condition to narrow down approval tasks. Supported filter attributes and operators: Filter attributes:
|
Responses
| Code | Description | Schema |
|---|---|---|
200 | Array of approval tasks matching the search criteria | array of TaskSummary |
400 | Invalid input request | Error |
401 | Unauthorized | |
403 | Resource Forbidden | |
500 | Internal Server Error | Error |
Retrieves an approval task by the task-id
GET /me/approval-tasks/{task-id}
Retrieves information of a specific approval task identified by the task-id
Scopes: internal_approval_task_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
task-id | path | string | Yes | Task ID |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Detailed information of the approval task identified by the task-id | TaskData |
400 | Invalid input request | Error |
401 | Unauthorized | |
403 | Resource Forbidden | |
404 | The specified resource is not found | Error |
409 | Element Already Exists | Error |
500 | Internal Server Error | Error |
Changes the state of an approval task
PUT /me/approval-tasks/{task-id}/state
Update the approval task status by defining one of the following actions:
- CLAIM - Reserve the task for the user. Status of the task will be changed from READY to RESERVED.
- RELEASE - Release the task for other users to claim. Status of the task will be changed from RESERVED to READY.
- APPROVE - Approve the task. Status of the task will be changed to COMPLETED.
- REJECT - Deny the task. Status of the task will be changed to COMPLETED.
Scopes: internal_approval_task_update
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
task-id | path | string | Yes | Task ID |
Request body: application/json
To which state the task should be changed.
Schema: StateDTO
1 property
| Name | Type | Required | Description |
|---|---|---|---|
action | string | Action to perform on the task. Allowed values: |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | |
400 | Invalid input request | Error |
401 | Unauthorized | |
403 | Resource Forbidden | |
404 | The specified resource is not found | Error |
500 | Internal Server Error | Error |
Schemas
TaskSummary
Type: object
8 properties
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Unique ID to represent an Approval Task | |
name | string | Unique name for the Approval Task | |
presentationSubject | string | Display value for Approval Operation | |
presentationName | string | Display value for Approval Task | |
taskType | string | Type of the Approval | |
status | string | State of the Approval task Allowed values: | |
priority | integer | Priority of the Approval task | |
createdTimeInMillis | string | The time that the operation for approval initiated |
TaskData
Type: object
8 properties
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Unique ID to represent a approval task | |
subject | string | Subject of the Approval | |
description | string | Description on the Approval task | |
priority | integer | Priority of the Approval task | |
initiator | string | The user who initiated the task | |
approvalStatus | string | Available only for the completed Tasks, APPROVED or REJECTED if the task has been completed, PENDING otherwise Allowed values: | |
assignees | array of Property | To whom the task is assigned:
| |
properties | array of Property |
StateDTO
Type: object
1 property
| Name | Type | Required | Description |
|---|---|---|---|
action | string | Action to perform on the task. Allowed values: |
Error
Type: object
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | |
message | string | Yes | |
description | string | ||
traceId | string |
Was this page helpful?