Skip to main content

Approvals

Workflow Approval API (v1)

Download OpenAPI specification:Download

This is the RESTful API for a user to manage pending approvals in the WSO2 Identity Server. This API can be used to retrieve pending approvals and update the status of the approval tasks for the authenticated user.

me

Operations for the authenticated user.

Retrieves available approvals for the authenticated user

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 assign the task to themself 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.

Permission required: /permission/admin/manage/humantask/viewtasks
Scope required: internal_humantask_view

A user can also invoke the endpoint with the following query parameters.

Authorizations:
OAuth2BasicAuth
query Parameters
limit
integer <int32> >= 0

Maximum number of records to return

offset
integer <int32> >= 0

Number of records to skip for pagination

status
Array of objects

Approval task's status to filter tasks by their status:

  • RESERVED - Tasks that are assigned to the authenticated user.
  • READY - Tasks that can be assigned to and can be approved by the authenticated user.
  • COMPLETED - Tasks that are completed by the user
  • <empty> - All the viewable tasks will be retrieved if this parameter is not specified.

Responses

Request samples

curl -X 'GET' \
'https://localhost:9443/api/users/v1/me/approval-tasks' \
-H 'accept: */*' \
-H 'Authorization: Basic YWRtaW46YWRtaW4='

Response samples

Content type
No sample

Retrieve an approval task by the task-id

Retrieves information of a specific approval task identified by the task-id
Permission required: /permission/admin/manage/humantask/viewtasks Scope required: internal_humantask_view

Authorizations:
OAuth2BasicAuth
path Parameters
task-id
required
string

Task ID

Responses

Request samples

curl -X 'GET' \
'https://localhost:9443/api/users/v1/me/approval-tasks/451' \
-H 'accept: */*' \
-H 'Authorization: Basic YWRtaW46YWRtaW4='

Response samples

Content type
No sample

Changes the state of an approval task

Update the approval task status by defining one of the following actions:

  • CLAIM - Reserve the task for the user. The status of the task will be changed from READY to RESERVED.
  • RELEASE - Release the task for other users to claim. The status of the task will be changed from RESERVED to READY.
  • APPROVE - Approve the task. The status of the task will be changed to COMPLETED.
  • REJECT - Deny the task. The status of the task will be changed to COMPLETED.

Permission required: /permission/admin/manage/humantask/viewtasks Scope required: internal_humantask_view

Authorizations:
OAuth2BasicAuth
path Parameters
task-id
required
string

Task ID

Request Body schema: */*
optional

To which state the task should be changed.

action
string
Enum: "CLAIM" "RELEASE" "APPROVE" "REJECT"

Action to perform on the task.

Responses

Request samples

curl -X 'PUT' \
'https://localhost:9443/api/users/v1/me/approval-tasks/451/state' \
-H 'accept: */*' \
-H 'Authorization: Basic YWRtaW46YWRtaW4=' \
-H 'Content-Type: */*' \
-d '{
  "action": "APPROVE"
}'