V3 Segments

Returns a workspace's segments, searched, sorted and counted on the server. Private segments (survey-local targeting drafts) are never listed. A segment's survey references — including the surveyIds of its survey-interaction filters — only name surveys the caller may see. Requires the Contacts entitlement (403 without it). The cursor is bound to sortBy and filter[title][contains]; changing either while paging → 400 naming cursor. Unknown query parameters → 400. Session cookie, x-api-key, or a Bearer token.

get/api/v3/segments

Request

  • Base URL
    https://app.formbricks.com
  • URL
    https://app.formbricks.com/api/v3/segments
  • Auth
    • API key in cookie next-auth.session-token
    • or API key in header x-api-key
    • or HTTP bearer

Query parameters

workspaceIdstring cuid2 required

Workspace identifier.

limitinteger

Page size (max 250).

cursorstring

Opaque cursor returned as meta.nextCursor from the previous page.

includeTotalCountboolean

Whether to calculate meta.totalCount. Send true on the first page to get the count; when omitted or false the count query is skipped and meta.totalCount is null.

filter[title][contains]string

Case-insensitive substring match on the segment title.

sortBy'-updatedAt' | '-createdAt' | 'title'

-updatedAt (default), -createdAt (both newest first) or title (A–Z).

Response

Segments retrieved successfully

Changes