# Organization API: Organization deployments: Cache

> The 3 Organization API operations for cache.

Source: https://www.coritan.com/docs/api/reference/organizations/organization-deployments/deployments-cache/

Part of [Organization deployments](/docs/api/reference/organizations/organization-deployments/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/cache`](#op-get-api-v1-orgs-org-slug-deployments-deployment-uuid-cache) | Get cache |
| PUT | [`/api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/cache`](#op-put-api-v1-orgs-org-slug-deployments-deployment-uuid-cache) | Change cache settings |
| POST | [`/api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/cache/purge`](#op-post-api-v1-orgs-org-slug-deployments-deployment-uuid-cache-purge) | Purge cache |

### Get cache {#op-get-api-v1-orgs-org-slug-deployments-deployment-uuid-cache}

`GET /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/cache`

Whether the edge keeps copies of what the deployment marks cacheable
and for how long (0 follows its own headers); null while it has no
address.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `deployment_uuid` | path | string (uuid) | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Change cache settings {#op-put-api-v1-orgs-org-slug-deployments-deployment-uuid-cache}

`PUT /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/cache`

Change what the body names on every address. 409 while it has no
address; 402 without ``cache_controls`` on the owner's plan.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `deployment_uuid` | path | string (uuid) | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `cache_enabled` | boolean or null | no | Left out: kept |
| `cache_max_age` | integer or null | no | Seconds; 0 follows the deployment's own headers. Left out: kept |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Purge cache {#op-post-api-v1-orgs-org-slug-deployments-deployment-uuid-cache-purge}

`POST /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/cache/purge`

Drop every copy the edge keeps of the deployment's answers, for each
of its addresses on every edge node; each comes from the deployment
again on its next request. 402 without ``cache_controls`` on the
owner's plan; 409 while it has no address; 30 purges per deployment an
hour, then 429. ``failed`` lists the addresses whose purge could not
be sent.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `deployment_uuid` | path | string (uuid) | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
