Error Codes

Overview

Plutto employs standard HTTP response codes to communicate API request outcomes. The framework organizes responses into three categories: 2xx codes indicate success, 4xx codes signal issues with submitted information, and 5xx codes represent server-side problems.

Error Response Structure

The API returns error information in a standardized JSON format:

{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "The requested resource cannot be found. This item does not exist or has been previously removed.",
    "detail": "Couldn't find Validation resource",
    "param": null,
    "request_id": null,
    "docs_url": "https://plutto.readme.io"
  }
}

Complete Status Codes Reference

Error CodeHTTP StatusError TypeDescription
bad_request400invalid_request_errorThe request was unacceptable, often due to missing a required parameter.
unauthorized401authentication_errorNo valid API key provided.
resource_not_found404invalid_request_errorThe requested resource cannot be found. This item does not exist or has been previously removed.
unprocessable_entity422invalid_request_errorYour request was understood, but we were not able to process it. Please fix it before repeating.
internal_server_error500api_errorSomething went wrong by our side. We're probably already looking into it.
service_unavailable503service_unavailable_errorThe server is currently unavailable. Please try again later.

Special Cases

External Data Source Failures

When third-party data sources become unavailable (such as Registro Empresas y Sociedades), the API responds with a 503 service unavailability error if the request cannot be processed due to that dependency.