Pagination & Sorting
All API endpoints returning a list of results (e.g. Tenants, Users, Permissions, Roles, Pricing Tiers, Features, Object Types, and Warrants) support cursor-based pagination via a combination of the limit
, afterId
, and beforeId
query parameters. They also support sorting (and paginated sorting) via the sortBy
, sortOrder
, afterValue
, and beforeValue
query parameters:
Parameter | Description | Required | Default |
---|---|---|---|
limit | A positive integer representing the maximum number of items to return in the response. Must be less than or equal to 1000. | no | 25 |
afterId | A cursor representing your place in a list of results. Requests containing afterId will return elements after the cursor. | no | n/a |
beforeId | A cursor representing your place in a list of results. Requests containing beforeId will return elements before the cursor. | no | n/a |
afterValue | Works like afterId if a sortBy is provided. Requests containing afterValue will return elements after the cursor. | if sortBy | n/a |
beforeValue | Works like beforeId if a sortBy is provided. Requests containing beforeValue will return elements before the cursor. | if sortBy | n/a |
sortBy | The column to sort the result by. | no | the id column |
sortOrder | The order in which to sort the result by. Valid values are ASC and DESC | no | ASC |
Request
curl "https://api.warrant.dev/v1/users?sortBy=email&sortOrder=ASC&afterId=user123&afterValue=emailA%40warrant.dev&limit=2" \
-H "Authorization: ApiKey YOUR_KEY"
Response
200 OK
[
{
"userId": "userXYZ",
"email": "emailB@warrant.dev"
},
{
"userId": "userABC",
"email": "emailC@warrant.dev"
}
]