Pagination

Every list endpoint returns the same envelope and uses opaque, cursor-based paging. You request a page size with limit, and follow next_cursor until the API tells you there's nothing more. Cursors are encrypted tokens tied to the exact query that produced them.

The list envelope

  • Name
    object
    Type
    string
    Description

    Always list.

  • Name
    data
    Type
    array
    Description

    The page of resources, newest-first unless the endpoint documents otherwise.

  • Name
    has_more
    Type
    boolean
    Description

    Whether more pages exist. Stop walking when this is false.

  • Name
    next_cursor
    Type
    string
    Description

    Pass this back as cursor to fetch the next page. null on the last page.

  • Name
    url
    Type
    string
    Description

    The path this list was fetched from.

Response

{
  "object": "list",
  "data": [
    { "object": "template", "id": "template_00a1b2c3d4e5f607" }
    // ...
  ],
  "has_more": true,
  "next_cursor": "hf8a2c1b9d0e...",
  "url": "/v1/templates"
}

Request parameters

  • Name
    limit
    Type
    integer
    Description

    Page size, 1100 (default 10). Some endpoints have a fixed size and ignore this: audit events page at 25, Lab runs at 50.

  • Name
    cursor
    Type
    string
    Description

    The previous response's next_cursor, passed back verbatim.

Walking a collection

Fetch the first page, then keep passing next_cursor back as cursor until has_more is false.

GET
/v1/templates
# First page
curl -s -G https://api.synexcloud.com/v1/templates \
  -H "Authorization: Bearer $SYNEX_API_KEY" \
  -d limit=50

# Next page
curl -s -G https://api.synexcloud.com/v1/templates \
  -H "Authorization: Bearer $SYNEX_API_KEY" \
  -d limit=50 \
  -d cursor=hf8a2c1b9d0e...

Cursor rules

  • Never construct or modify a cursor. A malformed or tampered cursor returns 400 invalid_cursor.
  • Don't persist cursors long-term. To resume later, restart from the first page.
  • Cursors are tied to their query. Changing filters, ordering, or limit mid-walk invalidates the cursor — start a fresh walk instead.

Was this page helpful?