---
updatedAt: 2026-11-12T11:23:02.000Z
agentTools:
  projectIndex: https://docs.decentro.tech/llms.txt
---

# Revoke Token

> 🙌 Important Note
>
> Please use only **Staging Credentials** on each API Reference page to test the APIs directly from our Documentation.

### API Endpoints

| Environment       | Endpoint                                                                                   |
| :---------------- | :----------------------------------------------------------------------------------------- |
| Staging / Sandbox | <https://in.staging.decentro.tech/v2/kyc/sso/digilocker/session/{initial_decentro_txn_id}> |
| Production        | <https://in.decentro.tech/v2/kyc/sso/digilocker/session/{initial_decentro_txn_id}>         |

> 📘 About `initial_decentro_txn_id` Path Parameter
>
> The `initial_decentro_txn_id` path parameter should contain the decentroTxnId returned by the SSO DigiLocker Initiate Session API. Pass this transaction ID in the URL when calling this API.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "decentro-staging",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://in.staging.decentro.tech"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/v2/kyc/sso/digilocker/session/{initial_decentro_txn_id}": {
      "delete": {
        "summary": "Revoke Token",
        "description": "",
        "operationId": "kyc_api-sso-digilocker-revoke-token",
        "parameters": [
          {
            "name": "initial_decentro_txn_id",
            "in": "path",
            "description": "decentroTxnId value received in the Initiate Session API",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "client_id",
            "in": "header",
            "description": "ID/identifier that is provided by Decentro to a specific client and environment. Please note, this may change based on the environment you are on.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_secret",
            "in": "header",
            "description": "The confidential credential provided by Decentro that is associated with the client_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "consent",
                  "purpose",
                  "reference_id"
                ],
                "properties": {
                  "consent": {
                    "type": "boolean",
                    "description": "true/false based on the consent given by the customer. Mandatory as per regulation.",
                    "default": false
                  },
                  "purpose": {
                    "type": "string",
                    "description": "The purpose of taking this consent from your customer. Mandatory as per regulation. (>20 characters)"
                  },
                  "reference_id": {
                    "type": "string",
                    "description": "Any unique ID assigned by you for this API request."
                  }
                }
              },
              "examples": {
                "Success": {
                  "value": {
                    "consent": true,
                    "purpose": "To revoke DigiLocker Access Token",
                    "reference_id": "ABCDEF12345"
                  }
                },
                "Failure: False Consent": {
                  "value": {
                    "consent": false,
                    "purpose": "To revoke DigiLocker Access Token",
                    "reference_id": "ABCDEF12345"
                  }
                },
                "Failure: Short Purpose": {
                  "value": {
                    "consent": true,
                    "purpose": "Short Purpose",
                    "reference_id": "ABCDEF12345"
                  }
                },
                "Failure: Long Purpose": {
                  "value": {
                    "consent": true,
                    "purpose": "This is an example of a long purpose for this request",
                    "reference_id": "ABCDEF12345"
                  }
                },
                "Failure: Empty Reference ID": {
                  "value": {
                    "consent": true,
                    "purpose": "To revoke DigiLocker Access Token",
                    "reference_id": ""
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": "{\n    \"decentroTxnId\": \"DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"status\": \"SUCCESS\",\n    \"responseCode\": \"S00007\",\n    \"message\": \"Token has been revoked successfully for the session\",\n    \"data\": {\n        \"revoked\": true\n    },\n    \"responseKey\": \"success_revoke_token\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "decentroTxnId": {
                      "type": "string",
                      "example": "DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                    },
                    "status": {
                      "type": "string",
                      "example": "SUCCESS"
                    },
                    "responseCode": {
                      "type": "string",
                      "example": "S00007"
                    },
                    "message": {
                      "type": "string",
                      "example": "Token has been revoked successfully for the session"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "revoked": {
                          "type": "boolean",
                          "example": true,
                          "default": true
                        }
                      }
                    },
                    "responseKey": {
                      "type": "string",
                      "example": "success_revoke_token"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Failure: False Consent": {
                    "value": "{\n    \"decentroTxnId\": \"DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"status\": \"FAILURE\",\n    \"responseCode\": \"E00009\",\n    \"message\": \"Consent should be True, otherwise the request cannot be processed\",\n    \"responseKey\": \"error_consent_false\"\n}"
                  },
                  "Failure: Short Purpose": {
                    "value": "{\n    \"decentroTxnId\": \"DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"status\": \"FAILURE\",\n    \"responseCode\": \"E00009\",\n    \"message\": \"Purpose should be at least 20 characters in length.\",\n    \"responseKey\": \"error_short_purpose_length\"\n}"
                  },
                  "Failure: Long Purpose": {
                    "value": "{\n    \"decentroTxnId\": \"DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"status\": \"FAILURE\",\n    \"responseCode\": \"E00009\",\n    \"message\": \"Purpose can be at most 50 characters in length.\",\n    \"responseKey\": \"error_long_purpose_length\"\n}"
                  },
                  "Failure: Empty Reference ID": {
                    "value": "{\n    \"decentroTxnId\": \"DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"status\": \"FAILURE\",\n    \"responseCode\": \"E00009\",\n    \"message\": \"Request reference ID cannot be null or empty. Hint: reference_id (string)\",\n    \"responseKey\": \"error_empty_reference_id\"\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "Failure: False Consent",
                      "type": "object",
                      "properties": {
                        "decentroTxnId": {
                          "type": "string",
                          "example": "DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                        },
                        "status": {
                          "type": "string",
                          "example": "FAILURE"
                        },
                        "responseCode": {
                          "type": "string",
                          "example": "E00009"
                        },
                        "message": {
                          "type": "string",
                          "example": "Consent should be True, otherwise the request cannot be processed"
                        },
                        "responseKey": {
                          "type": "string",
                          "example": "error_consent_false"
                        }
                      }
                    },
                    {
                      "title": "Failure: Short Purpose",
                      "type": "object",
                      "properties": {
                        "decentroTxnId": {
                          "type": "string",
                          "example": "DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                        },
                        "status": {
                          "type": "string",
                          "example": "FAILURE"
                        },
                        "responseCode": {
                          "type": "string",
                          "example": "E00009"
                        },
                        "message": {
                          "type": "string",
                          "example": "Purpose should be at least 20 characters in length."
                        },
                        "responseKey": {
                          "type": "string",
                          "example": "error_short_purpose_length"
                        }
                      }
                    },
                    {
                      "title": "Failure: Long Purpose",
                      "type": "object",
                      "properties": {
                        "decentroTxnId": {
                          "type": "string",
                          "example": "DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                        },
                        "status": {
                          "type": "string",
                          "example": "FAILURE"
                        },
                        "responseCode": {
                          "type": "string",
                          "example": "E00009"
                        },
                        "message": {
                          "type": "string",
                          "example": "Purpose can be at most 50 characters in length."
                        },
                        "responseKey": {
                          "type": "string",
                          "example": "error_long_purpose_length"
                        }
                      }
                    },
                    {
                      "title": "Failure: Empty Reference ID",
                      "type": "object",
                      "properties": {
                        "decentroTxnId": {
                          "type": "string",
                          "example": "DXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
                        },
                        "status": {
                          "type": "string",
                          "example": "FAILURE"
                        },
                        "responseCode": {
                          "type": "string",
                          "example": "E00009"
                        },
                        "message": {
                          "type": "string",
                          "example": "Request reference ID cannot be null or empty. Hint: reference_id (string)"
                        },
                        "responseKey": {
                          "type": "string",
                          "example": "error_empty_reference_id"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```