Developer Docs - Trust Swiftly
  • Developer Documentation
  • Web
    • Integration
    • Button Link
    • WordPress
    • WebView iOS and Android
    • Bubble ID Verify Integration
    • FlutterFlow Identity Verification
    • Webflow ID Verification
    • Zapier Identity Verification
  • API
    • Getting an API Key
    • Authentication
    • Users
    • Reverify User
    • Documents
    • Stats
    • Templates
    • Errors
    • Pagination
    • Filtering and Sorting
    • Rate Limits
  • Webhooks
    • Setup and Handling Webhooks
    • Webhook Code Examples
  • Hosted Link
    • Share hosted link
  • Self Sign Up and Create Autofill
    • Configure self verifications
    • Prefill User Creation
  • Single Sign On
    • SAML2 SSO (Okta, etc)
    • Rippling SSO App
    • Azure Entra ID SAML
  • Notifications
    • Slack
    • Zoho Cliq
    • Email and Web Push
  • Stripe App
    • Install and Demo Guide
    • Disconnect Stripe App
  • References
    • Supported Documents
  • Links
    • Trustswiftly.com
    • Sign Up
Powered by GitBook
On this page
  1. API

Pagination

All top-level API endpoints have support for bulk fetches via "list" API methods.

Some endpoints will return data in a paginated list. A paginated response will look similar to this:

{
    "data": [
        //...
    ],
    "links": {
        "first": "https://yourwebsite.com/api/users?page=1",
        "last": "https://yourwebsite.com/api/users?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://yourwebsite.com/api/users",
        "per_page": 15,
        "to": 15,
        "total": 15
    }
}

As per the example above, each paginated response will have the data array, which contains all the items from the specific page, a links object with full URLs for fetching first, last, prev and next pages, and the meta object which contains all the info about the resource you are paginating.

Some endpoints allow you to specific number of records that you want to receive per page. To achieve that you can append the per_page=X parameter to the URL of the request. For example, if you want to request 50 users per page, the URL parameters should look like the following:

/users?per_page=50

Pagination limit is set to 100 for most resources which means that you cannot request more than 100 records per page. If you provide a larger number, it will be ignored and 100 records per page will be returned.

To request a different page, just append the page=X parameter to the URL. For our customers example above, you can get the second page like following:

/users?per_page=50&page=2
PreviousErrorsNextFiltering and Sorting

Last updated 3 years ago