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

SessionApproveModelΒΆ
Attribute Type Required Description
session_id string yes ID of the session to approve.

Request for Retrieving Available Attributes of the SessionApproveModelΒΆ

Request

Method GET
Path /api/v2/objspec/session_approve

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

SessionRejectModelΒΆ
Attribute Type Required Description
session_id string yes ID of the session to reject.
reason string yes The reason why the session is rejected.
block_user boolean; default value false   Indicates whether to block the user who established the session.

Request for Retrieving Available Attributes of the SessionRejectModelΒΆ

Request

Method GET
Path /api/v2/objspec/session_reject

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 POST
Path /api/v2/session/<session_id>/approve

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 POST
Path /api/v2/session/<session_id>/reject

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"
}