{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Pagination","description":"REST API for the YOGO fitness platform — bookings, classes, customers, orders, teachers.","llmstxt":{"title":"YOGO API documentation","description":"REST API for the YOGO fitness platform. Customers can list classes, customers, teachers, orders, bookings, and the audit log; assign teachers to classes; and use the same data via an MCP server at mcp.yogobooking.com.","hide":false,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"pagination","__idx":0},"children":["Pagination"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["List endpoints use cursor-based pagination. You walk a result set by"," ","following the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["next"]}," URL until ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hasMore"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"parameters","__idx":1},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Default"},"children":["Default"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["limit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1000"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Records per page. Range 1–1000; out-of-range values fall back to the default."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["after"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Cursor: the ID of the last item from the previous page. Omit on the first request."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The cursor format depends on the resource:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Bookings:"]}," composite ID like ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["studio_123"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["livestream_456"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["All other resources:"]}," numeric ID like ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["456"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The same shape that appears in list responses is what you pass back as"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["after"]}," — you don't have to compose anything yourself."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"response-shape","__idx":2},"children":["Response shape"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every paginated response wraps results in the same envelope:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": [ /* array of resource objects */ ],\n  \"hasMore\": true,\n  \"next\": \"https://api.yogobooking.com/customers?after=456&limit=1000\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The page of results."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hasMore"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," if more pages exist."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["next"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string or null"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fully qualified URL for the next page; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}," when there are no more rows. A few endpoints omit the key instead — treat a missing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["next"]}," the same as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-to-walk-a-list","__idx":3},"children":["How to walk a list"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Make the first request without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["after"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hasMore"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},", fetch the URL in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["next"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Repeat until ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hasMore"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["next"]}," URL preserves all your query parameters (filters, expansions,"," ","date ranges) so you don't have to re-attach them."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"stability-under-concurrent-writes","__idx":4},"children":["Stability under concurrent writes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Cursor pagination keeps your walk consistent even when new records are"," ","created mid-iteration. New items added after your first page won't shift"," ","the items you've already seen."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"invalid-cursors","__idx":5},"children":["Invalid cursors"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you supply a non-existent ID as the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["after"]}," cursor, the API returns"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 Unprocessable Entity"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"statusCode\": 422,\n  \"message\": \"Invalid cursor: [resource] not found\",\n  \"error\": \"Unprocessable Entity\"\n}\n","lang":"json"},"children":[]}]},"headings":[{"value":"Pagination","id":"pagination","depth":1},{"value":"Parameters","id":"parameters","depth":2},{"value":"Response shape","id":"response-shape","depth":2},{"value":"How to walk a list","id":"how-to-walk-a-list","depth":2},{"value":"Stability under concurrent writes","id":"stability-under-concurrent-writes","depth":2},{"value":"Invalid cursors","id":"invalid-cursors","depth":2}],"frontmatter":{"title":"Pagination","seo":{"title":"Pagination"}},"lastModified":"2026-08-03T09:34:30.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/pagination","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}