Segments
Use the Segments API to fetch saved audience segments from your Bento account. This is useful when you want to inspect available segments, sync them into your own tooling, or fetch a segment's saved query before using it elsewhere.
Available Endpoints
| Method | Endpoint | Name |
|---|---|---|
| GET | /fetch/segments | Get Segments |
| GET | /fetch/segments/:id | Get Segment |
The Segment Model
A segment is a saved audience definition based on Bento filters and events. The API returns the saved segment metadata along with the underlying visitor_event_query JSON used to define the segment.
Properties
- Name
id- Type
- string
- Description
The segment identifier.
- Name
name- Type
- string
- Description
The segment name.
- Name
description- Type
- string
- Description
Optional description for the segment.
- Name
visitor_event_query- Type
- object
- Description
The saved query definition for the segment.
- Name
created_at- Type
- datetime
- Description
When the segment was created.
- Name
updated_at- Type
- datetime
- Description
When the segment was last updated.
Get Segments
Returns all saved segments in your account, ordered by name.
Response
Returns a list of segment objects.
Get Segment
Returns one saved segment by id.
Required Attributes
- Name
id- Type
- string
- Description
The segment id to fetch.
Response
Returns the segment details, including its saved visitor_event_query.
