SandboxesSandbox TemplatesTemplate versions

Remove every unused version of a project template

Remove every unused version of this template in one call. A version is unused when no tag points at it and no sandbox records it, and a paused sandbox and a fork both count. A version's own state is not a test: an unused active version goes the same way an unused archived one does. Send dry_run: true to read back what a prune would remove, and remove nothing. It frees no storage on its own: the images are reclaimed later, once no version and no sandbox references them. Requires the project admin role.

PUT
/v1/orgs/{org}/projects/{project}/templates/{name}/versions/prune

Remove every unused version of this template in one call. A version is unused when no tag points at it and no sandbox records it, and a paused sandbox and a fork both count. A version's own state is not a test: an unused active version goes the same way an unused archived one does. Send dry_run: true to read back what a prune would remove, and remove nothing. It frees no storage on its own: the images are reclaimed later, once no version and no sandbox references them. Requires the project admin role.

AuthorizationBearer <token>

API key starting with tektona_. Create one at app-dev.tektona.ai under API Keys.

In: header

Path Parameters

org*string

Organization name

project*string

Project name

name*string

Template name

Lengthlength <= 80

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

dry_run?boolean

Report what a prune would remove and remove nothing. False by default.

Response Body

application/json

application/problem+json

curl -X PUT "https://example.com/v1/orgs/string/projects/string/templates/string/versions/prune" \  -H "Content-Type: application/json" \  -d '{}'
{  "dry_run": true,  "kept_in_use": 3,  "kept_tagged": 2,  "removed": [    "01K2S8VVQ9F3M6WQ2S0S2Z9J4R"  ]}