---
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`

Sets artifact and log retention settings for a repository.

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