---
title: Revoke the consent
slug: payment/revoke-the-consent
docTags: 
createdAt: 2025-08-28T09:26:18.793Z
---

:::ApiMethodV2
```json
{
  "name": "/consent/{id}/revoke",
  "method": "POST",
  "url": "https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{id}/revoke",
  "description": "Revoke the consent",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "XmVmoSVmfREU0De_lerlc",
        "language": "curl",
        "code": "curl --location --globoff --request POST 'https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{id}/revoke' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json'",
        "customLabel": ""
      },
      {
        "id": "y0-PMlqnbjV9EWdazLpul",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'POST',\n   'url': 'https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{id}/revoke',\n   'headers': {\n      'Accept': 'application/json',\n      'Content-Type': 'application/json'\n   }\n};\nrequest(options, function (error, response) {\n   if (error) throw new Error(error);\n   console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "OiCnkcvveOENAzJSkFYG3",
        "language": "javascript",
        "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{id}/revoke\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "wNSL0g7PuGhQVwn6xA6Ya",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{id}/revoke\"\n\npayload = {}\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n",
        "customLabel": ""
      },
      {
        "id": "muffwltbqKso7claqZJCR",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{id}/revoke\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "XmVmoSVmfREU0De_lerlc"
  },
  "results": {
    "languages": [
      {
        "id": "pXcRL2H-LcSn7YastN6Ac",
        "language": "204",
        "code": "",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "pXcRL2H-LcSn7YastN6Ac"
  },
  "request": {
    "pathParameters": [
      {
        "name": "id",
        "kind": "required",
        "type": "string",
        "description": "pattern: ^urn:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,31}:[a-zA-Z0-9()+,\\-.:=@;$_!*'%\\/?#]+$\nmaxLength: 256\nConsent Id",
        "": "pattern: ^urn:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,31}:[a-zA-Z0-9()+,\\-.:=@;$_!*'%\\/?#]+$\nmaxLength: 256\nConsent Id"
      }
    ],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "Authorization",
        "kind": "required",
        "type": "string",
        "description": "JWT bearer token",
        "": "JWT bearer token"
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Path Parameter",
    "value": "pathParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "consentidrevoke",
  "legacyHash": "nEqlOZhfvYifb7q9FrOMS"
}
```
:::



