---
title: "Delete a segment"
method: DELETE
path: "/api/v1/segments/{segment}"
tags: ["segments"]
---

# Delete a segment

`DELETE /api/v1/segments/{segment}`

## Request

- Base URL: `https://pineprompt.com`
- URL: `https://pineprompt.com/api/v1/segments/{segment}`
- Auth: HTTP bearer

Deletes a segment. Every brand-segment attachment is removed at the same time; the brands themselves are left untouched, although a brand whose only segment this was derives back to `discovered`. A project must keep at least one segment, so attempting to delete the last one will return `422`.

## Path parameters

- `segment` integer, required

## Headers

- `Pineprompt-Project-Id` integer, required

## Response `204`

No Content

## Other responses

- `400`: Missing project header
- `401`: Unauthorized
- `403`: Missing ability
- `404`: Not found

---

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