API FundamentalsErrors

Errors

Look up Scrut API error codes for data endpoints and the token endpoint, and learn which errors are safe to retry.

The Scrut API uses HTTP status codes to tell you whether a request succeeded. When a request fails, the response body includes an error code that explains why.

Data Endpoint Errors

Errors from /v1 endpoints use this shape:

{
  "error": {
    "code": "validation_failed",
    "message": "Request validation failed.",
    "details": [
      {
        "field": "status",
        "message": "status contains unknown value(s): unknown"
      }
    ]
  },
  "meta": {
    "requestId": "550e8400-e29b-41d4-a716-446655440000"
  }
}
HTTP statusError codeWhat it means
400validation_failedA parameter or body field is invalid. Check details for the field.
400idempotency_key_requiredA write request is missing the Idempotency-Key header.
401unauthorizedThe Bearer token is missing, malformed, or invalid.
401token_revokedThe credential that issued the token was revoked.
401token_credential_expiredThe credential that issued the token has expired. Create a new credential.
401token_staleThe token is stale. Request a new token.
403forbiddenThe credential doesn't have the scope this endpoint requires.
403plan_restrictedYour Scrut plan doesn't include access to this resource.
404not_foundThe requested resource doesn't exist.
409conflictThe request conflicts with the resource's current state.
409idempotency_key_reused, idempotency_request_in_progressThe idempotency key conflicts with an earlier or in-progress request.
429rate_limit_exceededYou exceeded the rate limit. Wait for the time in Retry-After.
500internal_errorAn unexpected error occurred.
503upstream_unavailableA dependent service is temporarily unavailable. Retry later.

Token Endpoint Errors

Errors from /oauth/token follow the OAuth format:

{
  "error": "invalid_client",
  "error_description": "Invalid client credentials. Verify client_id and client_secret, or create a new credential in the Developer Console."
}
HTTP statusError codeWhat it means
400invalid_requestgrant_type is wrong or a required field is missing.
401invalid_clientThe client ID or secret is wrong, or the credential is revoked or expired.
429temporarily_unavailableYou exceeded the token endpoint rate limit.
503temporarily_unavailableThe authorization server is temporarily unavailable. Retry later.

Common Fixes

  • ``**** on a vulnerability: The vulnerabilityId returned by the API is already URL-encoded. Paste it into the path as is. See Requests and Responses.
  • ``**** on a write: The credential is Read Only. Create a Read & Write credential. See Scopes and Permissions.
  • ``**** after an hour: Your access token expired. Request a new token. See Authentication and Access Tokens.
  • ``****: You reused a key with a different body. Generate a new key for each new write. See Idempotency.

Which Errors to Retry

ErrorRetry?
429Yes, after the number of seconds in Retry-After. See Rate Limits.
503Yes, after a short wait.
409 idempotency_request_in_progressYes, with the same Idempotency-Key, after the original request finishes.
400, 403, 404, other 409 errorsNo. Fix the request first.
401Only after you request a new token, or create a new credential if it was revoked or expired.

Pro Tip! Include the requestId from meta or the X-Request-Id header when you contact support about a failed request. It helps us trace the exact call.

Contact support@scrut.io for further assistance.