# Status Codes

> HTTP status codes returned by the Fleetwork API.

Source: https://docs.fleetwork.vn/en/introduction/status-codes

## Success Codes

| Code | Meaning | Description |
|---|---|---|
| `200` | OK | Request succeeded |
| `201` | Created | Resource was created |
| `204` | No Content | Request succeeded, no body returned |

## Client Error Codes

| Code | Meaning | Description |
|---|---|---|
| `400` | Bad Request | Invalid parameters or malformed JSON |
| `401` | Unauthorized | Missing/invalid API key or no module access |
| `403` | Forbidden | Insufficient permissions |
| `404` | Not Found | Resource does not exist |
| `409` | Conflict | Resource state conflict (e.g., duplicate entry) |
| `422` | Unprocessable | Validation failed |
| `429` | Too Many Requests | Rate limit or quota exceeded |

## Server Error Codes

| Code | Meaning | Description |
|---|---|---|
| `500` | Internal Error | Something went wrong on our side |
| `502` | Bad Gateway | Upstream service error |
| `503` | Service Unavailable | Temporary outage |

## Error Response Format

All errors return a consistent JSON structure:

```json
{
  "code": "BAD_REQUEST",
  "message": "The field 'name' is required.",
  "data": null
}
```

### 401 Unauthorized Example

```json
{
  "error": "unauthorized",
  "message": "No access to module: Driving Alert",
  "status": "Invalid - No Active Modules",
  "errors": ["API key does not have access to module: Driving Alert"],
  "warnings": []
}
```

### 429 Rate Limit Exceeded

```json
{
  "error": "rate_limit_exceeded",
  "message": "Rate limit exceeded: 10 requests per second",
  "limit": 10,
  "reset_at": "2026-04-15T09:31:00Z",
  "retry_after": "2026-04-15T09:31:00Z"
}
```

### 429 Quota Exceeded

```json
{
  "error": "quota_exceeded",
  "message": "Monthly quota exceeded",
  "limit": 100000,
  "used": 100001
}
```
