List Segments

List all segments for the organization with cursor-based pagination.

GET/segments

Requires an API key with the segments:read permission.

Query Parameters

limitnumber

Maximum number of results to return. Min 1, max 100. Default 20.

afterstring

Cursor for forward pagination.

beforestring

Cursor for backward pagination.

Response Fields

objectstring

Always "list".

has_moreboolean

Whether there are more results available.

dataarray

Array of segment objects. Each item contains id, name, and created_at.

curl -X GET 'https://api.postflare.dev/segments?limit=10' \
  -H 'Authorization: Bearer sk_xxxxxxxxx'
const response = await fetch('https://api.postflare.dev/segments?limit=10', {
  headers: {
    'Authorization': 'Bearer sk_xxxxxxxxx',
  },
});

const data = await response.json();

Response

Response
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Newsletter Subscribers",
      "created_at": "2026-01-01T00:00:00.000Z"
    }
  ]
}