For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help CenterAPI KeysStatusSign In
GuidesAPI ReferenceChangelog
GuidesAPI ReferenceChangelog
  • Introduction
    • Getting started
  • Email API
  • Transactional SMS
  • Transactional WhatsApp
  • Marketing Campaigns
  • Contact Management
      • GETGet all the contacts
      • POSTCreate a contact
      • POSTCreate Contact via DOI (Double-Opt-In) Flow
      • GETGet a contact's details
      • DELDelete a contact
      • PUTUpdate a contact
      • GETGet email campaigns' statistics for a contact
      • GETGet all the segments
      • POSTExport contacts
      • POSTImport contacts
  • Events
    • GETGet events
    • POSTCreate an event
    • POSTCreate events in batch
  • Object Management
  • Accounts and Settings
  • Sales CRM
  • Conversations
  • Ecommerce
  • Loyalty
LogoLogo
Help CenterAPI KeysStatusSign In
Contact ManagementContacts

Get all the segments

GET
https://api.brevo.com/v3/contacts/segments
GET
/v3/contacts/segments
1import { BrevoClient } from "@getbrevo/brevo";
2
3async function main() {
4 const client = new BrevoClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.contacts.getSegments({});
8}
9main();
1{
2 "count": 2,
3 "segments": [
4 {
5 "categoryName": "Name1",
6 "id": 53,
7 "segmentName": "Segment1",
8 "updatedAt": "2017-03-12T12:30:00Z"
9 },
10 {
11 "categoryName": "Name2",
12 "id": 50,
13 "segmentName": "Segment2",
14 "updatedAt": "2017-03-12T12:30:00Z"
15 }
16 ]
17}

Retrieve all contact segments defined in your Brevo account with support for pagination and sorting. Results default to 10 segments per page (maximum 50) sorted in descending order of creation. Each segment includes its ID, name, category name, and last update timestamp.

Was this page helpful?
Previous

Export contacts

Next
Built with

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

Query parameters

limitlongOptional0-50Defaults to 10
Number of documents per page
offsetlongOptionalDefaults to 0
Index of the first document of the page
sortenumOptionalDefaults to desc

Sort the results in the ascending/descending order of record creation. Default order is descending if sort is not passed

Allowed values:

Response

Segments informations
countlong
Number of Segments in your account
segmentslist of objects
Listing of all the segments available in your account

Errors

400
Bad Request Error