---
agentTools:
  projectIndex: https://docs.privakey.com/llms.txt
---

# Cancel Request

Sets a request status to canceled.

Only requests with a status of Pending (status ID 3) can be canceled. If a request's status is not Pending, the Auth Service will return a 422 Unprocessable Entity error.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "API Settings",
    "version": "2.4"
  },
  "servers": [
    {
      "url": "https://cloud.privakey.com"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/api/request/cancel": {
      "patch": {
        "summary": "Cancel Request",
        "description": "Sets a request status to canceled.\n\nOnly requests with a status of Pending (status ID 3) can be canceled. If a request's status is not Pending, the Auth Service will return a 422 Unprocessable Entity error.",
        "operationId": "cancel-request",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Either Basic or HMAC, depending on how the Request Origin is configured.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Basic <basic creds>"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "requestGuid"
                ],
                "properties": {
                  "requestGuid": {
                    "type": "string",
                    "description": "The guid of the request to cancel."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "204",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": " "
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [],
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl --location --request PATCH \"https://cloud.privakey.com/api/request/cancel\" --header \"Authorization: Basic <basic creds>\" --header \"Content-Type: application/x-www-form-urlencoded\" --data \"requestGuid=4307f522-dd16-4b0d-b96f-1be8dd7c7487\""
            }
          ],
          "samples-languages": [
            "curl"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "660d684fcb33080067214619:660d684fcb33080067214637"
}
```