segments

Create a segment

Creates a new segment in the active project. Segment names are unique per project and case-insensitive.

post/api/v1/segments

Request

  • Base URL: https://pineprompt.com
  • URL: https://pineprompt.com/api/v1/segments
  • Auth: HTTP bearer

Headers

Pineprompt-Project-Idinteger required

The active project's numeric ID.

Request body

namestring required

A label for the segment. May be up to <strong>64</strong> characters. Segment names are unique per project and case-insensitive, so Direct Competitors and direct competitors will collide.

Example request

{
  "name": "Enterprise Competitors"
}

Response

Created

idinteger

The unique ID of the segment.

project_idinteger

The ID of the project this segment belongs to.

namestring

The display label of the segment.

created_atstring date-time

When the segment was created.

updated_atstring date-time

When the segment was last updated.

Example response

{
  "id": 7,
  "project_id": 42,
  "name": "Direct Competitors",
  "project": {
    "id": 42,
    "organization_id": 7,
    "name": "Acme Marketing",
    "brand_id": 555,
    "organization": {
      "id": 7,
      "name": "Acme Inc.",
      "created_at": "2026-05-15T09:11:42+00:00",
      "updated_at": "2026-05-15T09:11:42+00:00"
    },
    "created_at": "2026-05-15T09:11:42+00:00",
    "updated_at": "2026-05-15T09:11:42+00:00"
  },
  "created_at": "2026-05-18T09:11:42+00:00",
  "updated_at": "2026-05-18T09:11:42+00:00"
}

Changes

No recorded changes to this operation across all 1 revision of this API.