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

# Status Codes and Errors

> Understand HTTP status codes, error responses, and retry recommendations for the Good Grants API.

## Response status codes

The API uses conventional HTTP status codes to indicate success or failure:

### Success codes

| Status code                      | Name       | Description                                                                                 |
| :------------------------------- | :--------- | :------------------------------------------------------------------------------------------ |
| <Badge color="green">200</Badge> | OK         | The request has succeeded.                                                                  |
| <Badge color="green">201</Badge> | CREATED    | The request has succeeded and a new resource has been created as a result.                  |
| <Badge color="green">204</Badge> | NO CONTENT | The request has succeeded but there is no content to send in the response for this request. |

### Error codes

| Status code                    | Name                  | Description                                                                                                       |
| :----------------------------- | :-------------------- | :---------------------------------------------------------------------------------------------------------------- |
| <Badge color="red">400</Badge> | BAD REQUEST           | The server could not understand the request due to invalid syntax.                                                |
| <Badge color="red">401</Badge> | UNAUTHORIZED          | The request has not been applied because it lacks valid authentication credentials for the target resource.       |
| <Badge color="red">403</Badge> | FORBIDDEN             | The server understood the request but refuses to authorize it. Check your API key scope.                          |
| <Badge color="red">404</Badge> | NOT FOUND             | The requested resource doesn't exist.                                                                             |
| <Badge color="red">409</Badge> | CONFLICT              | The request conflicts with the current state of the server.                                                       |
| <Badge color="red">413</Badge> | PAYLOAD TOO LARGE     | The request entity is larger than the limits defined by the server (256 MB max for file uploads).                 |
| <Badge color="red">422</Badge> | UNPROCESSABLE ENTITY  | The request was well-formed but was unable to be followed due to semantic errors.                                 |
| <Badge color="red">429</Badge> | TOO MANY REQUESTS     | You have sent too many requests in a given amount of time. See the `Retry-After` header.                          |
| <Badge color="red">500</Badge> | INTERNAL SERVER ERROR | Something went wrong on the server.                                                                               |
| <Badge color="red">503</Badge> | SERVICE UNAVAILABLE   | The service is temporarily unavailable. Check [status.goodgrants.com](https://status.goodgrants.com) for updates. |

## Error responses

When a request fails, the response includes an error object with details:

<ResponseField name="message" type="string">
  Human-readable error message.
</ResponseField>

<ResponseField name="errors" type="object">
  Object containing specific error details, including field-level validation errors.
</ResponseField>

<ResponseField name="status_code" type="integer">
  HTTP status code.
</ResponseField>

### Example error response

```json Response theme={null}
{
  "message": "Invalid filter names and / or values.",
  "errors": {
    "invalid_filter_values": {
      "per_page": "Value must be a number. You provided [abc].",
      "category": "Value is not a valid slug. Must contain only letters and be exactly 8 characters long."
    }
  },
  "status_code": 400
}
```
