requests

Cancels a pending access request.

post/requests/{id}/cancel

Request

  • Base URL
    https://api.opal.dev/v1
  • Auth
    HTTP bearer

Path parameters

idstring uuid required

The ID of the request to cancel.

Response

The canceled request.

idstring uuid required

The unique identifier of the request.

created_atstring date-time required

The date and time the request was created.

updated_atstring date-time required

The date and time the request was last updated.

requester_idstring uuid required

The unique identifier of the user who created the request.

initiated_by_user_idstring uuid

The unique identifier of the user the caller asserted asked for this access. Unverified - Opal records the claim as given. Absent unless the caller supplied it.

target_user_idstring uuid

The unique identifier of the user who is the target of the request.

target_group_idstring uuid

The unique identifier of the group who is the target of the request.

status'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELED' required

Request Status

Description

The RequestStatus enum is used to represent the status of a request.

Usage Example

Returned from the GET Requests endpoint.

source'WEB' | 'SLACK' | 'MICROSOFT_TEAMS' | 'CLI' | 'API' | 'MCP' | 'ACCESS_REVIEW'

The channel that created the request. Omitted when the source was not recorded. MCP counts only OAuth sessions. An agent using an API token or a person's credentials is counted as API, CLI, or WEB.

reasonstring required

The reason for the request.

duration_minutesinteger

The duration of the request in minutes.

Example response

{
  "id": "7c86c85d-0651-43e2-a748-d69d658418e8",
  "created_at": "2021-01-06T20:00:00Z",
  "updated_at": "2021-01-06T20:00:00Z",
  "requester_id": "c86c85d-0651-43e2-a748-d69d658418e8",
  "target_user_id": "r86c85d-0651-43e2-a748-d69d658418e8",
  "target_group_id": "r86c85d-0651-43e2-a748-d69d658418e8",
  "status": "pending",
  "reason": "I need this resource.",
  "duration_minutes": 1440,
  "request_comments": [
    {
      "id": "7c86c85d-0651-43e2-a748-d69d658418e8",
      "created_at": "2021-01-06T20:00:00Z",
      "updated_at": "2021-01-06T20:00:00Z",
      "request_id": "4c86c85d-0651-43e2-a748-d69d658418e8",
      "user_id": "c86c85d-0651-43e2-a748-d69d658418e8",
      "comment": "This is a comment."
    }
  ],
  "reviewer_stages": [
    {
      "requestedRoleName": "Admin",
      "requestedItemName": "AWS Production Account",
      "stages": [
        {
          "stage": 1,
          "operator": "AND",
          "reviewers": [
            {
              "id": "7c86c85d-0651-43e2-a748-d69d658418e8",
              "status": "PENDING"
            }
          ]
        },
        {
          "stage": 2,
          "operator": "OR",
          "reviewers": [
            {
              "id": "8d86c85d-0651-43e2-a748-d69d658418e9",
              "status": "APPROVED"
            }
          ]
        }
      ]
    }
  ]
}

Changes