# 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 Segments](/docs/segments_api#get-segments)              |
|  |  | [Get Segment](/docs/segments_api#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

    
      - **id** (`string`): 
        The segment identifier.
      
      - **name** (`string`): 
        The segment name.
      
      - **description** (`string`): 
        Optional description for the segment.
      
      - **visitor_event_query** (`object`): 
        The saved query definition for the segment.
      
      - **created_at** (`datetime`): 
        When the segment was created.
      
      - **updated_at** (`datetime`): 
        When the segment was last updated.
      
    
  


---

## Get Segments {{ tag: 'GET', label: '/v1/fetch/segments' }}


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

    
> Only kept segments are returned. Deleted or discarded segments are excluded.

  
  
    
  

<br/><br/>

  
    ### Response
    Returns a list of segment objects.
  
  
    
  


---

## Get Segment {{ tag: 'GET', label: '/v1/fetch/segments/:id' }}


  
    Returns one saved segment by id.

    ### Required Attributes
    
      - **id** (`string`): 
        The segment id to fetch.
      
    
  
  
    
  

<br/><br/>

  
    ### Response
    Returns the segment details, including its saved `visitor_event_query`.