Skip to main content
PATCH/v1/segments/{segment_id}

Update a segment

Updates segment filters, name, or refresh interval and schedules a recalculation.

Authentication

Requires Authorization: Bearer ${API_KEY}. Create and rotate keys from the TrackLayer dashboard.

Path parameters

NameTypeRequiredDescription
segment_idstringYesSegment identifier.

Request body schema

{
  "name": "string",
  "filters": "object",
  "refresh_interval": "hourly | daily"
}

Response schema · 200

{
  "id": "seg_123",
  "status": "building"
}

Response example

{
  "id": "seg_123",
  "status": "building"
}

Code examples

curl https://api.tracklayer.com/v1/segments/seg_123 \
  -X PATCH \
  -H "Authorization: Bearer ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"event_name":"purchase","user_id":"u_123","properties":{"order_id":"100045","value":129}}'

Try it out

Use the dashboard to create an API key, then run one of the examples above with TRACKLAYER_API_KEY set in your environment.

Open API key settings

We use essential cookies to keep the site secure and functional. Analytics and third-party tags run only with your consent. See our Cookie Policy.

We use essential cookies to keep the site secure and functional. Analytics and third-party tags run only with your consent. See our Cookie Policy.