---
title: "Get Segment"
method: GET
path: "/segment/{segment_id}"
tags: ["segment"]
---

# Get Segment

`GET /segment/{segment_id}`

Get segment

## Path parameters

- `segment_id` string, required

## Response `200`

Successful Response

- Segment
  - `id` string — ID of this object.
  - `_markedForDeletion` boolean — marked if record has been soft-deleted.
  - `created_at` union — datetime object representing when this object was created.
    - string, date-time
    - object
  - `updated_at` union — datetime object representing when this object was updated.
    - string, date-time
    - object
  - `name` string, required — The name of the segment.
  - `description` string — description of the segment.
  - `owner` string, required — The owner of the segment.
  - `teamId` string, required — The team ID associated with the segment.
  - `projectId` string, required — The ID of the project associated with the segment.
  - `chatRecordId` string, nullable — The ID of the chat record associated with the segment.
  - `state` 'PENDING' | 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED' | 'UNKNOWN_TIMEOUT' — Celery task status enum. Update apps/web-backend-api/src/types/TaskStatusEnum.ts if you update this enum.
  - `segmentSql` string, required — The SQL query defining the segment.
  - `region` string, required — The region for which the segment was built.
  - `wave` string, required — The wave for which the segment was built.
  - `defaultCompareSegmentId` string, required — The default compare segment ID.
  - `saved_to_db` boolean, required — Whether the segment is saved to the database.
  - `llm_generated` boolean — Whether the segment was generated by LLM.
  - `isGlobalSegment` boolean — Whether the segment is global or pre-generated.
  - `isSavedByUser` boolean — Whether the segment was saved by the user.
  - `segmentInsights` object — Insights related to the segment.
  - `bannerImagePath` string — storage path for the segment banner.
  - `data` unknown[] — The data for the segment.
    - unknown
  - `sources` unknown[], required — The source tables used for the segment.
    - unknown
  - `comment` union — details on failure.
    - string
    - object
  - `imported` boolean — Whether the segment was imported.
  - `num_rows` integer — The number of rows in the segment.
  - `last_refreshed` string, date-time, nullable — datetime object representing when this segment was last refreshed.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/akk/apis/fastapi.md) · [All operations](https://skmtc.net/akk/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/akk/fastapi/revisions/6662a407c637/schema)
