---
title: "Set GitHub Actions cache retention limit for an organization"
method: PUT
path: "/organizations/{org}/actions/cache/retention-limit"
tags: ["actions"]
---

# Set GitHub Actions cache retention limit for an organization

`PUT /organizations/{org}/actions/cache/retention-limit`

Sets GitHub Actions cache retention limit for an organization. All repositories under this
organization may not set a higher cache retention limit.

OAuth tokens and personal access tokens (classic) need the `admin:organization` scope to use this endpoint.

## Path parameters

- `org` string, required

## Request body

- ActionsCacheRetentionLimitForOrganization — GitHub Actions cache retention policy for an organization.
  - `max_cache_retention_days` integer — For repositories in this organization, the maximum duration, in days, for which caches in a repository may be retained.

## Response `204`

Response

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Resource not found

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-3.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-3/versions/dc0584ac4e13/schema)
