---
title: "Cancel request"
method: POST
path: "/requests/{id}/cancel"
tags: ["requests"]
---

# Cancel request

`POST /requests/{id}/cancel`

## Request

- Base URL: `https://api.opal.dev/v1`
- URL: `https://api.opal.dev/v1/requests/{id}/cancel`
- Auth: HTTP bearer

Cancels a pending access request.

## Path parameters

- `id` string, uuid, required

## Response `200`

The canceled request.

- Request: # Request Object ### Description The `Request` object is used to represent a request. ### Usage Example Returned from the `GET Requests` endpoint.
  - `id` string, uuid, required: The unique identifier of the request.
  - `created_at` string, date-time, required: The date and time the request was created.
  - `updated_at` string, date-time, required: The date and time the request was last updated.
  - `requester_id` string, uuid, required: The unique identifier of the user who created the request.
  - `initiated_by_user_id` string, 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_id` string, uuid: The unique identifier of the user who is the target of the request.
  - `target_group_id` string, 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.
  - `reason` string, required: The reason for the request.
  - `duration_minutes` integer: The duration of the request in minutes.
  - `requested_items_list` RequestedItem[]: The list of targets for the request.
    - `resource_id` string, uuid: The ID of the resource requested.
    - `group_id` string, uuid: The ID of the group requested.
    - `access_level_name` string: The name of the access level requested.
    - `access_level_remote_id` string: The ID of the access level requested on the remote system.
    - `name` string: The name of the target.
    - `remote_id` string: The ID of the target on the remote system.
    - `remote_name` string: The name of the target on the remote system.
  - `custom_fields_responses` RequestCustomFieldResponse[]: The responses given to the custom fields associated to the request
    - `field_name` string, required
    - `field_type` 'SHORT_TEXT' | 'LONG_TEXT' | 'BOOLEAN' | 'MULTI_CHOICE' | 'MULTI_SELECT' | 'CALLOUT', required: The type of the custom request field. `CALLOUT` fields are display-only -- they show a message to the requester and collect no answer, so they never appear in a request's `custom_fields`.
    - `field_value` union, required
      - string
      - boolean
  - `stages` RequestItemStages: The stages configuration for a request item
    - `requestedRoleName` string: The name of the requested role
    - `requestedItemName` string, required: The name of the requested item
    - `stages` RequestStage[], required: The stages of review for this request
      - `stage` integer, required: The stage number
      - `operator` 'AND' | 'OR', required: The operator to apply to reviewers in a stage
      - `reviewers` RequestReviewer[], required: The reviewers for this stage
        - `id` string, uuid, required: The unique identifier of the reviewer
        - `full_name` string: The user's full name.
        - `status` 'PENDING' | 'APPROVED' | 'REJECTED', required: The status of this reviewer's review
  - `reviewer_stages` union: The configured reviewer stages for every item in this request, or an error message if reviewers could not be loaded
    - RequestReviewerStages[]
      - `access_level_name` string: The name of the access level requested.
      - `access_level_remote_id` string: The ID of the access level requested on the remote system.
      - `item_name` string, required: The name of the requested item
      - `item_id` string, uuid, required: The ID of the resource requested.
      - `stages` RequestStage[], required: The stages of review for this request
        - `stage` integer, required: The stage number
        - `operator` 'AND' | 'OR', required: The operator to apply to reviewers in a stage
        - `reviewers` RequestReviewer[], required: The reviewers for this stage
          - `id` string, uuid, required: The unique identifier of the reviewer
          - `full_name` string: The user's full name.
          - `status` 'PENDING' | 'APPROVED' | 'REJECTED', required: The status of this reviewer's review
    - string

## Other responses

- `403`: The authenticated user cannot cancel this request.
- `404`: The request was not found.
- `409`: The request has already been actioned.

## Changes

- **2026-10-06** `c0ce333f6196`: 2 info
  - added the optional property `initiated_by_user_id` to the response with the `200` status
  - added the optional property `source` to the response with the `200` status
- **2026-09-08** `38f6abcc4188`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/opal/apis/opal-api/changes/requests/:id/cancel/post.md)

---

[API](https://skmtc.dev/opal/apis/opal-api.md) - [All operations](https://skmtc.dev/opal/apis/opal-api/llms.txt) - [OpenAPI document](https://skmtc.dev/opal/apis/opal-api/revisions/e7877ea96eab?raw)
