> For the complete documentation index, see [llms.txt](https://docs.hokey.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hokey.io/errors.md).

# Errors

Hokey uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the `2xx` range indicate success. Codes in the `4xx` range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the `5xx` range indicate an error with our servers (these are rare).

### Error Object

```json
{
    "type" : "https://tools.ietf.org/...",
    "title" : "error title",
    "status" : 400,
    "traceId" : "00-81...",
    "errors" : [
        "Url" : [
            "The Url field is required"
        ]
    ]
}
```

#### Attributes

**type** string\
A http reference to IETF based expectations.

**title** string\
A friendly title of the error.

**status** int\
A number of the HTTP status returned.

**traceId** string\
An Id for referencing the error. Use this when contacting our support.

**errors** dictionary\
A dictionary by key and array of errors. The key indicate the field of error.

### Status Summary

| Status             | Description                                                 |
| ------------------ | ----------------------------------------------------------- |
| 200 - OK           | Everything worked as expected.                              |
| 204 - Created      | Resource is created.                                        |
| 400 - Bad Request  | The request was unacceptable. Review the error object.      |
| 401 - Unauthorized | The provided API key is wrong.                              |
| 403 - Forbidden    | The API key does not have permissions for the given action. |
| 500 - Server error | Something went wrong at our servers.                        |
