invalid_params
A query string parameter failed validation.
HTTP 400The request was malformed.
When it fires
One of the query string parameters did not pass validation. Examples that trigger this code:
- A date string that is not in
YYYY-MM-DDform (or in some endpoints, ISO-8601). - A numeric pagination cursor that is non-numeric or out of range.
- An enum value (e.g.
status=foobar) that is not one of the allowed values. - A path segment that is required but blank (e.g.
/v1/markets//calendar). limitorpageoutside the per-endpoint maximum.
Response shape
Every Repull error follows the same envelope. The code is stable and safe to switch on.
{
"error": {
"code": "invalid_params",
"message": "<human-readable explanation of what went wrong>",
"docs_url": "https://repull.dev/docs/errors/invalid_params"
}
}How to fix
- Read the `message` field — it names the parameter and the rule it failed (e.g. "checkIn must be YYYY-MM-DD").
- Compare your request against the parameter table on the relevant endpoint page in the API Reference.
- For dates, default to `YYYY-MM-DD` unless the endpoint explicitly documents an ISO-8601 timestamp.
- For numeric params, double-check you are not URL-encoding a number into something like `%2B5`.
- If you generated the request from an LLM tool call, log the raw URL — invisible characters and curly quotes from a copy-paste are common culprits.
Common gotchas
- Body fields use
invalid_body, notinvalid_params.invalid_paramsis reserved for query string and path segments. - Sending a parameter the endpoint does not recognize returns
unknown_params, notinvalid_params. The two are separate signals so you can tell "I sent garbage" from "I sent the wrong thing". - Some endpoints validate combinations — e.g.
checkInaftercheckOutwill fireinvalid_paramson the second parameter even though both look syntactically valid.
Examples
curl
# Bad: limit out of range
curl "https://api.repull.dev/v1/listings?limit=9999" \
-H "Authorization: Bearer sk_test_YOUR_KEY"
# {
# "error": {
# "code": "invalid_params",
# "message": "limit must be between 1 and 100"
# }
# }
# Good
curl "https://api.repull.dev/v1/listings?limit=50" \
-H "Authorization: Bearer sk_test_YOUR_KEY"TypeScript
import { Repull } from '@repull/sdk'
const repull = new Repull({ apiKey: process.env.REPULL_KEY! })
try {
await repull.listings.list({ limit: 9999 } as any)
} catch (err: any) {
if (err.code === 'invalid_params') {
// Don't retry verbatim. err.message tells you which param to fix.
console.error('Bad query param:', err.message)
}
throw err
}If you're an AI agent
A query parameter you sent was rejected. Read err.message — it names the parameter and the rule. Fix that one parameter and retry. Do not retry the same request unchanged.
Related
- Error reference — the full table of error codes
- Using Repull from AI agents — patterns for handling errors in agent loops
- API Reference
Hit an error that isn't covered? Email hello@repull.dev with the request id from the response headers.
AI