VYG Docs

Pagination

The list envelope every VYG API list returns, and how to page through it with a cursor.

Every list endpoint returns the same envelope, { data, next_cursor }. You page with limit and cursor query parameters. The REST reference shows the parameters of each endpoint.

The list envelope: { data, next_cursor }

{
	"data": [
		/* records */
	],
	"next_cursor": "eyJpZCI6IjhmMmIwYzFlIn0"
}
FieldMeaning
dataThe page of records.
next_cursorOpaque cursor of the next page. null on the last page, and always null on an unpaged list.

Two lists add one field beside the page: segment members add generation, and the customer field catalog (GET /v1/customers/fields) adds catalog_version. Single records and reports are not wrapped in data; they are returned as the object itself.

Query paramDescription
limitPage size. The default and maximum depend on the endpoint; see the table below.
cursorThe next_cursor from the previous page. Omit it for the first page.

No list takes an offset, and no list returns a total count. The lists that used to page by offset (commerce orders and subscriptions, customers at risk, conversation insights and the conversations for an insight) refuse an offset parameter with 400 bad_request.

Page sizes

EndpointsDefaultMaximumOver the maximum
Conversations, messages, contacts50100Reduced to 100
Customers: list, timeline, orders, subscriptions50200400 bad_request
Customer search (GET /v1/customers/search)2525400 bad_request
Segment members (GET /v1/segments/{id}/members)1005,000400 bad_request
Segment history1001,000400 bad_request
Segments list (GET /v1/segments)200500400 bad_request
Commerce orders, subscriptions and products; customers at risk25100400 bad_request
Conversation insights (GET /v1/brand/insights)2050400 bad_request
Conversations for an insight (GET /v1/brand/insights/{insight_id}/conversations)1030400 bad_request

Use the largest page the endpoint allows when you need every record; it means fewer requests.

Walk every page

  1. Request the first page with no cursor.
  2. While next_cursor is not null, request the next page with cursor=<next_cursor> and the same filters and limit.
# First page
curl -sS "https://api.vyg.app/v1/conversations?limit=50" \
  -H "Authorization: Bearer $VYG_API_KEY"

# Next page
curl -sS "https://api.vyg.app/v1/conversations?limit=50&cursor=eyJpZCI6IjhmMmIwYzFlIn0" \
  -H "Authorization: Bearer $VYG_API_KEY"

Treat the cursor as opaque: do not parse or build one, and do not reuse it with different filters. A cursor that the API did not issue returns 400 bad_request rather than restarting from the beginning.

MCP list tools page the same way: the tool result has data and next_cursor, and the tool takes a cursor argument.

Commerce orders, subscriptions and customers at risk

These lists stop at row 10,000. The page that reaches row 10,000 is shortened to end there and its next_cursor is null. A cursor at or past row 10,000 returns 400 bad_request. Narrow the request with the endpoint's filters (dates, status, customer) to reach older rows.

Products

GET /v1/commerce/products reads the live store catalog, and its next_cursor comes from the store. Pass it back as cursor until it is null.

Unpaged lists

Some lists return every record in one response and always set next_cursor to null: providers, event definitions, keys, event types, connected apps (GET /v1/integrations), campaigns, the customer field catalog, customer search and conversation search. They use the same { data, next_cursor } envelope, so the same client code reads them.

On this page