---
title: "Get GitHub Actions cache retention limit for a repository"
method: GET
path: "/repos/{owner}/{repo}/actions/cache/retention-limit"
tags: ["actions"]
---

# Get GitHub Actions cache retention limit for a repository

`GET /repos/{owner}/{repo}/actions/cache/retention-limit`

Gets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if
not manually removed or evicted due to size constraints.

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

## Path parameters

- `owner` string, required
- `repo` string, required

## Response `200`

Response

- ActionsCacheRetentionLimitForRepository — GitHub Actions cache retention policy for a repository.
  - `max_cache_retention_days` integer — The maximum number of days to keep caches in this repository.

## Other responses

- `403` — Forbidden
- `404` — Resource not found

---

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