---
title: "Anonymize users"
method: PUT
path: "/api/v2/anonymize_users"
tags: ["Users"]
---

# Anonymize users

`PUT /api/v2/anonymize_users`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/anonymize_users`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `user_access_manage`

Anonymize a list of users, removing their personal data. This operation is irreversible.
Requires the `user_access_manage` permission.

## Request body

- AnonymizeUsersRequest: Request body for anonymizing users.
  - `data` AnonymizeUsersRequestData, required: Object to anonymize a list of users.
    - `attributes` AnonymizeUsersRequestAttributes, required: Attributes of an anonymize users request.
      - `user_ids` string[], required: List of user IDs (UUIDs) to anonymize.
    - `id` string: Unique identifier for the request. Not used server-side.
    - `type` 'anonymize_users_request', required: Type of the anonymize users request.

## Response `200`

OK

- AnonymizeUsersResponse: Response containing the result of an anonymize users request.
  - `data` AnonymizeUsersResponseData: Response data for anonymizing users.
    - `attributes` AnonymizeUsersResponseAttributes: Attributes of an anonymize users response.
      - `anonymize_errors` AnonymizeUserError[], required: List of errors encountered during anonymization, one entry per failed user.
        - `error` string, required: Error message describing why anonymization failed.
        - `user_id` string, required: UUID of the user that failed to be anonymized.
      - `anonymized_user_ids` string[], required: List of user IDs (UUIDs) that were successfully anonymized.
    - `id` string: Unique identifier of the response.
    - `type` 'anonymize_users_response': Type of the anonymize users response.

## Other responses

- `400`: Bad Request
- `403`: Authentication error
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
