Help Center/Troubleshooting/Fixing 422 validation errors

Troubleshooting

Fixing 422 validation errors

How to fix request validation errors.


What does 422 mean?

A 422 Unprocessable Entity means your request was well-formed but contained invalid data.

Common causes

Invalid IP address

# Wrong — not a valid IP
curl -X POST https://predax.io/api/v1/check/ip \
  -H "X-API-Key: KEY" -H "Content-Type: application/json" \
  -d '{"ip": "not-an-ip"}'

# Correct
curl -X POST https://predax.io/api/v1/check/ip \
  -H "X-API-Key: KEY" -H "Content-Type: application/json" \
  -d '{"ip": "8.8.8.8"}'

Private/reserved IP addresses

Private IPs (e.g., 192.168.x.x, 10.x.x.x, 127.0.0.1) cannot be looked up — they have no public geolocation or threat data.

Missing required fields (bulk endpoint)

# Wrong — missing "ips" field
curl -X POST https://predax.io/api/v1/check/ip/bulk \
  -H "X-API-Key: KEY" -H "Content-Type: application/json" \
  -d '{}'

# Correct
curl -X POST https://predax.io/api/v1/check/ip/bulk \
  -H "X-API-Key: KEY" -H "Content-Type: application/json" \
  -d '{"ips": ["8.8.8.8"]}'

Too many IPs in bulk request

The bulk endpoint accepts a maximum of 100 IPs per request. Split larger lists into batches.

Debugging tips

The response body contains details about what went wrong:

{
  "detail": [
    {
      "loc": ["body", "ips", 0],
      "msg": "value is not a valid IPv4 or IPv6 address",
      "type": "value_error"
    }
  ]
}

Read the msg field — it usually tells you exactly what to fix.