curl -X GET "https://cloud-api.pland.app/v2/users?limit=50&offset=100" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
[
  {
    "_id": "507f1f77bcf86cd799439011",
    "general": {
      "firstName": "John",
      "lastName": "Doe"
    },
    "access": {
      "email": "john@example.com"
    }
  }
]
The PlanD API uses offset-based pagination for list endpoints, allowing you to efficiently retrieve large datasets by controlling the number of items returned and skipping items for pagination.

Pagination Parameters

Based on the API specification, all list endpoints support these pagination parameters:
limit
integer
default:"100"
Maximum number of items to return. Must be between 1 and 1000 for most endpoints.
offset
integer
default:"0"
Number of items to skip for pagination. Must be 0 or greater.
curl -X GET "https://cloud-api.pland.app/v2/users?limit=50&offset=100" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
[
  {
    "_id": "507f1f77bcf86cd799439011",
    "general": {
      "firstName": "John",
      "lastName": "Doe"
    },
    "access": {
      "email": "john@example.com"
    }
  }
]

Pagination Implementation

1

Start with the first page

Begin with offset=0 to get the first set of results
GET /users?limit=100&offset=0
2

Calculate subsequent pages

For each subsequent page, increase the offset by the limit value
# Page 1: offset = 0
GET /users?limit=100&offset=0

# Page 2: offset = 100  
GET /users?limit=100&offset=100

# Page 3: offset = 200
GET /users?limit=100&offset=200
3

Detect the end of results

When the response contains fewer items than the limit, you’ve reached the end
If you request 100 items but only receive 50, there are no more pages

Code Examples

async function getAllUsers() {
  const allUsers = [];
  let offset = 0;
  const limit = 100;
  
  while (true) {
    const response = await fetch(
      `https://cloud-api.pland.app/v2/users?limit=${limit}&offset=${offset}`,
      {
        headers: {
          'Authorization': `Bearer ${process.env.PLAND_JWT_TOKEN}`
        }
      }
    );
    
    const users = await response.json();
    allUsers.push(...users);
    
    // If we got fewer results than requested, we're done
    if (users.length < limit) {
      break;
    }
    
    offset += limit;
  }
  
  return allUsers;
}

Special Pagination Cases