Endpoint
Authentication
Requires a developer API key in theAuthorization header.
Request Headers
| Header | Value |
|---|---|
Authorization | Bearer <api_key> |
Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
recordId | string | Yes | The consent record ID to withdraw |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
reason | string | Yes | Reason for consent withdrawal |
revokeGrant | boolean | No | If true, revokes the underlying Grantex grant |
deleteProcessedData | boolean | No | If true, anonymizes audit entries related to this consent (DPDP Section 6(6), GDPR Article 17) |
Example Request
Response — 200 OK
Response Fields
| Field | Type | Description |
|---|---|---|
recordId | string | The consent record ID |
status | string | Updated status: withdrawn |
withdrawnAt | string | ISO-8601 timestamp of withdrawal |
grantRevoked | boolean | Whether the underlying grant was revoked |
dataDeleted | boolean | Whether processed data was anonymized |
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Missing reason field |
| 401 | UNAUTHORIZED | Invalid or missing API key |
| 404 | NOT_FOUND | Consent record not found |
| 409 | ALREADY_WITHDRAWN | Consent has already been withdrawn |