---
title: "Creates or updates metadata of a sensor rule"
method: PUT
path: "/metadata/v2/sensorRules/{sensorRuleId}"
tags: ["Metadata"]
---

# Creates or updates metadata of a sensor rule

`PUT /metadata/v2/sensorRules/{sensorRuleId}`

Updates the metadata object of the sensor rule identified by the `sensorRuleId`. 
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, uuid, required — Sensor rule ID

## 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)
