# Custom TTL for artifacts

**URL:** <https://forum.buildkite.community/t/custom-ttl-for-artifacts/2534>\
**Category:** Features Requests\
**Created:** [February 4, 2023, 12:40am UTC](https://forum.buildkite.community/t/custom-ttl-for-artifacts/2534 "2023-02-04T00:40:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charliekenney23](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/charliekenney23/32/1194_2.png) [@charliekenney23](https://forum.buildkite.community/u/charliekenney23)\
**Post date:** [February 4, 2023, 12:40am UTC](https://forum.buildkite.community/t/custom-ttl-for-artifacts/2534/1 "2023-02-04T00:40:00Z")

</div>

It’d be really nice to be able to set a time to live for buildkite artifacts.

I don’t use artifacts for long term storage and could absolutely have artifacts I’d be willing to delete immediately after the pipeline finishes.

This is not a request to increase the current 6 month ttl.

It’d be nice to be able to do something like this:

```shell
# ...

ttl=$(TZ=UTC date --date="1 hour")
buildkite-agent artifact upload --ttl="$ttl" path/to/artifact

```

---

<div class="post-metadata">

**Author:** ![karen.sawrey](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/karen.sawrey/32/1188_2.png) [@karen.sawrey](https://forum.buildkite.community/u/karen.sawrey)\
**Post date:** [February 6, 2023, 6:58pm UTC](https://forum.buildkite.community/t/custom-ttl-for-artifacts/2534/2 "2023-02-06T18:58:57Z")

</div>

Hello, @charliekenney23! Welcome to the community!  
To speed up the deletion of your artifacts, you can [delete artifacts using REST API](https://buildkite.com/docs/apis/rest-api/artifacts#delete-an-artifact):

`
curl -X DELETE "http://api.buildkite.com/v2/organizations/{artifact.job.build.project.account.slug}/pipelines/{artifact.job.build.project.slug}/builds/{artifact.job.build.number}/jobs/{artifact.job.uuid}/artifacts/{artifact.uuid}?access_token={access_token.token}
`

You can schedule the deletion process to run after the pipeline has finished or within the desired time frame of up to six months.

Cheers!
