# Errors

ITCare API uses conventional HTTP response codes to indicate the success or failure of an API request.

As a general rule:

* Codes in the **`2xx`** range indicate success.
* Codes in the **`4xx`** range indicate incorrect or incomplete parameters (e.g. a required parameter was omitted, or an operation failed with a 3rd party, etc.).
* Codes in the **`5xx`** range indicate an error with ITCare's servers.

This table shows more exemples about HTTP response codes

<table><thead><tr><th width="133.33333333333331">Code</th><th>Description</th><th>Reponse body</th></tr></thead><tbody><tr><td><code>200</code></td><td>Request successfully processed</td><td>Varies depending on what was</td></tr><tr><td><code>201</code></td><td>Successfully created object</td><td>Object created</td></tr><tr><td><code>202</code></td><td>Order of creation of the object successfully processed, the request will be processed asynchronously</td><td>Empty or tracking object describing the processing of the asynchronous request</td></tr><tr><td><code>400</code></td><td>Bad query - Syntax or consistency error in the query. Must be corrected by the issuer</td><td>Blank or indication of the error to be corrected on the client side</td></tr><tr><td><code>401</code></td><td>Unauthenticated access to the resource</td><td>Empty</td></tr><tr><td><code>403</code></td><td>Unauthorized access</td><td>Empty</td></tr><tr><td><code>404</code></td><td>Non-existent resource</td><td>Empty</td></tr><tr><td><code>409</code></td><td>Conflict</td><td>Empty</td></tr><tr><td><code>422</code></td><td>Inconsistent data</td><td>Empty</td></tr><tr><td><code>500</code></td><td>Fatal API error</td><td>Empty</td></tr><tr><td><code>503</code></td><td>Service temporarily unavailable</td><td>Empty</td></tr></tbody></table>

ITCare also outputs an error message and an error code formatted in JSON:

```json

{
    "status": "BAD_REQUEST",
    "errorCode": "INVALID_FIELD_VALUE",
    "errorDesc": "name",
    "errorMessage": "Error on field 'name'
}


```
