Anonymization API - PUT anonymization job

Creates a user session anonymization job. The job anonymizes all user sessions in the specified time frame masking the user ID (userIds) and IP address (ips).

To identify user sessions to be anonymized, you can specify either the user ID, IP address, or both. If you specify both, OR logic applies—every session of the specified user ID(s) gets anonymized, regardless of the IP address it came from; every session from the specified IP address gets anonymized, even if it belongs to a user ID that has not been specified. You can specify multiple user IDs and IP addresses.

Regardless of how you identify user sessions, both the user ID and IP address are masked. You can't undo anonymization.

The request produces an application/json payload. The response body contains the ID of the anonymization job, which you can use to check the job status.

PUT
  • Managed https://{your-domain}/e/{your-environment-id}/api/v1/anonymize/anonymizationJobs
  • SaaS https://{your-environment-id}.live.dexp.ae/api/v1/anonymize/anonymizationJobs

Parameters

Parameter Type Description In Required
startTimestamp integer

The start timestamp of the user session to anonymize, in UTC milliseconds.

If not set the earliest available time is used.

query optional
endTimestamp integer

The end timestamp of the user session to anonymize, in UTC milliseconds.

If not set the current time is used.

query optional
userIds array

The UserID of the user to anonymize.

You can specify several IDs, in the following format: userIds=user1&userIds=user2.

query optional
ips array

The IP address of the user to anonymize. All user sessions from this IP will be anonymized.

You can specify several IPs, in a same way as user IDs.

query optional

Response format

The AnonymizationIdResult object

Element Type Description
requestId string

The ID of the newly created anonymization job.

Example

In this example, the request starts a job to anonymize all sessions of users john.smith and mary.smith in the time frame between 00:00 September 1, 2018 and 23:59 September 10, 2018 (corresponding to the 1535752800000 and 1536616799000 timestamps, respectively).

The API token is passed in the Authorization header.

The response contains the ID of the anonymization job, which can be used to check its status.

Curl

curl -X PUT \
  'https://mySampleEnv.live.dexp.ae/api/v1/anonymize/anonymizationJobs?startTimestamp=1535752800000&endTimestamp=1536616799000&userIds=john.smith&userIds=mary.smith' \
  -H 'Authorization: Api-Token abcdefjhij1234567890'

Request URL

https://mySampleEnv.live.dexp.ae/api/v1/anonymize/anonymizationJobs?startTimestamp=1535752800000&endTimestamp=1536616799000&userIds=john.smith&userIds=mary.smith

Response content

{
  "requestId": "7810238295331327902"
}

Response code

200