API v2: Sessions Approval πΒΆ
Note
To allow users to accept or reject access requests, the Safe must have the require_confirmation attribute set to true. This setting enables the approval workflow for access requests.
Data StructuresΒΆ
Approve Object Specification
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
ID of the session to approve. |
Retrieve Available Attributes of the SessionApproveModelΒΆ
Request
Method |
|
Path |
|
GET /api/v2/objspec/session_approve
Example Request
curl -s -k -X GET \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.0.214.98/api/v2/objspec/session_approve'
Reject Object Specification
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
ID of the session to reject. |
|
string |
yes |
The reason why the session is rejected. |
|
boolean; default value |
Indicates whether to block the user who established the session. |
Retrieve Available Attributes of the SessionRejectModelΒΆ
Request
Method |
|
Path |
|
GET /api/v2/objspec/session_reject
Example Request
curl -s -k -X GET \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.0.214.98/api/v2/objspec/session_reject'
Approving SessionΒΆ
Request
Method |
|
Path |
|
POST /api/v2/session/<session_id>/approve
Example Request
curl -s -k -X POST \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.31.92.108/api/v2/session/4665729213955833862/approve'
Response
{
"result": "success"
}
Rejecting SessionΒΆ
Request
Method |
|
Path |
|
POST /api/v2/session/<session_id>/reject
Example Request
curl -s -k -X POST \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
-H 'Content-Type: application/json' \
https://10.31.92.108/api/v2/session/4665729213955833862/reject \
-d '{"reason": "CODE 1.12", "block_user":true}'
Response
{
"result": "success"
}