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

# Rename a segment

`PATCH /api/v1/segments/{id}`

## Request

- Base URL: `https://app.convertflow.co`
- URL: `https://app.convertflow.co/api/v1/segments/{id}`
- Auth: HTTP bearer

Renames the segment. Nothing else on the segment changes and the website script is not republished (the name is a label, never part of targeting). Requires segments:write.

## Request body

- object
  - `name` string, required: New segment name

## Response `200`

segment renamed without republishing

- object
  - `id` integer
  - `name` string
  - `website_id` integer
  - `conditions` object[]
    - `id` integer
    - `condition_type` string
    - `operator` string
    - `keyword` string
    - `country` unknown
    - `url` unknown
    - `count` integer
    - `condition_cta` integer
    - `tag_id` unknown
    - `data` object
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `403`: token lacks the segments:write scope
- `404`: segment belongs to another website
- `422`: blank name refused

---

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