Pagination

All top-level API resources have support for bulk fetches via "list" API methods. For instance, you can list goals, list users, and list feedback. These "list" API methods share a common structure, taking at least these two parameters: limit and startingAfter.

Lattice utilizes cursor-based pagination via the startingAfter parameter. startingAfter takes a cursor value (see below) and return objects in reverse chronological order listed after the cursor.

{
  "object": "list",
  "hasMore": true,
  "endingCursor": "YXJyYXljb25uZWN0aW9uJDQkMQ==",
  "data": [
    {...},
    {...},
    {...}
  }
}

Arguments

Argument NameDescription
limit - (optional, defaults to 10)A limit on the number of objects to be returned. Must be a number between 1 and 100.
startingAfter - (optional)A cursor for use in pagination. startingAfter is an opaque string that defines your place in the list. For instance, if you make a list request and receive 100 objects, with endingCursor of cursor_foo, your subsequent call can include startingAfter=cursor_foo in order to fetch the next page of the list.

List Response

Key NameDescription
object - (string, value is "list")A string describing the object type returned.
data - (array)An array containing the actual response elements, paginated by any request parameters.
hasMore - (boolean)Whether or not there are more elements available after this set. If false, this set comprises the end of the list.
endingCursor - (string or null)An opaque string that defines your place in the list. This field can be used as the value for startingAfter for subsequent paginations. If null, this set comprises the end of the list.