invalid_value 🔌 API

API Error: Invalid parameter value — must be one of the allowed values / out of range

The field has the right type but a value the API doesn’t allow — not in the list of accepted options, too small or large, too long, or not matching the required pattern.

Seen on: REST API

Meaning

Beyond types, schemas restrict values: enums (“status must be one of active, paused”), numeric ranges (minimum/maximum), string length and regex patterns (emails, currency codes, phone numbers).

Case matters (“USD” vs “usd”), and an option that existed in an older API version may have been renamed or removed.

Common causes

  • Value not in the allowed enum (typo, wrong case, renamed option)
  • Number below minimum or above maximum
  • String too long/short or not matching a pattern
  • Using an option from another API version

⚡ Quick fix

  1. Read the allowed values in the error or docs and use one exactly
  2. Check minimum/maximum and length limits
  3. Match the expected case and format (ISO codes, E.164 phone numbers)

Detailed fix by platform

Node.js

  1. javascript
    const allowed = ['active', 'paused', 'cancelled'];
    if (!allowed.includes(status)) throw new Error(`status must be one of ${allowed.join(', ')}`);

How to diagnose

  1. Constraint — Enum, range, length or pattern?
  2. Value — Exact bytes sent, including case and whitespace
  3. Version — Does your API version support this option?

🧠 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.