Pagination

This section describes how to interact with endpoints that support pagination on the API

Many list endpoints return paginated results. You may use the query parameters page and limit to control the number of results you see.

By default page will default to limit=10 and page=1 unless values are given.

When responses are returned from paginated calls, you'll find an additional pagination key in the meta object within the response.

curl --location --request GET 'https://api.getbrass.co/countries?limit=2' \
--header 'Authorization: Bearer tk_iAFvsU22Lx990OV1UkoFXhZPWfDAdwX5szTtbyB9fh8'
{
    "data": [
        {
            "embeds": [
                "customer_types",
                "gateways",
                "states"
            ],
            "id": "cnt_5lbHlGBKjBk6pv1XaTcmCO",
            "name": "Afghanistan",
            "iso_code": "AF",
            "dialing_code": "93",
            "default_currency": "NGN",
            "is_visible": true,
            "is_trashed": false,
            "deleted_at": null,
            "created_at": "2020-01-01T02:54:27+01:00",
            "updated_at": "2020-01-01T02:54:27+01:00",
            "states_count": 34
        },
        {
            "embeds": [
                "customer_types",
                "gateways",
                "states"
            ],
            "id": "cnt_6lBx2Gqc7yLvDegsyhv7sr",
            "name": "Åland Islands",
            "iso_code": "AX",
            "dialing_code": "358",
            "default_currency": "NGN",
            "is_visible": true,
            "is_trashed": false,
            "deleted_at": null,
            "created_at": "2020-01-01T02:54:27+01:00",
            "updated_at": "2020-01-01T02:54:27+01:00",
            "states_count": 0
        }
    ],
    "meta": {
        "pagination": {
            "total": 250,
            "count": 2,
            "per_page": 2,
            "current_page": 1,
            "total_pages": 125,
            "links": {
                "next": "https://api.getbrass.co/countries?limit=2&page=2"
            }
        }
    }
}