> For the complete documentation index, see [llms.txt](https://docs.k9.io/key9-identity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.k9.io/key9-identity/jsonair/3-using-the-api/3.2-make-api-requests.md).

# 3.2 Making API Requests

All endpoints below require a valid JWT in the `Authorization` header. See [3.1 Authentication](/key9-identity/jsonair/3-using-the-api/3.1-authentication.md) for how to obtain one.

***

## Get Configuration Data

Retrieves the stored configuration for a given type and name.

**Endpoint:** `GET /api/v1/jsonair/config`

**Request body:**

```json
{
  "type": "myapp",
  "name": "prod.yaml",
  "decode": false
}
```

| Field    | Type   | Required | Description                                                                             |
| -------- | ------ | -------- | --------------------------------------------------------------------------------------- |
| `type`   | string | Yes      | Configuration type (e.g. `suricata`, `nginx`, `myapp`)                                  |
| `name`   | string | Yes      | Configuration name (e.g. `prod.yaml`, `settings.json`)                                  |
| `decode` | bool   | No       | If `true`, the server Base64-decodes the data before returning it. Defaults to `false`. |

**Successful response (200 OK):**

When `decode` is `false` (default), the raw Base64-encoded configuration data is returned as plain text:

```
eyJrZXkiOiJ2YWx1ZSJ9
```

When `decode` is `true`, the decoded configuration is returned directly:

```json
{"key":"value"}
```

**Not found (404):**

```json
{
  "error": "not found"
}
```

***

## Get the Reload Key

Retrieves the `reload` field for a given configuration. This can be used by agents to determine whether to trigger a reload of the consuming application.

**Endpoint:** `GET /api/v1/jsonair/reload`

**Request body:**

```json
{
  "type": "myapp",
  "name": "prod.yaml"
}
```

**Successful response (200 OK):**

```json
{
  "reload": "RELOADKEY"
}
```

***

## Get the Debug Level

Retrieves the `debug` field for a given configuration. Agents can use this to dynamically adjust their logging verbosity without restarting.

**Endpoint:** `GET /api/v1/jsonair/debug`

**Request body:**

```json
{
  "type": "myapp",
  "name": "prod.yaml"
}
```

**Successful response (200 OK):**

```json
{
  "debug": "INFO"
}
```

***

## Error Responses

| HTTP Status                 | Meaning                                             |
| --------------------------- | --------------------------------------------------- |
| `400 Bad Request`           | Request body could not be read                      |
| `401 Unauthorized`          | Missing, expired, or invalid JWT                    |
| `404 Not Found`             | No configuration found for the given type/name/uuid |
| `429 Too Many Requests`     | Rate limit exceeded (auth endpoint only)            |
| `500 Internal Server Error` | Unexpected server error                             |
