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

# caches

> Isolated, TLS-only managed caches compatible with standard Redis clients. Durable append-only persistence is enabled by default.

Isolated, TLS-only managed caches compatible with standard Redis clients. Durable append-only persistence is enabled by default.

## caches.list

List managed caches in one project environment.

```text theme={null}
GET /v1/orgs/{orgId}/projects/{projectId}/caches
```

* **Auth:** Organization API key (`Authorization: Bearer korve_...`) or dashboard session.
* **Minimum role:** `member`
* **Risk:** `read`

### Query parameters

| Name          | Type   | Required | Description                        |
| ------------- | ------ | -------- | ---------------------------------- |
| `environment` | string | No       | Pattern: `^[a-z][a-z0-9-]{0,38}$`. |

### Example

```bash theme={null}
curl "https://api.korve.dev/v1/orgs/$ORG_ID/projects/$PROJECT_ID/caches?environment=example" \
  -H "Authorization: Bearer korve_..."
```

### Responses

| Status | Description             |
| ------ | ----------------------- |
| `200`  | Caches ordered by name. |

### Response body (200)

An array of objects with these fields:

| Field            | Type    | Description                                                         |
| ---------------- | ------- | ------------------------------------------------------------------- |
| `id`             | string  | —                                                                   |
| `name`           | string  | Pattern: `^[a-z][a-z0-9-]{1,61}$`.                                  |
| `environment`    | string  | —                                                                   |
| `status`         | string  | One of: `provisioning`, `ready`, `failed`.                          |
| `region`         | string  | —                                                                   |
| `sku`            | string  | —                                                                   |
| `memoryMb`       | integer | —                                                                   |
| `persistence`    | string  | One of: `none`, `aof`.                                              |
| `evictionPolicy` | string  | One of: `allkeys-lru`, `allkeys-lfu`, `volatile-lru`, `noeviction`. |
| `host`           | string  | Branded TLS cache endpoint.                                         |
| `port`           | integer | —                                                                   |
| `tls`            | boolean | —                                                                   |
| `createdAt`      | string  | Format: `date-time`.                                                |

## caches.create

Provision an isolated TLS cache and issue its connection string once.

```text theme={null}
POST /v1/orgs/{orgId}/projects/{projectId}/caches
```

* **Auth:** Organization API key (`Authorization: Bearer korve_...`) or dashboard session.
* **Minimum role:** `admin`
* **Billing:** requires active organization billing — returns `402` otherwise.
* **Risk:** `write`

### Query parameters

| Name          | Type   | Required | Description                        |
| ------------- | ------ | -------- | ---------------------------------- |
| `environment` | string | No       | Pattern: `^[a-z][a-z0-9-]{0,38}$`. |

### Request body

| Field            | Type   | Required | Description                                                         |
| ---------------- | ------ | -------- | ------------------------------------------------------------------- |
| `name`           | string | Yes      | Pattern: `^[a-z][a-z0-9-]{1,61}$`.                                  |
| `sku`            | string | Yes      | One of: `cache-n1`, `cache-s1`, `cache-s2`.                         |
| `region`         | string | Yes      | —                                                                   |
| `persistence`    | string | No       | One of: `none`, `aof`.                                              |
| `evictionPolicy` | string | No       | One of: `allkeys-lru`, `allkeys-lfu`, `volatile-lru`, `noeviction`. |

### Example

```bash theme={null}
curl -X POST "https://api.korve.dev/v1/orgs/$ORG_ID/projects/$PROJECT_ID/caches?environment=example" \
  -H "Authorization: Bearer korve_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "example",
  "sku": "cache-n1",
  "region": "example"
}'
```

### Responses

| Status | Description                               |
| ------ | ----------------------------------------- |
| `201`  | Cache provisioned and credentials issued. |
| `409`  | The cache name already exists.            |
| `422`  | Invalid cache configuration.              |

### Response body (201)

| Field              | Type   | Description                                                               |
| ------------------ | ------ | ------------------------------------------------------------------------- |
| `id`               | string | —                                                                         |
| `name`             | string | —                                                                         |
| `status`           | string | One of: `provisioning`, `ready`, `failed`.                                |
| `connectionString` | string | A rediss\:// URL shown exactly once. Rotate credentials to issue another. |

## caches.get

Get managed cache configuration without credentials.

```text theme={null}
GET /v1/orgs/{orgId}/projects/{projectId}/caches/{cacheId}
```

* **Auth:** Organization API key (`Authorization: Bearer korve_...`) or dashboard session.
* **Minimum role:** `member`
* **Risk:** `read`

### Example

```bash theme={null}
curl "https://api.korve.dev/v1/orgs/$ORG_ID/projects/$PROJECT_ID/caches/$CACHE_ID" \
  -H "Authorization: Bearer korve_..."
```

### Responses

| Status | Description          |
| ------ | -------------------- |
| `200`  | Cache configuration. |
| `404`  | No such cache.       |

### Response body (200)

| Field            | Type    | Description                                                         |
| ---------------- | ------- | ------------------------------------------------------------------- |
| `id`             | string  | —                                                                   |
| `name`           | string  | Pattern: `^[a-z][a-z0-9-]{1,61}$`.                                  |
| `environment`    | string  | —                                                                   |
| `status`         | string  | One of: `provisioning`, `ready`, `failed`.                          |
| `region`         | string  | —                                                                   |
| `sku`            | string  | —                                                                   |
| `memoryMb`       | integer | —                                                                   |
| `persistence`    | string  | One of: `none`, `aof`.                                              |
| `evictionPolicy` | string  | One of: `allkeys-lru`, `allkeys-lfu`, `volatile-lru`, `noeviction`. |
| `host`           | string  | Branded TLS cache endpoint.                                         |
| `port`           | integer | —                                                                   |
| `tls`            | boolean | —                                                                   |
| `createdAt`      | string  | Format: `date-time`.                                                |

## caches.rotateCredentials

Replace the cache password and issue a new rediss\:// connection string once.

```text theme={null}
POST /v1/orgs/{orgId}/projects/{projectId}/caches/{cacheId}/credentials/rotate
```

* **Auth:** Organization API key (`Authorization: Bearer korve_...`) or dashboard session.
* **Minimum role:** `admin`
* **Billing:** requires active organization billing — returns `402` otherwise.
* **Risk:** `write` · sensitive (elevated blast radius)

### Example

```bash theme={null}
curl -X POST "https://api.korve.dev/v1/orgs/$ORG_ID/projects/$PROJECT_ID/caches/$CACHE_ID/credentials/rotate" \
  -H "Authorization: Bearer korve_..."
```

### Responses

| Status | Description      |
| ------ | ---------------- |
| `200`  | New credentials. |
| `404`  | No such cache.   |

### Response body (200)

| Field              | Type   | Description                                                               |
| ------------------ | ------ | ------------------------------------------------------------------------- |
| `id`               | string | —                                                                         |
| `name`             | string | —                                                                         |
| `status`           | string | One of: `provisioning`, `ready`, `failed`.                                |
| `connectionString` | string | A rediss\:// URL shown exactly once. Rotate credentials to issue another. |

## caches.delete

Permanently delete a cache and its persisted data.

```text theme={null}
DELETE /v1/orgs/{orgId}/projects/{projectId}/caches/{cacheId}
```

* **Auth:** Organization API key (`Authorization: Bearer korve_...`) or dashboard session.
* **Minimum role:** `owner`
* **Risk:** `destructive` · sensitive (elevated blast radius)

### Example

```bash theme={null}
curl -X DELETE "https://api.korve.dev/v1/orgs/$ORG_ID/projects/$PROJECT_ID/caches/$CACHE_ID" \
  -H "Authorization: Bearer korve_..."
```

### Responses

| Status | Description    |
| ------ | -------------- |
| `200`  | Cache deleted. |
| `404`  | No such cache. |
