-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Pagination Not working for Fetch Users Endpoint #11648
Copy link
Copy link
Closed
Labels
product / authFixes and upgrades for the Appwrite Auth / Users / Teams services.Fixes and upgrades for the Appwrite Auth / Users / Teams services.product / avatarsFixes and upgrades for the Appwrite Avatars.Fixes and upgrades for the Appwrite Avatars.product / databasesFixes and upgrades for the Appwrite Database.Fixes and upgrades for the Appwrite Database.product / functionsFixes and upgrades for the Appwrite Functions.Fixes and upgrades for the Appwrite Functions.
Metadata
Metadata
Assignees
Labels
product / authFixes and upgrades for the Appwrite Auth / Users / Teams services.Fixes and upgrades for the Appwrite Auth / Users / Teams services.product / avatarsFixes and upgrades for the Appwrite Avatars.Fixes and upgrades for the Appwrite Avatars.product / databasesFixes and upgrades for the Appwrite Database.Fixes and upgrades for the Appwrite Database.product / functionsFixes and upgrades for the Appwrite Functions.Fixes and upgrades for the Appwrite Functions.
👟 Reproduction steps
Step 1 Gather your Api key and base url
Step 2 create a curl command to execute on Postman with query parameters
DIfferent approaches tried
pproach 1: Standard URL Encoding
cURL Format: queries[]=limit(1)&queries[]=offset(0) (using --data-urlencode)
Result: 400 Bad Request
Error Message: Invalid query: Syntax error
Observation: The parser likely sees the encoded brackets %5B%5D or parentheses %28%29 and fails to map them to the internal Query class.
Approach 2: Manual String Quoting
cURL Format: queries[]=%22limit(1)%22
Result: 400 Bad Request
Error Message: Must be an array, got string
Observation: Attempting to force the parameter into a string resulted in the parser losing the "Array" context of the queries[] key.
Approach 3: Indexed Array Notation
cURL Format: queries[0]=limit(1)&queries[1]=offset(0)
Result: 400 Bad Request (Shell Level) or 400 Syntax Error (API Level)
Error Message: curl: (3) bad range in URL
Observation: While this forces an array structure, curl treats [] as globbing ranges. When globbing was disabled (-g), the Appwrite parser still rejected the indexed keys as non-standard.
Approach 4: Verified Scope/Auth Check
Action: Sending the request without any query parameters.
Result: 200 OK (Full User List returned)
Observation: This confirms the API Key and Project ID are valid. However, the moment any queries[] parameter is introduced, the system shifts to a different validation logic (the Query Parser), which triggers the failures seen in Approaches 1-3.
Approach 5: Explicit Scope Trigger
Action: Correcting the query syntax while the users.read scope was initially missing.
Result: 401 Unauthorized
Error Message: User (role: guests) missing scopes (["users.read"])
Observation: This was the first "successful" parse of the query string. It proved that queries[]=limit(1) is the correct syntax, but it triggered a deeper permission check that a "no-query" request bypasses.
👍 Expected behavior
Should Return Paginated response
👎 Actual Behavior
Failing to execute with queries or Returning full Users Response
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
MacOS
🧱 Your Environment
No response
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?