> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/setup-and-monitor/collect-and-manage-your-data/import-data-in-batch/import-identifiers.md).

# Import identifiers

Mark user identifiers for deletion in bulk, without deleting the UserPoint.

## Your goal

Remove identifiers from the platform in bulk - account IDs, email hashes, device identifiers - for instance to honour opt-outs or to clean up identifiers you should no longer hold.

## Expected outcome

The identifiers in your file are marked for deletion, and the UserPoints they were attached to remain.

{% hint style="warning" %}
This import **only deletes the user identifier, not the associated UserPoint.** To remove a UserPoint and its content, see [Delete user data](/setup-and-monitor/collect-and-manage-your-data/clean-and-delete-data/delete-user-data.md).

It is only supported for datamarts using a UserPoint system version of `v201901` or later.
{% endhint %}

## How to

{% stepper %}
{% step %}

### Create the document import

Document type `USER_IDENTIFIERS_DELETION`, mime type `APPLICATION_X_NDJSON`. Only `ndjson` is supported.

```bash
curl -X POST \
  https://api.mediarithmics.com/v1/datamarts/<DATAMART_ID>/document_imports \
  -H 'Authorization: <YOUR_API_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
    "document_type": "USER_IDENTIFIERS_DELETION",
    "mime_type": "APPLICATION_X_NDJSON",
    "encoding": "utf-8",
    "name": "<YOUR_DOCUMENT_IMPORT_NAME>"
}'
```

{% endstep %}

{% step %}

### Create an execution with one deletion command per line

Each command is a user account deletion, a user email deletion, or a user agent deletion. Different types can be mixed in the same file.

```bash
curl -X POST \
  https://api.mediarithmics.com/v1/datamarts/<DATAMART_ID>/document_imports/<DOCUMENT_IMPORT_ID>/executions \
  -H 'Authorization: <API_TOKEN>' \
  -H 'Content-Type: application/x-ndjson' \
  -d '
    { "type": "USER_ACCOUNT", "compartment_id": "1000", "user_account_id": "8541254132" }
    { "type": "USER_EMAIL", "hash": "<EMAIL_HASH>" }
    { "type": "USER_AGENT", "user_agent_id": "vec:89998434" }
  '
```

{% endstep %}

{% step %}

### Read the result

Check `total_success`, `total_failure`, and the error file. See [reading the result](/setup-and-monitor/collect-and-manage-your-data/import-data-in-batch.md#reading-the-result).
{% endstep %}
{% endstepper %}

## The deletion commands

{% tabs %}
{% tab title="User account" %}

| Field             | Type             | Description                                     |
| ----------------- | ---------------- | ----------------------------------------------- |
| `type`            | String           | `USER_ACCOUNT`                                  |
| `user_account_id` | String           | The user account ID.                            |
| `compartment_id`  | Number, optional | The compartment associated with the account ID. |

```json
{
  "type": "USER_ACCOUNT",
  "compartment_id": "1000",
  "user_account_id": "8541254132"
}
```

{% endtab %}

{% tab title="User email" %}

| Field  | Type   | Description                    |
| ------ | ------ | ------------------------------ |
| `type` | String | `USER_EMAIL`                   |
| `hash` | String | The hash of the email address. |

```json
{
  "type": "USER_EMAIL",
  "hash": "<EMAIL_HASH>"
}
```

{% endtab %}

{% tab title="User agent" %}

| Field           | Type   | Description                                                                                   |
| --------------- | ------ | --------------------------------------------------------------------------------------------- |
| `type`          | String | `USER_AGENT`                                                                                  |
| `user_agent_id` | String | A user agent ID **other than a device point ID** - for example `vec:123456` or `net:9:12345`. |

```json
{ "type": "USER_AGENT", "user_agent_id": "vec:89998434" }
```

{% hint style="danger" %}
Device point IDs - `udp:123456` - are **not supported** by this import and will cause the job to be **rejected**.

To delete device points along with all their associated technical IDs, use the device points deletion job instead. See [Delete user data](/setup-and-monitor/collect-and-manage-your-data/clean-and-delete-data/delete-user-data.md).
{% endhint %}
{% endtab %}
{% endtabs %}

{% hint style="success" %}
Different identifier types can be removed in the same file. The data is `ndjson`, so deletions are separated by `\n`, not by commas.
{% endhint %}

## What deleting an identifier does not do

Worth being explicit, because it is a common misunderstanding:

| It removes            | It does not remove                                                |
| --------------------- | ----------------------------------------------------------------- |
| The identifier itself | The UserPoint                                                     |
|                       | The activities, profiles, and segments attached to that UserPoint |

If a UserPoint ends up with no activity, no profile, and no `USER_LIST` segment, it is removed from the platform - but that is the effect of [cleaning rules](/setup-and-monitor/collect-and-manage-your-data/clean-and-delete-data/cleaning-rules.md), not of this import.

## Verify

* The execution reports the expected success count.
* A lookup on a deleted identifier no longer resolves to a UserPoint.
* The UserPoint itself still exists, with its remaining identifiers.

## Related pages

<table data-view="cards" data-search="false"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Delete user data</strong></td><td>Removing UserPoints and device points.</td><td><a href="/setup-and-monitor/collect-and-manage-your-data/clean-and-delete-data/delete-user-data.md">Delete user data</a></td></tr><tr><td><strong>Exercise rights of the user</strong></td><td>The compliance job this import serves.</td><td><a href="/setup-and-monitor/ensure-privacy-and-compliance/exercise-rights-of-the-user.md">Exercise rights of the user</a></td></tr><tr><td><strong>Enrich users with identifiers</strong></td><td>The opposite operation - declaring associations.</td><td><a href="/setup-and-monitor/collect-and-manage-your-data/import-data-in-batch/enrich-users-with-identifiers.md">Enrich users with identifiers</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/setup-and-monitor/collect-and-manage-your-data/import-data-in-batch/import-identifiers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
