> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usedroptrail.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Handling

> Learn about UseDropTrail API error responses

The UseDropTrail API uses conventional HTTP response codes to indicate the success or failure of API requests.

## Response Codes

* `200` - OK: Request succeeded
* `201` - Created: Resource was successfully created
* `400` - Bad Request: Invalid request parameters or validation failed
* `401` - Unauthorized: Missing or invalid authentication
* `403` - Forbidden: Authenticated but insufficient permissions
* `404` - Not Found: Requested resource doesn't exist
* `429` - Too Many Requests: Rate limit exceeded
* `500` - Internal Server Error: Something went wrong on our end

## Error Response Format

When an error occurs, the API returns a JSON response with error details:

<ResponseField name="error" type="string">
  Error message
</ResponseField>

<ResponseField name="message" type="string">
  Detailed error description
</ResponseField>

<ResponseField name="status" type="number">
  HTTP status code
</ResponseField>

<ResponseField name="code" type="string">
  Error code
</ResponseField>

<ResponseField name="details" type="object">
  Additional error details

  <Expandable title="properties">
    <ResponseField name="field" type="string">
      Name of the field that caused the error
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Error Response

```json theme={null}
{
  "error": "Invalid request",
  "message": "The request is invalid",
  "status": 400,
  "code": "INVALID_REQUEST"
}
```

This response indicates that the request was invalid due to missing or incorrect parameters. The `error` field provides a concise message, while the `message` field offers a more detailed explanation. The `status` code is `400`, and the `code` is `INVALID_REQUEST`.

For more detailed information, you can refer to the `details` object, which includes the name of the field that caused the error.

This format helps you quickly identify and resolve issues in your API requests.
