# Errors

opsnow\.io uses standard HTTP response codes to indicate the success or failure of API requests. Typically, they are as follows:

#### 1. 2xx: Success

#### 2. 4xx: Client Error

* Indicates inaccurate or incomplete parameters.

<table><thead><tr><th width="131">code</th><th>description</th></tr></thead><tbody><tr><td>400</td><td>Bad Request: Used when the client's request is malformed or invalid.</td></tr><tr><td>401</td><td>Unauthorized: Used when the client is not authenticated or when the authentication token has expired.</td></tr><tr><td>404</td><td>Not Found: Used when the requested resource is not present on the server.</td></tr><tr><td>405</td><td>Method Not Allowed: Used when attempting to access a resource with an unsupported HTTP method.</td></tr><tr><td>429</td><td>Too Many Requests: Used when the client has sent too many requests within a given time frame, typically indicating exceeding request limits.</td></tr></tbody></table>

#### 3. 5xx: Server Error

* Indicates that there is an error on the opsnow\.io server.

<table><thead><tr><th width="122">code</th><th>description</th></tr></thead><tbody><tr><td>500</td><td>Internal Server Error: Used when an internal server error occurs. Specific details about the cause should be checked in the server logs.</td></tr><tr><td>503</td><td>Service Unavailable: Used when the server is temporarily unable to handle the request. This could occur, for example, when the server is overloaded or undergoing maintenance.</td></tr><tr><td>504</td><td>Gateway Timeout: Used when the server, acting as a gateway or proxy, did not receive a timely response from the upstream server.</td></tr></tbody></table>

opsnow\.io also outputs error messages and error codes in JSON format.

```
{
    "status": "fail",
    "error": {
        "code": 401,
        "message": "Unauthorized"
    }
}
```
