# Device points deletion

This document import allows you to mark device points for deletion.

Each line in the document is a user agent identifier that is linked to a device point (or is a device point id directly). For each of those identifiers, the job will find its associated device point and delete it. Note that a device point may be linked to multiple user agent identifiers, all of which will be deleted once their device point is (including user agent identifiers that may not appear in your document).

{% hint style="info" %}
This is only supported for datamarts using a UserPoint system version of `v202205` or later.&#x20;

**It only deletes the device point and its identifiers but not the associated UserPoint.**
{% endhint %}

## How-to

1. Use the [bulk import ](https://developer.mediarithmics.io/data-streams/data-ingestion/bulk-processing)endpoints to create a [document import](https://developer.mediarithmics.io/data-streams/data-ingestion/bulk-processing/..#document-import) with the `USER_DEVICE_POINTS_DELETION` document type and `APPLICATION_X_NDJSON` mime type. Only `ndjson` data is supported.
2. Create an[ execution ](https://developer.mediarithmics.io/data-streams/data-ingestion/bulk-processing/..#create-an-execution)with your commands formatted in `ndjson`. Each line represents a user agent.

### Example

```
# Create the document import
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_DEVICE_POINT_DELETION",
	"mime_type": "APPLICATION_X_NDJSON",
	"encoding": "utf-8",
	"name": "<YOUR_DOCUMENT_IMPORT_NAME>"
}'
```

```
# Create the execution
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_AGENT", "user_agent_id": "vec:89998434" }
    { "type": "USER_AGENT", "user_agent_id": "udp:987654" }
  '
```

Please note that the uploaded data is in `ndjson` and not `json`. That means the different deletions are not separated by commas, but by a line separator.

A list of possible `user_agent_id` values can be found at [#user\_agent\_id](https://developer.mediarithmics.io/user-points/user-identifiers/userdevicetechnicalid#user_agent_id "mention")

{% hint style="info" %}
If you want to pass device point ids directly ("udp:987654") you must do so using the `USER_AGENT` type.
{% endhint %}
