---
title: Errors
slug: fourkites-api-reference/yn-errors
description: Learn about the different error formats - default and custom errors - that can occur across various requests. Understand how the default error comprises a concise error message, while the custom error includes additional information such as error code, me
createdAt: 2023-04-14T06:59:53.000Z
---

Each request has specific errors that are detailed throughout the documentation. This document contains a general description of errors that could occur across all request types and a description of the common error response format.

There are **two errors formats** which denote generic/default and custom errors which can be resource or action specific.

### Default Error

**Default Error Response Attributes:**

`message` - Contains brief information about the nature of the error

### Custom Error

**Custom Error Response Attributes:**

1. `errorCode` - This a custom Error Code that is returned to provide more context. This is not directly related to a HTTP Status Code as it can mean request or resource specific errors as described below.
2. `errorMessage` - The summary of the error which occurred.
3. `errorDetails` - Detailed information about the nature of the error. This can contain FourKites® specific errors such as **request validation**, which will help understand and fix
4. `occuredAt` - The timestamp in UTC of when the error occurred. This can be used for analysis along with the requestId.
5. `requestId` - If you need to contact us about a specific request, providing this request identifier will ensure quick resolution.

**Custom Error Codes:**

| Error Code | Error Message                  | Equivalent HTTP Status Code |
| ---------- | ------------------------------ | --------------------------- |
| 2001       | Message Not Readable           | 400                         |
| 2002       | Validation Exception           | 400                         |
| 2003       | Method not supported           | 405                         |
| 8886       | Resource Not Found             | 404                         |
| 8887       | Access Denied                  | 403                         |
| 9999       | An Internal Error Has Occurred | 500                         |

### Sample Default Error

```javascript
{
  "message": "No API key found in request"
}

```

### Sample Custom Error

```javascript
{
  "errorCode": 2002,
  "errorDetails": ["Invalid value for param: shipment.type"],
  "errorMessage": "Validation Exception",
  "occurredAt": "2020-07-28T06:46:30Z",
  "requestId": "brlfhvhghpuac6sl1jrg"
}
```

