Skip to main content
Skip to content
Ahora la API REST está versionada. Para obtener más información, consulta "Acerca del control de versiones de la API".

Puntos de conexión de la API REST para la caché de Acciones de GitHub

Use la API REST para interactuar con la memoria caché de los repositorios en GitHub Actions.

Acerca de la caché en GitHub Actions

Puede usar la API REST para consultar y administrar la memoria caché de los repositorios en GitHub Actions. También puede instalar una GitHub CLI extensión para administrar las memorias caché desde la línea de comandos. Para más información, consulta Referencia de almacenamiento en caché de dependencias.

Get GitHub Actions cache retention limit for an enterprise

Gets GitHub Actions cache retention limit for an enterprise. All organizations and repositories under this enterprise may not set a higher cache retention limit.

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

Tokens de acceso granulares para "Get GitHub Actions cache retention limit for an enterprise"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Enterprise administration" enterprise permissions (write)

Parámetros para "Get GitHub Actions cache retention limit for an enterprise"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
enterprise string Obligatorio

The slug version of the enterprise name.

Códigos de estado de respuesta HTTP para "Get GitHub Actions cache retention limit for an enterprise"

código de estadoDescripción
200

OK

403

Forbidden

404

Resource not found

Ejemplos de código para "Get GitHub Actions cache retention limit for an enterprise"

Ejemplo de solicitud

get/enterprises/{enterprise}/actions/cache/retention-limit
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/actions/cache/retention-limit

Response

Status: 200
{ "max_cache_retention_days": 80 }

Set GitHub Actions cache retention limit for an enterprise

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

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

Tokens de acceso granulares para "Set GitHub Actions cache retention limit for an enterprise"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Enterprise administration" enterprise permissions (write)

Parámetros para "Set GitHub Actions cache retention limit for an enterprise"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
enterprise string Obligatorio

The slug version of the enterprise name.

Parámetros del cuerpo
Nombre, Tipo, Descripción
max_cache_retention_days integer

For repositories & organizations in an enterprise, the maximum duration, in days, for which caches in a repository may be retained.

Códigos de estado de respuesta HTTP para "Set GitHub Actions cache retention limit for an enterprise"

código de estadoDescripción
204

No Content

400

Bad Request

403

Forbidden

404

Resource not found

Ejemplos de código para "Set GitHub Actions cache retention limit for an enterprise"

Ejemplo de solicitud

put/enterprises/{enterprise}/actions/cache/retention-limit
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/actions/cache/retention-limit \ -d '{"max_cache_retention_days":80}'

Response

Status: 204

Get GitHub Actions cache storage limit for an enterprise

Gets GitHub Actions cache storage limit for an enterprise. All organizations and repositories under this enterprise may not set a higher cache storage limit.

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

Tokens de acceso granulares para "Get GitHub Actions cache storage limit for an enterprise"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Enterprise administration" enterprise permissions (write)

Parámetros para "Get GitHub Actions cache storage limit for an enterprise"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
enterprise string Obligatorio

The slug version of the enterprise name.

Códigos de estado de respuesta HTTP para "Get GitHub Actions cache storage limit for an enterprise"

código de estadoDescripción
200

OK

403

Forbidden

404

Resource not found

Ejemplos de código para "Get GitHub Actions cache storage limit for an enterprise"

Ejemplo de solicitud

get/enterprises/{enterprise}/actions/cache/storage-limit
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/actions/cache/storage-limit

Response

Status: 200
{ "max_cache_size_gb": 150 }

Set GitHub Actions cache storage limit for an enterprise

Sets GitHub Actions cache storage limit for an enterprise. All organizations and repositories under this enterprise may not set a higher cache storage limit.

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

Tokens de acceso granulares para "Set GitHub Actions cache storage limit for an enterprise"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Enterprise administration" enterprise permissions (write)

Parámetros para "Set GitHub Actions cache storage limit for an enterprise"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
enterprise string Obligatorio

The slug version of the enterprise name.

Parámetros del cuerpo
Nombre, Tipo, Descripción
max_cache_size_gb integer

For repositories & organizations in an enterprise, the maximum size limit for the sum of all caches in a repository, in gigabytes.

Códigos de estado de respuesta HTTP para "Set GitHub Actions cache storage limit for an enterprise"

código de estadoDescripción
204

No Content

400

Bad Request

403

Forbidden

404

Resource not found

Ejemplos de código para "Set GitHub Actions cache storage limit for an enterprise"

Ejemplo de solicitud

put/enterprises/{enterprise}/actions/cache/storage-limit
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/enterprises/ENTERPRISE/actions/cache/storage-limit \ -d '{"max_cache_size_gb":150}'

Response

Status: 204

Get GitHub Actions cache retention limit for an organization

Gets 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.

Tokens de acceso granulares para "Get GitHub Actions cache retention limit for an organization"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Administration" organization permissions (read)

Parámetros para "Get GitHub Actions cache retention limit for an organization"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
org string Obligatorio

The organization name. The name is not case sensitive.

Códigos de estado de respuesta HTTP para "Get GitHub Actions cache retention limit for an organization"

código de estadoDescripción
200

OK

403

Forbidden

404

Resource not found

Ejemplos de código para "Get GitHub Actions cache retention limit for an organization"

Ejemplo de solicitud

get/organizations/{org}/actions/cache/retention-limit
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/organizations/ORG/actions/cache/retention-limit

Response

Status: 200
{ "max_cache_retention_days": 80 }

Set GitHub Actions cache retention limit for an organization

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.

Tokens de acceso granulares para "Set GitHub Actions cache retention limit for an organization"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Administration" organization permissions (write)

Parámetros para "Set GitHub Actions cache retention limit for an organization"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
org string Obligatorio

The organization name. The name is not case sensitive.

Parámetros del cuerpo
Nombre, Tipo, Descripción
max_cache_retention_days integer

For repositories in this organization, the maximum duration, in days, for which caches in a repository may be retained.

Códigos de estado de respuesta HTTP para "Set GitHub Actions cache retention limit for an organization"

código de estadoDescripción
204

No Content

400

Bad Request

403

Forbidden

404

Resource not found

Ejemplos de código para "Set GitHub Actions cache retention limit for an organization"

Ejemplo de solicitud

put/organizations/{org}/actions/cache/retention-limit
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/organizations/ORG/actions/cache/retention-limit \ -d '{"max_cache_retention_days":80}'

Response

Status: 204

Get GitHub Actions cache storage limit for an organization

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

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

Tokens de acceso granulares para "Get GitHub Actions cache storage limit for an organization"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Administration" organization permissions (read)

Parámetros para "Get GitHub Actions cache storage limit for an organization"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
org string Obligatorio

The organization name. The name is not case sensitive.

Códigos de estado de respuesta HTTP para "Get GitHub Actions cache storage limit for an organization"

código de estadoDescripción
200

OK

403

Forbidden

404

Resource not found

Ejemplos de código para "Get GitHub Actions cache storage limit for an organization"

Ejemplo de solicitud

get/organizations/{org}/actions/cache/storage-limit
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/organizations/ORG/actions/cache/storage-limit

Response

Status: 200
{ "max_cache_size_gb": 150 }

Set GitHub Actions cache storage limit for an organization

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

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

Tokens de acceso granulares para "Set GitHub Actions cache storage limit for an organization"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Administration" organization permissions (write)

Parámetros para "Set GitHub Actions cache storage limit for an organization"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
org string Obligatorio

The organization name. The name is not case sensitive.

Parámetros del cuerpo
Nombre, Tipo, Descripción
max_cache_size_gb integer

For repositories in the organization, the maximum size limit for the sum of all caches in a repository, in gigabytes.

Códigos de estado de respuesta HTTP para "Set GitHub Actions cache storage limit for an organization"

código de estadoDescripción
204

No Content

400

Bad Request

403

Forbidden

404

Resource not found

Ejemplos de código para "Set GitHub Actions cache storage limit for an organization"

Ejemplo de solicitud

put/organizations/{org}/actions/cache/storage-limit
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/organizations/ORG/actions/cache/storage-limit \ -d '{"max_cache_size_gb":150}'

Response

Status: 204

Get GitHub Actions cache usage for an organization

Gets the total GitHub Actions cache usage for an organization. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.

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

Tokens de acceso granulares para "Get GitHub Actions cache usage for an organization"

Este punto de conexión funciona con los siguientes tipos de token pormenorizados:

El token pormenorizado debe tener el siguiente conjunto de permisos:

  • "Administration" organization permissions (read)

Parámetros para "Get GitHub Actions cache usage for an organization"

Encabezados
Nombre, Tipo, Descripción
accept string

Setting to application/vnd.github+json is recommended.

Parámetros de ruta
Nombre, Tipo, Descripción
org string Obligatorio

The organization name. The name is not case sensitive.

Códigos de estado de respuesta HTTP para "Get GitHub Actions cache usage for an organization"

código de estadoDescripción
200

OK

Ejemplos de código para "Get GitHub Actions cache usage for an organization"

Ejemplo de solicitud

get/orgs/{org}/actions/cache/usage
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/actions/cache/usage

Response