Pagination
The Team Admin API returns long lists in pages. This topic explains how to request the first page, how to move to the next one, and how to know that you have the whole list.
Which operations are paginated
These operations return their results in pages:
They all work the same way, so what you learn here for one applies to the others.
List Assignments is the exception. It returns all matching assignments in one response, in { data }, and it doesn’t accept limit or cursor.
A page that has more results after it looks like this (shortened):
{
"data": [
{
"id": "100001",
"name": "Example Engineering"
}
],
"pagination": {
"cursor": "<CURSOR>",
"hasMore": true
}
}
| Field | What it tells you |
|---|---|
data |
The results on this page. |
pagination.hasMore |
true when more results are available. |
pagination.cursor |
A token for the next page. It is null when hasMore is false. |
On the last page, hasMore is false and cursor is null.
Request parameters
| Parameter | Description |
|---|---|
limit |
The maximum number of results per page. The default is 50. Accepts values from 1 to 100. A value outside this range is rejected with a 400 status code. |
cursor |
The pagination.cursor value from the previous response. Omit it on the first request. |
Retrieve every page
- Send the first request without a
cursor. Setlimitif you want a page size other than 50. - Read the results in
data. - If
hasMoreistrue, send the same request again with thecursorfrom the response. URL-encode the cursor. - Repeat steps 2 and 3. Stop when
hasMoreisfalse.
On every request in a sequence, keep these the same:
- the operation,
- the authorized administrator who makes the request,
- the filters, such as
emailorteamId, and - the
limit.
In Postman, open the List team users request and click Send. If hasMore is true, add the returned cursor as the cursor query parameter and click Send again. Repeat until hasMore is false.
The following cURL commands show the structure of the first two requests for a list of team users. You don’t need to run them.
curl -X GET \
'https://developer.api.autodesk.com/team-admin/v1/teams/<YOUR_TEAM_ID>/users?limit=50' \
-H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>'
If the response has "hasMore": true, send the same request with the returned cursor:
curl -X GET \
'https://developer.api.autodesk.com/team-admin/v1/teams/<YOUR_TEAM_ID>/users?limit=50&cursor=<URL_ENCODED_CURSOR>' \
-H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>'
Each page is a separate request, and every request counts toward your rate limit. For the limits, see Rate Limits.
Handle cursors and cursor errors
A cursor is a token that the API gives you. Pass it back exactly as you received it, after URL-encoding it. Don’t parse, modify, or construct a cursor. Cursors expire, so use each one promptly instead of keeping it for later.
| Status | What it means | What to do |
|---|---|---|
400 |
The cursor is invalid, or it doesn't match the request. | Pass the cursor unchanged, and keep the same operation, administrator, filters, and limit as in the list above. |
410 |
The cursor has expired. | Restart the sequence by sending the request without a cursor. |
For other errors, see Error Handling.
Results can change between pages
Other administrators can change a team while you read it. A page that you have already read doesn’t change, so it can be out of date by the time you reach the last page. If you need a complete, consistent list before you act, read all of the pages first, and then act.
See also
- API Basics — Review the teams, users, product pools, and assignments that you list.
- Rate Limits — Plan how many requests a long list needs.
- REST API Reference — Look up the parameters of each list operation.