---
title: "Rename Label Value"
method: POST
path: "/core/label-keys/{key_id}/rename-value"
tags: ["Labels"]
---

# Rename Label Value

`POST /core/label-keys/{key_id}/rename-value`

## Request

- Base URL: `https://api.anyreach.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.anyreach.ai/core/label-keys/{key_id}/rename-value`
- Auth: HTTP bearer

Rename a value (or remove it, with `to: null`) on the key, every agent
and workflow holding it, and every saved view filtering on it. Renaming
onto a value that already exists merges the two.

## Path parameters

- `key_id` string, uuid, required

## Headers

- `x-anyreach-org` string, nullable: Organization ID for user PATs (pat_ prefix tokens)

## Request body

- LabelRenameRequest
  - `from` string, required: The value to rename, as the values endpoint lists it.
  - `to` string, nullable: The new value, or null to remove the value everywhere.

## Response `200`

Successful Response

- LabelChangeCounts
  - `agents` integer
  - `workflows` integer
  - `saved_views` integer

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anyreach/apis/anyreach-api.md) - [All operations](https://skmtc.dev/anyreach/apis/anyreach-api/llms.txt) - [OpenAPI document](https://skmtc.dev/anyreach/apis/anyreach-api/revisions/2eddf40c8c93?raw)
