Sample - GitHub REST API
GET/repos/{owner}/{repo}/actions/caches

List GitHub Actions caches for a repository

Lists the GitHub Actions caches for a repository.

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

8 parameters
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
per_pageintegeroptional
The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Default:30
pageintegeroptional
The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Default:1
refstringoptional
The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/<branch name>`. To reference a pull request use `refs/pull/<number>/merge`.
keystringoptional
An explicit key or prefix for identifying the cache
sortstringoptional
The property to sort the results by. `created_at` means when the cache was created. `last_accessed_at` means when the cache was last accessed. `size_in_bytes` is the size of the cache in bytes.
Allowed:created_atlast_accessed_atsize_in_bytesDefault:last_accessed_at
directionstringoptional
The direction to sort the results by.
Allowed:ascdescDefault:desc

1 status code
200Response
total_countintegerrequired
Total number of caches
actions_cachesarray<object>required
Array of caches