---
title: "Get Segments for Location"
description: "How to call Get Segments for Location (GET /api/locations/{id}/segments) in the Klaviyo REST API: authentication, parameters, request and response bodies, and an example request."
url: "https://developers.klaviyo.com/en/reference/get_segments_for_location_beta"
revision: "2026-10-15.pre"
operationId: "get_segments_for_location_beta"
aliases: ["get_location_segments"]
method: "GET"
endpoint: "https://a.klaviyo.com/api/locations/{id}/segments"
authentication: "privateKey"
scopes: ["locations:read","segments:read"]
rateLimits: {"burst":"10/s","steady":"150/m"}
revisionHeader: {"name":"revision","required":true}
deprecated: false
preRelease: "BETA"
openApi: "https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15.pre/openapi/beta/apis/get_segments_for_location_beta.json"
jsonApi: {"fields":{"segment":["created","definition","id","linked_at","name","updated"]},"pagination":{"style":"cursor","defaultPageSize":"25"}}
related: ["https://developers.klaviyo.com/en/reference/location-hub-beta/llms.txt","https://developers.klaviyo.com/en/reference/get_locations_beta.md","https://developers.klaviyo.com/en/reference/get_location_beta.md","https://developers.klaviyo.com/en/reference/create_location_beta.md","https://developers.klaviyo.com/en/reference/update_location_beta.md","https://developers.klaviyo.com/en/reference/delete_location_beta.md","https://developers.klaviyo.com/en/reference/get_location_hub_setting_beta.md","https://developers.klaviyo.com/en/reference/update_location_hub_setting_beta.md","https://developers.klaviyo.com/en/reference/query_proximity_segment_definition_beta.md","https://developers.klaviyo.com/en/reference/get_segment_ids_for_location_beta.md","https://developers.klaviyo.com/en/reference/add_segments_to_location_beta.md","https://developers.klaviyo.com/en/reference/remove_segments_from_location_beta.md"]
---

# Get Segments for Location

> This is the Markdown version of https://developers.klaviyo.com/en/reference/get_segments_for_location_beta

```http
GET https://a.klaviyo.com/api/locations/{id}/segments
```


> [!WARNING]
> **This endpoint is in beta and subject to change.**
> A beta revision header (2026-10-15.pre) is required to use our beta APIs. Klaviyo APIs in beta are not intended for use in production. See our [versioning and deprecation policy](https://developers.klaviyo.com/en/docs/api_versioning_and_deprecation_policy.md) for more information.


Get the segments linked to a location.

A segment is linked to at most one physical location, so a location's segments are the ones that target it.

Segment details are read from the segments service and cached for five minutes, so a segment renamed moments ago may still report its old name.

- Revision header: `revision: 2026-10-15.pre` (required)
- Scopes: `locations:read`, `segments:read`
- Rate limits: Burst: `10/s`, Steady: `150/m`
- OpenAPI: [Download this endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15.pre/openapi/beta/apis/get_segments_for_location_beta.json)

## Example request

### curl

```bash
curl --request GET \
     --url 'https://a.klaviyo.com/api/locations/id/segments' \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/vnd.api+json' \
     --header 'revision: 2026-10-15.pre'
```

### CLI

```bash
klaviyo beta location-hub get-segments-for-location id
```

Sign in first with `klaviyo auth login`. [Install the Klaviyo CLI](https://developers.klaviyo.com/en/docs/klaviyo_cli.md)

## Path parameters

- `id` (string, required)

## Query parameters

- `fields[segment]` (string[]): For more information please visit [API overview](https://developers.klaviyo.com/en/reference.md) Allowed values: `created`, `definition`, `id`, `linked_at`, `name`, `updated`
- `page[cursor]` (string): Page cursor
- `page[size]` (integer): Default: 25. Min: 1. Max: 100.

## Headers

- `revision` (string, required): API endpoint revision (format: YYYY-MM-DD[.suffix]) Default: `2026-10-15.pre`

## Responses

### 200: Success

Content type: `application/vnd.api+json`

- `data` (object, required)
  - `type` (string, required): Allowed values: `segment`
  - `id` (string, required): Primary key that uniquely identifies this segment. Example: `01HQ8V5X9K2M4N6P8R0T2W4Y6A`
  - `attributes` (object, required)
    - `name` (string, required): Name of the segment. Example: `Klaviyo Boston - within 10 miles`
    - `definition` (object, nullable): The segment's conditions, in the same format the segments API uses. Pass this back unchanged when creating a segment through `POST /api/segments`.
    - `created` (string<date-time>, nullable): Date and time when the segment was created, in ISO 8601 format. Example: `2022-11-08T00:00:00+00:00`
    - `updated` (string<date-time>, nullable): Date and time when the segment was last updated, in ISO 8601 format. Example: `2022-11-08T00:00:00+00:00`
    - `linked_at` (string<date-time>, nullable): Date and time when this segment was linked to the location, in ISO 8601 format. Example: `2022-11-08T00:00:00+00:00`
  - `links` (object, required)
    - `self` (string<uri>, required)
- `links` (ObjectLinks): Same fields as the first ObjectLinks above.

#### Example response body

```json
{
  "data": {
    "type": "segment",
    "id": "01HQ8V5X9K2M4N6P8R0T2W4Y6A",
    "attributes": {
      "name": "Klaviyo Boston - within 10 miles",
      "definition": {},
      "created": "2022-11-08T00:00:00+00:00",
      "updated": "2022-11-08T00:00:00+00:00",
      "linked_at": "2022-11-08T00:00:00+00:00"
    },
    "links": {
      "self": "https://www.example.com"
    }
  },
  "links": {
    "self": "https://www.example.com"
  }
}
```

### 4XX: Client Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```

### 5XX: Server Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```
