API Error: Missing required parameter (parameter_missing / "x" is required)
The API rejected the request because a field it requires — in the query string, path, headers or JSON body — wasn’t sent or was empty.
Meaning
Every endpoint declares which inputs are mandatory. If one is absent, null or an empty string, the server stops before doing any work and returns a 400 (sometimes 422) naming the missing field.
The field is often there in your code but never reaches the wire: it was undefined and got dropped during JSON serialization, it was sent as a query parameter when the API expects it in the body, or a form encoding/Content-Type mismatch meant the server couldn’t read the body at all.
Common causes
- The field was left out of the request
- The value was undefined/null and silently dropped by JSON.stringify
- Sent in the wrong place (query string instead of body, or body instead of header)
- Body not parsed because Content-Type is missing or wrong
- Field name misspelled or wrong case (customerId vs customer_id)
⚡ Quick fix
- Read the error body — it usually names the missing parameter
- Log the exact request the client sends and compare it with the API docs
- Add client-side validation so required fields can’t be empty
Detailed fix by platform
Node.js
- `// undefined values vanish from JSON — check before sending const body = { email, plan }; for (const [k, v] of Object.entries(body)) if (v == null
- v === '') throw new Error(
missing ${k}); await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) });`
Python
- python
r = requests.post(url, json={"email": email, "plan": plan}) # json= sets Content-Type for you print(r.status_code, r.json())
curl
curl -X POST https://api.example.com/v1/users -H 'Content-Type: application/json' -d '{"email":"a@b.com","plan":"pro"}'
How to diagnose
- Error body — Which parameter does it name?
- Raw request — Is the field present in the bytes actually sent (proxy/devtools log)?
- Location — Does the docs say query, path, header or body?
- Spelling — Exact name and case match the docs?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Report a correction or suggest an improvement
Last updated 7 Oct 2026