---
title: "Rename or recolor a label"
method: PATCH
path: "/v1/labels/{label}"
tags: ["mail"]
---

# Rename or recolor a label

`PATCH /v1/labels/{label}`

## Request

- Base URL: `https://botmail.pro`
- URL: `https://botmail.pro/v1/labels/{label}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `bm_session`

Scope: send or manage. `name` renames the label on every conversation
this credential can reach (merging into an existing label of that
name); the color moves with it. `color` sets a display color
(`#rrggbb`), or `""` clears it. Renaming a label no conversation has
returns 404 label_not_found.

## Query parameters

- `mailbox_id` string

## Request body

- object
  - `name` string
  - `color` string

## Response `200`

The label after the change.

- object
  - `label` string
  - `color` string
  - `conversations_renamed` integer

## Other responses

- `400`: Invalid request (`bad_request` or a more specific code).
- `403`: The credential can't do this (`forbidden`, `csrf`, `account_inactive`, …). Missing scopes are listed in `details.required_scope`; pending keys get a hint to wait for the claim.
- `404`: Not found or not accessible with this credential.

---

[API](https://skmtc.dev/botmail/apis/botmail-api.md) · [All operations](https://skmtc.dev/botmail/apis/botmail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/botmail/apis/botmail-api/revisions/49f736362bf2?raw)
