Skip to content

Delete build cache entries of a CI runner pool

DELETE
/api/v3/organizations/{organisation}/resources/{resource}/cache
curl --request DELETE \
--url https://dashboard.quantcdn.io/api/v3/organizations/test-org/resources/cr-0123456789abcdef/cache \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "repoId": 123456, "ref": "refs/heads/main", "version": "a1b2c3", "key": "node-cache-Linux-x64-npm-abc" }'

Deletes the part of the pool’s build cache that the body names: one entry (repoId, ref, version and key), one version of a ref (repoId, ref, version), one ref (repoId, ref), one repository (repoId) or, with exactly {“all”: true}, the whole cache. A missing or empty body is refused. Only the named scope is deleted; a delete is permanent, and a later job saves a new entry. A large delete stops after about 12 seconds and returns complete false with what it deleted so far; send the same request again until complete is true. complete false means: send the same request again. If a call returns complete false with deletedEntries 0, stop and try again later, because a storage call failed, timed out or refused objects. After a 502 the delete may still be running on the platform; the request is idempotent, so a client can send the same request again.

organisation
required
string

The organisation ID

Example
test-org
resource
required
string

The CI runner pool resource ID

Example
cr-0123456789abcdef
Media typeapplication/json
CI build cache delete scope

The scope to delete: either {“all”: true} alone (the whole cache of the pool), or repoId with optionally ref, version and key, where a field needs every field before it (repoId, ref, version, key). An empty object is refused.

object
>= 1 properties
all

True clears the whole cache of the pool. Must be the only field.

boolean
repoId

GitHub repository id. A digit string is also accepted.

integer format: int64
ref

Git ref; starts with refs/, a valid git ref name without %.

string
<= 512 characters
version
string
/^[A-Za-z0-9]{1,128}$/
key

The exact cache key. Deletes only that entry, not keys that start with it.

string
>= 1 characters <= 512 characters
Examples

One entry

{
"repoId": 123456,
"ref": "refs/heads/main",
"version": "a1b2c3",
"key": "node-cache-Linux-x64-npm-abc"
}

Deleted

Media typeapplication/json
CI build cache delete result
object
deletedEntries
required
integer format: int64
deletedBytes
required
integer format: int64
complete
required

False when the delete stopped at its time limit (about 12 seconds), a storage call failed or timed out, or storage refused some objects. false means: send the same request again until it is true. If a call returns false with deletedEntries 0, stop and try again later, because a storage call failed, timed out or refused objects.

boolean
Examplegenerated
{
"deletedEntries": 1,
"deletedBytes": 1,
"complete": true
}

The platform refused the scope

The delete_applications permission and the cloud:write scope are required

Resource not found, the resource is not a CI runner pool, or the organisation does not have CI runners

The body is missing, empty or not a JSON object; all is not exactly true or is sent with another field; the body has an unknown field, an invalid field, or a field without the fields it needs (key needs repoId, ref and version; version needs repoId and ref; ref needs repoId)

The build cache service is unavailable