> ## Documentation Index
> Fetch the complete documentation index at: https://partners.usehammock.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

> List endpoints return pages you walk with a cursor.

Every list endpoint returns the same shape and takes the same three parameters.

```json theme={null}
{
  "object": "list",
  "url": "/employees",
  "has_more": true,
  "data": [
    { "id": "emp_5Tg7Rw2nBx8P", "object": "employee" },
    { "id": "emp_2Bn6Ym9kLp3Q", "object": "employee" }
  ]
}
```

| Parameter | Meaning |
| - | - |
| `limit` | How many objects to return, from 1 to 100. Defaults to 10. |
| `starting_after` | An object ID. Returns the page that follows that object. |
| `ending_before` | An object ID. Returns the page that precedes that object. |

Lists are ordered newest first. `starting_after` and `ending_before` can't be combined.

## Walk a list

Request the first page, then pass the ID of its last object as `starting_after` until `has_more`
is `false`.

```bash theme={null}
curl "https://api.usehammock.co/employees?employer=empr_1Qx8Zt2eZvKYlo2C&limit=100" \
  -H "Authorization: Bearer hmk_live_..."

curl "https://api.usehammock.co/employees?employer=empr_1Qx8Zt2eZvKYlo2C&limit=100&starting_after=emp_2Bn6Ym9kLp3Q" \
  -H "Authorization: Bearer hmk_live_..."
```

Keep the same filters on every page. Objects created while you're paging appear at the front of
the list, so they don't shift the pages you haven't read yet.

## The exception

`GET /pay_periods` lists dates Hammock computes from a pay schedule, not stored objects. It takes
`from` and `to` in place of cursors and returns every period in the range, earliest first.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.