---
title: "Set artifact and log retention settings for a repository"
method: PUT
path: "/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention"
tags: ["actions"]
---

# Set artifact and log retention settings for a repository

`PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`

## Request

- Base URL: `https://api.github.com`
- URL: `https://api.github.com/repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention`
- Auth: none declared

Sets retention settings for checks, workflow runs, commit statuses, artifacts, and logs for a repository.

Checks include check suites, check runs, and check annotations. These settings also apply to checks and commit statuses created by third-party integrations, and are not limited to data created by GitHub Actions.

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

## Path parameters

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

## Request body

- ActionsArtifactAndLogRetention
  - `days` integer, required: The number of days to retain checks, workflow runs, commit statuses, artifacts, and logs

## Response `204`

Empty response for successful settings update

## Other responses

- `404`: Resource not found
- `422`: Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.dev/github/apis/rest.md) · [All operations](https://skmtc.dev/github/apis/rest/llms.txt) · [OpenAPI document](https://skmtc.dev/github/apis/rest/revisions/309e30296b21?raw)
