Managing user data deletion requests for an OAuth integration backed by key-value storage requires clear boundaries between what your application controls and what belongs to the external provider. When a user or platform requests data removal, developers must coordinate local record purging, upstream token revocation, and idempotent handling of repeated requests. Treating these steps as distinct operations prevents half-finished cleanups and ensures credentials are never leaked through improper logging.
Quick solution: Remove the stored token from your key-value store using the deletion endpoint, then call the authorization server revocation endpoint.
curl -X DELETE "https://api.cloudflare.com/client/v4/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/values/{key_name}" \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN "
Enter fullscreen mode
Exit fullscreen mode
Prerequisites include a valid namespace identifier, a scoped API token with write permissions, and the specific user key associated…