ONLINE
Bento
View markdown
OpenAI
Using Cursor, Claude, or Codex?Copy a ready-made prompt for your AI agent so it can start implementing Bento, fast.
View .md

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

MethodEndpointName
GET/fetch/segmentsGet Segments
GET/fetch/segments/:idGet 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/v1/fetch/segments

Get Segments

Returns all saved segments in your account, ordered by name.



Response

Returns a list of segment objects.


GET/v1/fetch/segments/:id

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.