Skip to main content
Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

Approval API

Download OpenAPI (YAML)Version v2

Base URL: https://api.asgardeo.io/t/<ORGANIZATION_NAME>/api/users/v2

The WSO2 Identity Platform - Workflow Approval API (version v2).

Download the OpenAPI definition (YAML)

Security schemes​

OAuth2: oauth2

authorizationCode flow, token URL https://api.asgardeo.io/t/{organization-name}/oauth2/token, authorization URL https://api.asgardeo.io/t/{organization-name}/oauth2/authorize

2 scopes
ScopeDescription
internal_approval_task_viewView approval tasks
internal_approval_task_updateUpdate 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

NameInTypeRequiredDescription
limitqueryinteger (int32)

Maximum number of records to return

offsetqueryinteger (int32)

Number of records to skip for pagination

statusqueryarray of any

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.

Allowed values: READY, RESERVED, COMPLETED

Responses

CodeDescriptionSchema
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

NameInTypeRequiredDescription
task-idpathstringYes

Task ID

Responses

CodeDescriptionSchema
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

NameInTypeRequiredDescription
task-idpathstringYes

Task ID

Request body: application/json

To which state the task should be changed.

Schema: StateDTO

1 property
NameTypeRequiredDescription
actionstring

Action to perform on the task.

Allowed values: CLAIM, RELEASE, APPROVE, REJECT

Responses

CodeDescriptionSchema
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
NameTypeRequiredDescription
idstring

Unique ID to represent an Approval Task

namestring

Unique name for the Approval Task

presentationSubjectstring

Display value for Approval Operation

presentationNamestring

Display value for Approval Task

taskTypestring

Type of the Approval

statusstring

State of the Approval task

Allowed values: READY, RESERVED, COMPLETED

priorityinteger

Priority of the Approval task

createdTimeInMillisstring

The time that the operation for approval initiated

TaskData​

Type: object

8 properties
NameTypeRequiredDescription
idstring

Unique ID to represent a approval task

subjectstring

Subject of the Approval

descriptionstring

Description on the Approval task

priorityinteger

Priority of the Approval task

initiatorstring

The user who initiated the task

approvalStatusstring

Available only for the completed Tasks, APPROVED or REJECTED if the task has been completed, PENDING otherwise

Allowed values: PENDING, APPROVED, REJECTED

assigneesarray of Property

To whom the task is assigned:

  • user - username(s) if the task is reserved for specific user(s).
  • group - role name(s) if the task is assignable for group(s).
propertiesarray of Property

Property​

Type: object

2 properties
NameTypeRequiredDescription
keystring
valuestring

StateDTO​

Type: object

1 property
NameTypeRequiredDescription
actionstring

Action to perform on the task.

Allowed values: CLAIM, RELEASE, APPROVE, REJECT

Error​

Type: object

4 properties
NameTypeRequiredDescription
codestringYes
messagestringYes
descriptionstring
traceIdstring

Was this page helpful?