400 Bad Request when maxResults exceeds limit in Jira Align API
0 reputation · 07 Mar 2021, 22:51 UTC
0 reputation · 07 Mar 2021, 22:51 UTC
The Jira Align REST API utilizes startAt and maxResults parameters to manage large dataset retrievals. While the default for maxResults is typically 50, there is a documented hard upper bound of 100 per request.
When a request is initiated with a maxResults value greater than 100, the server returns a 400 Bad Request. However, it is unclear whether this limit is globally fixed across all endpoints or if it varies based on the specific resource type (e.g., Epics, Features, or User Stories).
Is there a mechanism to dynamically increase this 100-item limit for tenant-specific configurations? Does the API provide a Link header in the response to facilitate sequential page-based navigation when the hard limit is reached?
34775 reputation · 08 Mar 2021, 08:38 UTC
When you send a request to a Jira Align endpoint with maxResults set above the value that the endpoint’s documentation lists as the maximum, the server responds with a 400 Bad Request. The 400 status is not a “generic” error; the response body contains a message such as maxResults must be <= 100 or a similar range‑check error. This is a hard limit enforced by the API, not a configurable setting.
Jira Align implements a per‑endpoint ceiling for maxResults to protect the underlying database and service layer from large, potentially expensive queries. The default value is often 50, but the maximum is typically 100 for most endpoints. Some newer releases or specific resources (e.g., /epic vs. /userStory) may allow up to 200 or 500, but the limit is still fixed in the API definition.
maxResults.Link header for pagination; instead, you must use the startAt (or equivalent) query parameter to request subsequent pages.maxResults ceiling.maxResults to the documented maximum (e.g., 100). Example:
curl -X GET \
"https://your‑tenant.align.apps.atlassian.com/api/v1/epic?startAt=0&maxResults=100" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
startAt value:
for start in 0 100 200 ...; do
curl ... "?startAt=$start&maxResults=100"
# process response
done
total field (if present) indicates the full dataset size.maxResults out of range. Log the error and adjust the parameter accordingly.No. Jira Align does not provide a tenant‑level setting to raise the hard cap. The only way to retrieve more than the maximum per page is to paginate using startAt.
Unlike some REST APIs, Jira Align does not include a Link header for pagination. All navigation must be handled client‑side via the query parameters.
Which specific endpoint are you calling, and what is the maximum maxResults value documented for that endpoint? Knowing this can confirm whether you’re hitting the correct ceiling or if another parameter is causing the 400.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 07 Mar 2021, 23:02 UTC
A useful distinction here is that the maxResults ceiling is a per-request page-size validation, not a cap on the total dataset. A 400 means the page window was rejected, not that the query itself is unauthorized or rate-limited.
When paging, treat a short or empty page as the safest termination signal, especially if total is absent or capped. Advance startAt by the exact maxResults value used, and avoid inferring completion from HTTP status alone.
Because caps and metadata vary by endpoint and release, verify against your specific tenant and resource. Send maxResults=100 and maxResults=101 to the same endpoint and compare responses, then inspect headers and body for Link, total, size, startAt, and maxResults. Do not assume RFC 5988 Link headers exist; rely on the documented startAt/maxResults contract for navigation.