https://retellai.com/?utm_source=discord&utm_medium=seo logo
Hey Evy, can you tell me why my pagination request...
# ❓・ai-evy-support
j
@AI Evy Hey Evy, can you tell me why my pagination request keeps returning error code 400? I'm using n8n, and the first request always works fine, but when I loop back through and attempt to use the pagination key, I get this error, " 400 - "{\"error_message\":\"request/body must NOT be valid\"}"
a
Thanks for tagging me @JTrannVA. I'll look through relevant sources and get back to you shortly.
### Answer The error "request/body must NOT be valid" typically occurs when you're mixing pagination methods incorrectly. [(1) ]() [(2) ]() When using
pagination_key
, you should not include
skip
in your request body. The
pagination_key
is an opaque cursor from a previous response that handles pagination automatically. Your first request works because you're likely using
limit
and
skip
(or just
limit
) . But on subsequent requests, if you're including both
pagination_key
and
skip
, this creates a conflict that triggers the 400 error. Solution: When looping through pagination in n8n, structure your requests like this: First request:
Copy code
json
{
  "limit": 50
}
Subsequent requests (using the pagination_key from previous response) :
Copy code
json
{
  "limit": 50,
  "pagination_key": "{{previous_response.pagination_key}}"
}
Remove any
skip
parameter when using
pagination_key
. The pagination key already encodes the position in your result set.
​ To learn more, see the sources I considered: [[1] List Calls](https://docs.retellai.com/api-references/list-calls) [[2] List Chats](https://docs.retellai.com/api-references/list-chats) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.