INVALID_REQUEST[01]

INVALID_REQUEST

The /v1/batch body wasn't JSON, had neither urls nor site, or listed no valid URLs.

Code · HTTP status · Retryable?
INVALID_REQUEST[400][No]

What this means

[02]

Only /v1/batch returns INVALID_REQUEST. It fires when the body isn't valid JSON, when it has neither a non-empty `urls` array nor a `site` string, or when none of the `urls` are valid http(s) URLs. Two things are not errors: a batch over 50 URLs keeps the first 50 and drops the rest, and an unknown `mode` falls back to read-and-score. Nothing is charged.

When you'll see it

[03]

HTTP 400. Body always includes code: "INVALID_REQUEST". Branch on code, never on the human-readable message — wording can change without notice; the code is the stable contract.

Example response

[04]
example response[json]
{
  "status": "error",
  "code": "INVALID_REQUEST",
  "message": "\"urls\" contained no valid HTTP(S) URLs."
}

How to handle

[05]

Send `urls` as a non-empty array of http(s) URLs, or `site` as a URL string. The message says which part was wrong. Fix the body before you send it again.

Suggested handling in a Node client:

if (data.code === 'INVALID_REQUEST') {
  // Your body is wrong. Never retry unchanged.
  throw new Error(`Onto rejected the request: ${data.message}`);
}
Code · Status · What it means
INVALID_URL[HTTP 400]

The url was missing or unparseable, used a scheme other than http(s), or pointed at a private or internal host.

UNAUTHORIZED[HTTP 401]

The Authorization header is missing, malformed, or holds a key that isn't active.

See the full error index for the complete catalog with the handling switch statement covering every code at once.