---
title: "Update Label"
url: "https://docs.yoagent.dev/reference/rest-api/operations/updatelabel"
---

# Update Label

PATCH

/v0/labels/{label_id}

```sh
curl -s -X PATCH "https://api.yoagent.dev/v0/labels/lbl_01je56wqswfmn9pgbc1wq8tjgq" \
  -H "Authorization: Bearer $YOAGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"verified"}'
```

```js
const response = await fetch("https://api.yoagent.dev/v0/labels/lbl_01je56wqswfmn9pgbc1wq8tjgq", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.YOAGENT_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "verified"
  }),
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
```

```python
import os

import requests

response = requests.patch(
    "https://api.yoagent.dev/v0/labels/lbl_01je56wqswfmn9pgbc1wq8tjgq",
    headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"},
    json={
        "name": "verified",
    },
    timeout=60,
)
response.raise_for_status()
data = response.json()
```

- api.yoagent.dev/v0/labels/{label_id}

Rename a label: every message and thread of its project that carries it carries the new name; a name another label of the project has is 409.

## Authorizations

- **[ApiKey](https://docs.yoagent.dev/reference/rest-api#apikey)**

## Parameters

### Path Parameters

**label_id**

required

_Label Id_

string

/^lbl\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

## Request Body required

application/json

_LabelUpdate_

Rename a label: every message and thread of its project that carries it carries the new name.

object

**name**

required

_Name_

The label’s new name.

string

\>= 1 characters <= 64 characters /^\[\w.:-]+$/

## Responses

### 200

Successful Response

application/json

_LabelOut_

A project’s own label.

object

**version**

required

_Version_

Goes up by one on every change: of two copies, the one with the higher version is the newer.

integer

**label_id**

required

_Label Id_

string

/^lbl\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**project_id**

required

_Project Id_

string

/^prj\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**name**

required

_Name_

string

#### Example

```json
{
  "version": 1,
  "label_id": "lbl_01je56wqswfmn9pgbc1wq8tjgq",
  "project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq",
  "name": "verified"
}
```

### default

An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: [Errors](https://docs.yoagent.dev/reference/conventions#errors).
