# Add or update a metadata

This API allows you to add or update specific metadata related to your product (example : price of insurance for the trip) in trip data. This can be done after a successful push trip data to your backend.&#x20;

As these metadata are synchronised in DriveKit SDK database, you can display these datas on your application.

{% hint style="info" %}
If you have your **admin API key**, you can try the API via this [**link**](https://drivequant.stoplight.io/docs/drivequant-public/01fcb906b434a-add-or-update-metadata).
{% endhint %}

## Add or update metadata in trip metadata

<mark style="color:orange;">`PUT`</mark> `https://service.drivequant.com/v3/drivekit/admin/trips/{tripId}/metadata`

#### Headers

| Name                                                     | Type   | Description   |
| -------------------------------------------------------- | ------ | ------------- |
| DriveKit-Admin-API-Key<mark style="color:red;">\*</mark> | String | Admin API Key |

#### Request Body

| Name                                       | Type  | Description                      |
| ------------------------------------------ | ----- | -------------------------------- |
| metaData<mark style="color:red;">\*</mark> | Objet | Key/value pairs in String format |

{% tabs %}
{% tab title="200: OK OK" %}

```javascript
{
    "metaData": {
    "key": "value"
  }
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid data format" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="401: Unauthorized Invalid API Key" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="404: Not Found Trip Not found" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.drivequant.com/backend/trips/add-or-update-a-metadata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
