In keeping with Segment's commitment to support GDPR and future privacy regulations such as the CCPA, you can delete and suppress data about end users if you identify that user with a userId
, should they revoke or alter their consent to data collection. For instance, if an end user in the EU invokes their Right to Object or Right to Erasure under the GDPR, you can use the following features in Segment to block ongoing data collection about the user, and delete all historical data across Segment’s systems, connected S3 buckets and Warehouses, and supported downstream partners.
Regulations enable you to issue a single request to delete and suppress data about a user by userId
. All regulations are by default scoped to your Workspace and target all Sources within the Workspace. This way, you don't need to page over every Source within Segment to delete data about a user across all your users.
All deletion and suppression actions within Segment are asynchronous, and fall under the umbrella of what Segment calls "Regulations." Regulations are requests to Segment to impart control over your data flow. You can issue these requests with the Segment Public API using the endpoints below.
You can't replay data deleted through Regulations. For standard replay requests, Segment asks that you wait for deletions to complete and not submit any new deletion requests for the period of time that Segment replays data for you.
Deletion and Suppression got an overhaul in the Segment Public API. They’re now divided into Workspace, Source, and Cloud Source-related endpoints. The Public API simplifies these endpoints: the attributes
input field is no longer required, and you can now pass an array of IDs to regulate (instead of a parent
).
Creates a Source-scoped regulation.
Config API omitted fields:
attributes
,userAgent
OK
Resource not found
Validation failure
Too many requests
{- "regulationType": "SUPPRESS_ONLY",
- "subjectType": "OBJECT_ID",
- "subjectIds": [
- "test_object_id"
], - "collection": "some-app-collection"
}
{- "data": {
- "regulateId": "1qJkfE1tpwvQcklImGksLN629wn"
}
}
Creates a Source-scoped regulation.
• When called, this endpoint may generate the Source Regulation Created
event in the audit trail.
Config API omitted fields:
attributes
,userAgent
OK
Resource not found
Validation failure
Too many requests
{- "regulationType": "SUPPRESS_ONLY",
- "subjectType": "USER_ID",
- "subjectIds": [
- "test_user_id_1"
]
}
{- "data": {
- "regulateId": "1qJkfE1tpwvQcklImGksLN629wn"
}
}
Lists all Source-scoped regulations.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.deletionAndSuppression.listRegulationsFromSource('qQEHquLrjRDN9j1ByrChyn')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "regulations": [
- {
- "id": "1qJkfE1tpwvQcklImGksLN629wn",
- "subjectType": "OBJECT_ID",
- "subjects": [
- "test_user_id_1"
], - "regulationType": "SUPPRESS_ONLY",
- "status": "FINISHED",
- "createdAt": "2022-03-08T00:39:36.546951Z"
}
], - "pagination": {
- "current": "MQ=="
}
}
}
Creates a Workspace-scoped regulation.
• When called, this endpoint may generate the Workspace Regulation Created
event in the audit trail.
Config API omitted fields:
attributes
,userAgent
OK
Resource not found
Validation failure
Too many requests
{- "regulationType": "SUPPRESS_ONLY",
- "subjectType": "USER_ID",
- "subjectIds": [
- "test_user_id_1"
]
}
{- "data": {
- "regulateId": "1qJkfE1tpwvQcklImGksLN629wn"
}
}
Lists all Workspace-scoped regulations.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.deletionAndSuppression.listWorkspaceRegulations()) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "regulations": [
- {
- "createdAt": "2022-03-08T00:39:36.546951Z",
- "id": "1qJkfE1tpwvQcklImGksLN629wn",
- "subjects": [
- "test_user_id_1"
], - "subjectType": "OBJECT_ID",
- "status": "FINISHED",
- "regulationType": "SUPPRESS_ONLY"
}
], - "pagination": {
- "current": "MQ=="
}
}
}
Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted.
• When called, this endpoint may generate the Regulation Deleted
event in the audit trail.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.deletionAndSuppression.deleteRegulation('1qJkfE1tpwvQcklImGksLN629wn')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "status": "SUCCESS"
}
}
Gets a regulation from the Workspace.
Config API omitted fields:
parent
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.deletionAndSuppression.getRegulation('1qJkfE1tpwvQcklImGksLN629wn')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "regulation": {
- "id": "1qJkfE1tpwvQcklImGksLN629wn",
- "workspaceId": "9aQ1Lj62S4bomZKLF4DPqW",
- "overallStatus": "FINISHED",
- "finishedAt": "2022-03-08T00:39:36.546951Z",
- "createdAt": "2022-03-08T00:39:36.546951Z",
- "streamStatus": [ ]
}
}
}
Lists all suppressions in a given Workspace.
object (PaginationInput) Pagination parameters. This parameter exists in v1. Example: pagination=pagination.count=5 |
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.deletionAndSuppression.listSuppressions()) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "suppressed": [
- {
- "subjectType": "userId",
- "subjectIds": [
- "1"
]
}
], - "pagination": {
- "current": "MQ==",
- "next": "cmVnLTY1MDgtMDA5ODE="
}
}
}