We use cookies to improve your experience. Read more about how we handle your data in our GDPR policy.

    Back to Genju
    API Docsv1

    Pagination

    The Genju API uses cursor-based pagination for all list endpoints.

    How It Works

    List endpoints return a next_cursor field. Pass it as ?after=CURSOR to get the next page. When next_cursor is null, you've reached the end.

    Example

    http
    // First page
    GET /api/v1/contacts?limit=50
    
    // Response includes next_cursor
    {
      "contacts": [...],
      "next_cursor": "eyJpZCI6ImNseHl6NDU2In0="
    }
    
    // Next page
    GET /api/v1/contacts?limit=50&after=eyJpZCI6ImNseHl6NDU2In0=

    Pagination in SDKs

    javascript
    // JavaScript
    let cursor = null;
    do {
      const result = await genju.contacts.list({ after: cursor, limit: 100 });
      processContacts(result.contacts);
      cursor = result.next_cursor;
    } while (cursor);