Delete a Consent Reference as an Administrator
You can delete the end user's consent to collect and store any data associated with their activity, and represented by a specified consent reference.
Prerequisites
Before starting this tutorial, you must have:
-
Access to the Consent Service API Console

-
Access to the Consent Service API Console

-
Access to the Consent Service API console: https://{tenant}.iss.commerce.eu.context.cloud.sap/consent/ where {tenant} is a placeholder for your tenant name.
-
Access to the Consent Service API console: https://{tenant}.iss.commerce.us.context.cloud.sap/consent/ where {tenant} is a placeholder for your tenant name.
-
A valid bearer access token for a client with the Commerce Cloud integration client, Generic integration client, or Admin client role. For more information about how to get an access token, see Create an Access Token.
-
A valid bearer access token. For more information about how to get an access token, see .
-
A valid consent reference. For more information, see the Consent Service documentation.
Context
This way of deleting the consent reference is intended for authenticated parties, such as administrators. Using the request provided below, you can remove any consent reference, even if the consent reference token is not available.
Procedure
curl -X DELETE \
-H "Authorization: Bearer access_token" \
'https://{tenant}-{site}.api.eu.context.cloud.sap/consent/{tenant}/consents/{consentReference}' -i
curl -X DELETE \
-H "Authorization: Bearer access_token" \
'https://{tenant}-{site}.api.us.context.cloud.sap/consent/{tenant}/consents/{consentReference}' -i
curl -X DELETE \
-H "Authorization: Bearer access_token" \
'https://{tenant}.iss.commerce.eu.context.cloud.sap/consent/v1/sites/{site}/consents/{consentReference}' -i
curl -X DELETE \
-H "Authorization: Bearer access_token" \
'https://{tenant}.iss.commerce.us.context.cloud.sap/consent/v1/sites/{site}/consents/{consentReference}' -i
-
Headers
-
Authorization: Provide a valid bearer access token.
-
-
URI Parameters
-
{tenant}: Provide your tenant name.
-
{site}: Provide your site identifier.
-
{consentReference}: Provide the consent reference that you want to delete.
-
Sample DELETE Request with Real Data
curl -X DELETE \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHBzOi8vZXhhbXBsZS5hcGkuZXUuY29udGV4dC5jbG91ZC5zYXAvdG9rZW5fa2V5cyIsImtpZCI6InRlbmFudEFjdGl2ZUtleSIsInR5cCI6IkpXVCIgIH0K.eyJqdGkiOiI0NjExNWQ4dTBhYjQ0ZGE4ODZmNzNoY2UyM2Q3NGJlOCIsInN1YiI6ImV4YW1wbGUuYWRtaW4iLCJhdXRob3JpdGllcyI6WyJjZHMucm9sZXMuYWRtaW4iLCJoeWJyaXMudGVuYW50PWV4YW1wbGUiXSwic2NvcGUiOlsiY2RzLnJvbGVzLmFkbWluIiwiaHlicmlzLnRlbmFudD1leGFtcGxlIl0sImNsaWVudF9pZCI6ImV4YW1wbGUuYWRtaW4iLCJjaWQiOiJleGFtcGxlLmFkbWluIiwiYXpwIjoiZXhhbXBsZS5hZG1pbiIsImdyYW50X3R5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJyZXZfc2lnIjoiZjcwNmIyZjMiLCJpYXQiOjE1NTIyOTEzMzcsImV4cCI6MTU1MjI5NDkzNywiaXNzIjoiaHR0cHM6Ly9leGFtcGxlLmFwaS5ldS5jb250ZXh0LmNsb3VkLnNhcC91YWEvb2F1dGgvdG9rZW4iLCJ6aWQiOiJleGFtcGxlIiwiYXVkIjpbImNkcy5yb2xlcyIsImh5YnJpcyIsImV4YW1wbGUuYWRtaW4iXX0K.XNURUAyIGLjXaXxCnkFx772qilGu7lKuMZX8fIB_zhLhap3HxNmtAJAgXwHH_5wnFoqx6pObOqe-b0_NtzrpBX1_fp2po0uzvlzJyty64D9qguyOjNdtvkh0Vom4R-8Q8gyq1ED-k41epN4c_7qgT1mRu1coApda2_nHxJA3z1rjyyVp-F5aY6HKkMaaktKe_vi-mIangksog7dneUaIdxp8crOFcxMoYa89d77M__esvTcRFQ1XhDg5wmL7W52ESVIX3uziUq5w2c1wv9THEBFW_9USsJsyrZuu3IVSFE6WJicMti8TQqlqVbR6Orl274yTqtGkchROg4ptRwChYA" \ 'https://mycomicsshop-electronics.api.eu.context.cloud.sap/consent/mycomicsshop/consents/11a7e44f-9c76-4307-b553-b81b5c855fd5' -i
curl -X DELETE \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHBzOi8vZ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 'https://mycomicsshop-electronics.api.us.context.cloud.sap/consent/mycomicsshop/consents/11a7e44f-9c76-4307-b553-b81b5c855fd5' -i
curl -X DELETE \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHBzOi8vZXhhbXBsZS5hcGkuZXUuY29udGV4dC5jbG91ZC5zYXAvdG9rZW5fa2V5cyIsImtpZCI6InRlbmFudEFjdGl2ZUtleSIsInR5cCI6IkpXVCIgIH0K.eyJqdGkiOiI0NjExNWQ4dTBhYjQ0ZGE4ODZmNzNoY2UyM2Q3NGJlOCIsInN1YiI6ImV4YW1wbGUuYWRtaW4iLCJhdXRob3JpdGllcyI6WyJjZHMucm9sZXMuYWRtaW4iLCJoeWJyaXMudGVuYW50PWV4YW1wbGUiXSwic2NvcGUiOlsiY2RzLnJvbGVzLmFkbWluIiwiaHlicmlzLnRlbmFudD1leGFtcGxlIl0sImNsaWVudF9pZCI6ImV4YW1wbGUuYWRtaW4iLCJjaWQiOiJleGFtcGxlLmFkbWluIiwiYXpwIjoiZXhhbXBsZS5hZG1pbiIsImdyYW50X3R5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJyZXZfc2lnIjoiZjcwNmIyZjMiLCJpYXQiOjE1NTIyOTEzMzcsImV4cCI6MTU1MjI5NDkzNywiaXNzIjoiaHR0cHM6Ly9leGFtcGxlLmFwaS5ldS5jb250ZXh0LmNsb3VkLnNhcC91YWEvb2F1dGgvdG9rZW4iLCJ6aWQiOiJleGFtcGxlIiwiYXVkIjpbImNkcy5yb2xlcyIsImh5YnJpcyIsImV4YW1wbGUuYWRtaW4iXX0K.XNURUAyIGLjXaXxCnkFx772qilGu7lKuMZX8fIB_zhLhap3HxNmtAJAgXwHH_5wnFoqx6pObOqe-b0_NtzrpBX1_fp2po0uzvlzJyty64D9qguyOjNdtvkh0Vom4R-8Q8gyq1ED-k41epN4c_7qgT1mRu1coApda2_nHxJA3z1rjyyVp-F5aY6HKkMaaktKe_vi-mIangksog7dneUaIdxp8crOFcxMoYa89d77M__esvTcRFQ1XhDg5wmL7W52ESVIX3uziUq5w2c1wv9THEBFW_9USsJsyrZuu3IVSFE6WJicMti8TQqlqVbR6Orl274yTqtGkchROg4ptRwChYA" \ 'https://mycomicsshop.iss.commerce.eu.context.cloud.sap/consent/v1/sites/main/consents/11a7e44f-9c76-4307-b553-b81b5c855fd5' -i
curl -X DELETE \ -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHBzOi8vZXhhbXBsZS5hcGkudXMuY29udGV4dC5jbG91ZC5zYXAvdG9rZW5fa2V5cyIsImtpZCI6InRlbmFudEFjdGl2ZUtleSIsInR5cCI6IkpXVCIgIH0K.eyJqdGkiOiJhNzc3NWRlOGYzZDE0YTZjYTM2ODM1YTljZTUxMmY5ZiIsInN1YiI6ImV4YW1wbGUuYWRtaW4iLCJhdXRob3JpdGllcyI6WyJjZHMucm9sZXMuYWRtaW4iLCJoeWJyaXMudGVuYW50PWV4YW1wbGUiXSwic2NvcGUiOlsiY2RzLnJvbGVzLmFkbWluIiwiaHlicmlzLnRlbmFudD1leGFtcGxlIl0sImNsaWVudF9pZCI6ImV4YW1wbGUuYWRtaW4iLCJjaWQiOiJleGFtcGxlLmFkbWluIiwiYXpwIjoiZXhhbXBsZS5hZG1pbiIsImdyYW50X3R5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJyZXZfc2lnIjoiZjcwNmIyZjMiLCJpYXQiOjE1NTIyOTQxNTUsImV4cCI6MTU1MjI5Nzc1NSwiaXNzIjoiaHR0cHM6Ly9leGFtcGxlLmFwaS51cy5jb250ZXh0LmNsb3VkLnNhcC91YWEvb2F1dGgvdG9rZW4iLCJ6aWQiOiJleGFtcGxlIiwiYXVkIjpbImNkcy5yb2xlcyIsImh5YnJpcyIsImV4YW1wbGUuYWRtaW4iXX0K.CpSYYoNZVYFhgxUIHFeQp77r2t0o1syHyKWfMJAErBAScUMN4mMMdTTUCMDJfUxQLG30uC-kUioJf76_ZKIM9z_RLOxxd9TBM0RY-1MoRDe213TQI11gKHlzGfciqfU2FynsV7twV56Z87tkJC4LJgyQFLpBhK1hwsO04K3R7Enea2TaWQCE6e5Z8BpCgC6T4_vtayRHvdPnLR3wZcY_WJOvfMy98ycabRxMvoJaw6HoDDYWc3Yqu9NsYUTw2EvWaQyMmnkh7GfZqUMI59ikt9g5dFRNhCno9KPQBoo2-0XLiWhh1XkRjpxIdiQ-cU90o5L7pbGD8Asf8EWvPg6JwQ" \ 'https://mycomicsshop.iss.commerce.us.context.cloud.sap/consent/v1/sites/main/consents/11a7e44f-9c76-4307-b553-b81b5c855fd5' -i
Response
The response with a status code of 204 indicates that the service deleted a given consent reference.