Skip to main content

Overview

AWX API list endpoints return paginated responses to manage large datasets efficiently. The pagination implementation is defined in awx/api/pagination.py.

Default Pagination

By default, AWX uses page number pagination with the following characteristics:
  • Default page size: Based on DRF settings
  • Maximum page size: Controlled by MAX_PAGE_SIZE setting
  • Page query parameter: page
  • Page size query parameter: page_size

Paginated Response Structure

integer
Total number of items across all pages
string
URL to the next page (null if last page)
string
URL to the previous page (null if first page)
array
Array of resource objects for the current page

Query Parameters

Page Number

Navigate to a specific page:

Page Size

Control the number of items per page:
integer
default:"1"
Page number to retrieve
integer
Number of results per page (max: MAX_PAGE_SIZE setting)

Maximum Page Size

If you request a page_size larger than the configured MAX_PAGE_SIZE, it will be automatically capped:

Disabled Count Pagination

For large datasets, counting all results can be expensive. Use count_disabled to skip counting:
boolean
Skip counting total results for performance
With count_disabled=1, the response structure changes:
The count field is omitted and a fixed value is used internally to determine pagination

Limit Pagination

For event endpoints like job events, you can use limit-based pagination instead:
integer
Maximum number of results to return (used by UnifiedJobEventPagination)
Response with limit pagination:

Pagination Classes

AWX uses different pagination classes based on the endpoint:

Pagination (Default)

Used by most list endpoints:
  • Page-based navigation
  • Configurable page size
  • Full result count

LimitPagination

Used for simple result limiting:
  • No page navigation
  • Just limits result count
  • Returns results array only

UnifiedJobEventPagination

Used for job event endpoints:
  • Supports both page and limit parameters
  • Automatically switches based on query params
  • Optimized for streaming events

Iterating Through Pages

Python Example

Bash Example

Combining with Filtering and Ordering

Pagination works seamlessly with filtering and ordering:

Performance Considerations

Balance between number of requests and response size. Too small = many requests, too large = slow responses.
When iterating through all results, skip counting to improve performance:
If data doesn’t change frequently, cache paginated results to reduce API calls.
For job events and similar resources, use limit instead of pagination:

Error Handling

Invalid Page Number

Returned when requesting a page beyond the last page.

Invalid Page Size

Excessive page sizes are automatically capped to MAX_PAGE_SIZE.

Examples

Get First Page with Custom Size

Get All Job Events with Limit

Paginate Without Count

Pagination behavior is controlled by Django settings:
  • MAX_PAGE_SIZE - Maximum allowed page size
  • PAGE_SIZE - Default page size (DRF setting)
Check your AWX configuration: