---
title: "Rename a segment"
method: PATCH
path: "/segments/{id}"
tags: ["Segments"]
---

# Rename a segment

`PATCH /segments/{id}`

## Request

- Base URL: `https://api.commonroom.io/api/v2`
- URL: `https://api.commonroom.io/api/v2/segments/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/commonroom/apis/common-room-api-v2/docs/segments/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update the name of an existing segment without changing its ID, entity type, or memberships.

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string, required

## Response `200`

Segment renamed

- UpdateObjectResponse
  - `success` true, required
  - `data` object, required
    - `id` string, required
    - `name` string, required

## Other responses

- `400`: Invalid segment ID or name
- `403`: Forbidden
- `404`: Segment not found
- `409`: A segment with the requested name already exists
- `429`: Rate Limited

---

[API](https://skmtc.dev/commonroom/apis/common-room-api-v2.md) - [All operations](https://skmtc.dev/commonroom/apis/common-room-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/commonroom/apis/common-room-api-v2/revisions/865d4d43dadf?raw)
