Skip to content

Actions

Delete every cache entry whose key is exactly key, or only ref's when you give ref.

DELETE/repos/{owner}/{name}/actions/caches

Answers with the entries deleted, in list_caches’ shape. Their bytes go at once, and a run that restores the key finds nothing until one saves it again. Needs the Write role.

The key is matched exactly. Without ref, the key’s entries on every ref are deleted.

  • Authentication: Required. Send an access token as Authorization: Bearer.
  • MCP tool: workflow with action delete_caches, and the same inputs
  • Scope: An access token needs workflows:write.
Name Type Required Description
owner string Yes The workspace that owns the repository.
name string Yes The repository’s name.

Send a JSON object. Names are snake_case, as in responses; the camelCase spelling is accepted too.

Name Type Required Description
key string Yes The key, exactly.
ref string No A full ref, e.g. refs/heads/main or refs/pull/7/merge.
curl -X DELETE "https://api.g1t.sh/repos/flagon-io/g1t/actions/caches?key=cargo-test-Linux-rustc-1.99.0-5f1c3a9e7b2d&ref=refs%2Fpull%2F412%2Fmerge" \
-H "Authorization: Bearer $G1T_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"key": "key"
}'

A successful request answers 200 with:

{
"total_count": 1,
"actions_caches": [
{
"id": 9102,
"key": "cargo-test-Linux-rustc-1.99.0-5f1c3a9e7b2d",
"ref": "refs/pull/412/merge",
"version": "",
"size_in_bytes": 702545920,
"created_at": "2026-10-12T11:02:44.930Z",
"last_accessed_at": "2026-10-12T11:02:44.930Z"
}
]
}

A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.

Status Code When
401 unauthenticated A token is required, or the one sent is not valid.
403 forbidden The token is valid but not allowed to do this, such as a member-only change, or a token without the scope it needs.
404 not_found It does not exist, or you cannot see it.
409 conflict The request conflicts with the current state.
422 invalid The input is not valid. message says which field and why.