HTTP Status Codes

The SnapValid API uses standard HTTP status codes to indicate the result of a request.

Status CodeNameDescription
200OKThe request was successful
400Bad RequestMissing or invalid request parameters
401UnauthorizedInvalid or missing API key
402Payment RequiredInsufficient API credits
403ForbiddenRequest not allowed
404Not FoundResource not found (e.g., invalid file ID)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server-side error
503Service UnavailableTemporary server overload or maintenance

Handling Errors

When a request fails, the API returns:

  • An appropriate HTTP status code
  • A JSON error response

Example (401 Unauthorized):

{
  "message": "Unauthorized"
}

Best Practices

  • Always validate the HTTP status code before parsing the response

  • Implement retry logic for 429 and 503 errors

  • Do not retry 401 or 403 without fixing authentication

  • Monitor API usage to prevent rate limiting