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

# Errors

> The IT Management API returns appropriate HTTP status codes and error messages when problems occur. It is important to properly handle these error responses when using the API.

## HTTP Status Codes

The API uses standard HTTP status codes. The following are commonly used status codes and their meanings:

| Status Code | Meaning               | Description                                                |
| ----------- | --------------------- | ---------------------------------------------------------- |
| 200         | OK                    | Request was successful                                     |
| 201         | Created               | Resource was successfully created                          |
| 204         | No Content            | Request was successful but there is no content             |
| 400         | Bad Request           | There is an error in the request (invalid parameter, etc.) |
| 401         | Unauthorized          | Authentication information is invalid or missing           |
| 403         | Forbidden             | No access permission                                       |
| 404         | Not Found             | The requested resource does not exist                      |
| 422         | Unprocessable Entity  | The request format is correct but semantically incorrect   |
| 429         | Too Many Requests     | Rate limit exceeded                                        |
| 500         | Internal Server Error | Server internal error                                      |

## Error Response Format

When an error occurs, the API returns a JSON response in the following format:

```json theme={null}
{
  "statusCode": 400,
  "errorId": "validation_exception",
  "message": "Validation failed",
  "errorDetails": [
    {
      "property": "email",
      "constraints": {
        "isEmail": "email must be an email"
      }
    }
  ]
}
```

### Response Fields

| Field          | Type    | Description                               |
| -------------- | ------- | ----------------------------------------- |
| `statusCode`   | integer | HTTP status code                          |
| `errorId`      | string  | Error identifier                          |
| `message`      | string  | Brief description of the error            |
| `errorDetails` | array   | Detailed error information (if available) |

## Common Errors

### Authentication Error (401)

```json theme={null}
{
  "statusCode": 401,
  "errorId": "unauthorized",
  "message": "Unauthorized"
}
```

Cause: API key is invalid or missing

### Permission Error (403)

```json theme={null}
{
  "statusCode": 403,
  "errorId": "forbidden",
  "message": "Forbidden"
}
```

Cause: No permission for the requested operation

### Validation Error (422)

```json theme={null}
{
  "statusCode": 422,
  "errorId": "validation_exception",
  "message": "Validation failed",
  "errorDetails": [
    {
      "property": "name",
      "constraints": {
        "minLength": "name must be longer than or equal to 1 characters"
      }
    }
  ]
}
```

Cause: Request parameters do not meet validation rules

## Error Handling Best Practices

1. Properly handle all HTTP status codes
2. Implement retry logic especially for 429 (rate limit) errors
3. Log error messages to help diagnose problems
4. Display user-friendly error messages to users
5. Do not include sensitive information in error messages
