User Suppression in RudderStack

Detailed technical description of the RudderStack HTTP API for suppressing user data.

RudderStack's User Suppression feature allows you to suppress user data identified by a userId. It will block all the user data on all the sources as well as destinations in the RudderStack workspace.

This guide covers the user suppression feature in detail.

For all the requests mentioned in this guide, we use the basic HTTP authorization.

What is User Suppression?

RudderStack is completely GDPR and CCPA compliant. We respect the users' privacy and are committed to keeping their data secure at all times.

When a user is suppressed, RudderStack will drop the events from that user. Those events will not be shown in any of the debuggers, will not be forwarded to any destinations and will not be backed up.

Please note that once suppressed, replaying of these events will not be possible.

HTTP Authorization

RudderStack uses Basic Authentication for authenticating all the HTTP requests as mentioned below. HTTP Basic Authentication requires a user name and password.

  • workspaceTokenis the user name

  • "" is the password (empty string)

All the popular HTTP clients (e.g. CURL, Postman, HTTPie) have default support for Basic Authentication.

Create a Suppress Regulation

To suppress a given user's data, you will need to create a suppress regulation.

A sample payload looks like the following snippet. You can provide a list of user IDs in the values array, as shown:

Payload

suppress.json
{
"regulation_type": "Suppress",
"attributes": {
"name": "userId",
"values": [
"user-id1",
"user-id2"
]
}
}

Usage

curl
httpie
curl
curl -u <your_workspace_token>: \
-X POST https://api.rudderlabs.com/workspaces/regulations \
-d @suppress.json \
--header "Content-Type: application/json"
httpie
http -a <your_workspace_token>: \
https://api.rudderlabs.com/workspaces/regulations < suppress.json

Get a Regulation

To get a regulation, you can send a GET request as shown:

Pass regulation_id in the URL. The regulation_id is received in the response when a regulation is created.

curl
httpie
curl
curl -u <your_workspace_token>: \
https://api.rudderlabs.com/workspaces/regulations/<regulation_id>
httpie
http -a <your_workspace_token>: \
https://api.rudderlabs.com/workspaces/regulations/<regulation_id>

List All Regulations

To get all the regulations, you can send a GET request as shown:

curl
httpie
curl
curl -u <your_workspace_token>: \
https://api.rudderlabs.com/workspaces/regulations?start=0&limit=10
httpie
http -a <your_workspace_token>: \
https://api.rudderlabs.com/workspaces/regulations?start=0&limit=10

Delete a Regulation

To delete a regulation, you can send a DELETE request as shown below:

Pass the regulation_id in the URL. The regulation_id is received in the response when a regulation is created.

curl
httpie
curl
curl -u <your_workspace_token>: \
-X DELETE https://api.rudderlabs.com/workspaces/regulations/<regulation_id>
httpie
http -a <your_workspace_token>: DELETE \
https://api.rudderlabs.com/workspaces/regulations/<regulation_id>

Create a Suppress Regulation on a Source

You can suppress a user's data on a particular source too. A sample payload is as shown in the snippet below:

You need to pass source_id in the URL. You can provide a list of user ids in the values array.

Payload

suppress.json
{
"regulation_type": "Suppress",
"attributes": {
"name": "userId",
"values": [
"user-id1",
"user-id2"
]
}
}

Usage

curl
httpie
curl
curl -u <your_workspace_token>: \
-X POST https://api.rudderlabs.com/workspaces/sources/<source_id>/regulations \
-d @suppress.json \
--header "Content-Type: application/json"
httpie
http -a <your_workspace_token>: \
https://api.rudderlabs.com/workspaces/sources/<source_id>/regulations < suppress.json

Contact Us

To know more about the HTTP API spec, please feel free to contact us. You can also start a conversation on our Discord channel, and we will be happy to help you.