Skip to content

This page is available as Markdown at https://developers.klaviyo.com/en/reference/query_proximity_segment_definition_beta.md. Its OpenAPI document is at https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15.pre/openapi/beta/apis/query_proximity_segment_definition_beta.json. An index of every page is at https://developers.klaviyo.com/llms.txt.

KlaviyoKlaviyoDevelopers
v2026-10-15

This endpoint is in beta. Call it with the revision header 2026-10-15.pre. Beta endpoints may change before they're generally available. See our versioning and deprecation policy for more information.

Create Proximity Segment Definition

POSThttps://a.klaviyo.com/api/proximity-segment-definitions

Build a segment definition that targets profiles near a location.

Nothing is created or stored. Pass the returned name and definition to POST /api/segments, then link the result with POST /api/locations/{id}/relationships/segments.

The definition matches on the location's postal code and country, so a location missing either cannot produce one.

Revision header
revision: 2026-10-15.prerequired
Scopes
locations:readsegments:read
Rate limits
Burst: 10/sSteady: 150/m

Query parameters

  • fields[proximity-segment-definition]#string[]

    For more information please visit API overview

    Allowed values:
    • definition
    • id
    • name

Headers

  • revision#stringrequired

    API endpoint revision (format: YYYY-MM-DD[.suffix])

    2026-10-15.pre

Request body

Content type: application/vnd.api+jsonrequired

  • data#objectrequired
    Show 3 fields
    • type#stringrequired
      Allowed values:
      • proximity-segment-definition
    • attributes#objectrequired
      Show 2 fields
      • radius#number

        Distance from the location that profiles must be within, in unit.

        Default: 30

        Example: 30

      • unit#string

        Unit radius is measured in.

        Allowed values:
        • miles
        • kilometers

        Default: miles

        Example: miles

    • relationships#objectrequired
      Show 1 field
      • location#objectrequired
        Show 1 field
        • data#objectrequired
          Show 2 fields
          • type#stringrequired
            Allowed values:
            • location
          • id#stringrequired

            Identifier of the location to seed the definition from.

            Example: 01HQ8V5X9K2M4N6P8R0T2W4Y6A

Responses

200Success

Content type: application/vnd.api+json

  • data#objectrequired
    Show 4 fields
    • type#stringrequired
      Allowed values:
      • proximity-segment-definition
    • id#stringrequired

      Identifier of the location this definition was seeded from.

      Example: 01HQ8V5X9K2M4N6P8R0T2W4Y6A

    • attributes#objectrequired
      Show 2 fields
      • name#stringrequired

        Suggested segment name, taken from the location's name.

        Example: Klaviyo Boston

      • definition#objectrequired

        The segment's conditions, in the same format the segments API uses. Pass this back unchanged when creating a segment through POST /api/segments.

4XXClient Error

Content type: application/vnd.api+json

  • errors#object[]required
    Show 5 fields
    • id#stringrequired
    • code#stringrequired
    • title#stringrequired
    • detail#stringrequired
    • source#object
      Show 2 fields
      • pointer#string
      • parameter#string

5XXServer Error

Content type: application/vnd.api+json

  • errors#object[]required
    Show 5 fields
    • id#stringrequired
    • code#stringrequired
    • title#stringrequired
    • detail#stringrequired
    • source#object
      Show 2 fields
      • pointer#string
      • parameter#string