---
title: "Creates or updates metadata of a device or a shipment"
method: PUT
path: "/metadata/v2/devices/{trackingId}"
tags: ["Metadata"]
---

# Creates or updates metadata of a device or a shipment

`PUT /metadata/v2/devices/{trackingId}`

Updates the metadata object of the device or a shipment identified by the `trackingId` or the `shipmentId`. 
The metadata specified in the request body is merged with the existing metadata object 
(or gets created if no metadata object exists); 
new keys are added, and the values of the existing keys are updated with the new data.
Adding 'null' value for a key deletes it from the metadata object.
Successful response body contains the updated metadata object.

## Request body

- object

## Response `200`

Successful

The metadata was successfully updated.

- object
  - `data` object, required — Metadata JSON object
  - `id` string, required — This is a unique ID associated with the device data in HERE Tracking. For physical devices the `trackingId` gets assigned to a device when the device is claimed by a user, and for virtual devices it is an external device ID along with the device project `appId`. Alternatively, a valid `shipmentId` may be used.

## Other responses

- `400` — Bad request The request object is in an incorrect format or has values that are invalid or out of range. If available, further error details are provided in the response body.
- `401` — Unauthorized The request did not provide correct authentication details
- `403` — Forbidden The account does not have the correct privileges
- `404` — Not Found The specified resource was not found

---

[API](https://skmtc.net/here/apis/tracking.md) · [All operations](https://skmtc.net/here/apis/tracking/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/here/tracking/revisions/efa162f7023c/schema)
