> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orgo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete template version

> Delete one published version from your registry.

Deletes a single published version you own: its registry entry, its golden snapshot, and any of its builds still waiting in the queue. To replace a version in place instead of deleting it, re-publish with [`?force=true`](/api-reference/templates/publish).

The call is idempotent. Deleting a version that is already gone, or never existed, returns `200` with `deleted: true`.

<Warning>
  Deleting a version that computers were launched from does not affect those running computers. They already started from the golden snapshot. The delete removes the version from your registry, so it can no longer be launched or built. It is scoped to your own templates, so a curated (`system/…`) ref removes nothing, even though the response still reads `deleted: true`.
</Warning>

## Path parameters

<ParamField path="namespace" type="string" required>Template namespace.</ParamField>
<ParamField path="name" type="string" required>Template name.</ParamField>
<ParamField path="version" type="string" required>Version (semver) to delete.</ParamField>

## Response

<ResponseField name="deleted" type="boolean">
  Always `true` on success, including when the version was already gone. A failure comes back as a `4xx` or `5xx` instead.
</ResponseField>

<ResponseField name="cancelledJobs" type="integer">
  How many of the version's queued builds were cancelled. A build a runner had already claimed is not counted.
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://www.orgo.ai/api/templates/default/claude-code/1.0.0 \
    -H "Authorization: Bearer $ORGO_API_KEY"
  ```

  ```python Python theme={null}
  import os, requests

  r = requests.delete(
      "https://www.orgo.ai/api/templates/default/claude-code/1.0.0",
      headers={"Authorization": f"Bearer {os.environ['ORGO_API_KEY']}"},
  )
  print(r.json())  # {"deleted": true, "cancelledJobs": 0}
  ```

  ```javascript JavaScript theme={null}
  const r = await fetch(
    "https://www.orgo.ai/api/templates/default/claude-code/1.0.0",
    {
      method: "DELETE",
      headers: { Authorization: `Bearer ${process.env.ORGO_API_KEY}` },
    },
  );
  console.log(await r.json());
  ```
</CodeGroup>

### Response

```json theme={null}
{ "deleted": true, "cancelledJobs": 0 }
```

## Errors

| Status | Body | Meaning |
| - | - | - |
| `400` | `{ "error": string }` | A path segment is not a valid template namespace, name, or version, e.g. `"invalid template reference"`. |
| `401` | `{ "error": "Invalid API key" }` | The Bearer token starts with `sk_` but is not a known Orgo key. |
| `401` | `{ "error": "Authentication required" }` | No `Authorization` header, or a Bearer token that is not an `sk_` key. |
| `401` | `{ "error": "This endpoint requires an account-wide credential (workspace_scope_mismatch)." }` | The key is workspace-scoped. Template endpoints need an account-wide key. This route answers with `401`, not `403`. |
| `401` | `{ "error": "Service temporarily unavailable. …" }` | Orgo could not verify the key because of a server-side fault. The key is fine. Retry. |
| `500` | `{ "error": string }` | Unexpected server error (`"internal error"`), or the template registry host failed or timed out. Retry; the delete is idempotent. |
| `502` | `{ "error": "golden objects could not be scheduled for deletion", "code": "golden_delete_incomplete" }` | The version still exists. Retry. |
| `503` | `{ "error": "template authority unavailable", "code": "delete_authority_unavailable" }` | The template record could not be read or written. The version still exists. Retry. |
| `503` | `{ "error": string }` | No fleet host is available to serve the template registry. Retry. |


## OpenAPI

````yaml DELETE /templates/{namespace}/{name}/{version}
openapi: 3.1.0
info:
  title: Orgo API
  description: >-
    Launch cloud computers that AI agents can control and interact with. Create
    workspaces, provision computers, and control them programmatically.
  version: 2.0.0
  contact:
    name: Orgo Support
    email: spencer@orgo.ai
    url: https://orgo.ai
servers:
  - url: https://www.orgo.ai/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Account
    description: >-
      Account capacity: how many computers an account may run, and adding or
      giving back more.
  - name: Clients
    description: >-
      Run Orgo for your clients from your own app: a workspace and scoped key
      each, billed to you or to them.
  - name: Workspaces
    description: Organize computers into named workspaces
  - name: Computers
    description: Provision and manage virtual computers
  - name: Computer Lifecycle
    description: Start, stop, and restart computers
  - name: Computer Actions
    description: Control mouse, keyboard, and execute commands
  - name: Screens
    description: >-
      More than one desktop on a single computer. Each screen is its own X
      server with its own cursor and window manager, so an agent working on one
      cannot disturb another.
  - name: Files
    description: Upload and download files
  - name: Templates
    description: Author, build, and launch reproducible computers from templates
paths:
  /templates/{namespace}/{name}/{version}:
    delete:
      tags:
        - Templates
      summary: Delete template version
      description: >-
        Deletes one published version you own: its registry entry, its golden
        snapshot, and any of its builds still waiting in the queue. Idempotent:
        a version that is already gone, or never existed, returns `200` with
        `deleted: true`. A curated (`system/…`) ref removes nothing. Running
        computers launched from it are unaffected.
      operationId: deleteTemplate
      parameters:
        - name: namespace
          in: path
          required: true
          schema:
            type: string
        - name: name
          in: path
          required: true
          schema:
            type: string
        - name: version
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Deleted, or already gone
          content:
            application/json:
              schema:
                type: object
                properties:
                  deleted:
                    type: boolean
                    enum:
                      - true
                  cancelledJobs:
                    type: integer
                    description: >-
                      How many of the version's queued builds were cancelled. A
                      build a runner had already claimed is not counted.
              example:
                deleted: true
                cancelledJobs: 0
        '400':
          description: A path segment is not a valid template name or version.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateError'
              example:
                error: invalid template reference
        '401':
          $ref: '#/components/responses/UnauthorizedTemplates'
        '500':
          $ref: '#/components/responses/TemplateInternalError'
        '502':
          description: >-
            The golden objects could not be scheduled for deletion. The version
            still exists. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateError'
              example:
                error: golden objects could not be scheduled for deletion
                code: golden_delete_incomplete
        '503':
          description: >-
            The template record could not be read or written
            (`delete_authority_unavailable`), or no fleet host is available. The
            version still exists. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateError'
              examples:
                authority:
                  summary: Template record unavailable
                  value:
                    error: template authority unavailable
                    code: delete_authority_unavailable
                host:
                  summary: No fleet host
                  value:
                    error: …
components:
  schemas:
    TemplateError:
      type: object
      description: >-
        A failure from the template registry, relayed with the registry's own
        status and code.
      required:
        - error
      properties:
        error:
          type: string
        code:
          type: string
          description: Machine-readable reason, when the registry supplied one.
        details:
          description: >-
            Per-field validation errors, or the raw upstream body when it was
            not JSON.
          oneOf:
            - type: array
              items:
                $ref: '#/components/schemas/ValidationError'
            - type: string
    ValidationError:
      type: object
      properties:
        field:
          type: string
          description: Dotted path to the offending field.
          example: hardware.cpu
        code:
          type: string
          example: invalid_enum
        message:
          type: string
        hint:
          type: string
    Error:
      type: object
      description: >-
        The base error body. Every failure carries `error`; individual endpoints
        add the fields named in the schemas below.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable message.
          example: Access denied
        code:
          type: string
          description: >-
            Machine-readable reason. Present on the failures that define one,
            absent otherwise.
  responses:
    UnauthorizedTemplates:
      description: >-
        No usable credential, or a workspace-scoped key. Template endpoints need
        an account-wide key and answer a scoped one with `401`, not `403`. A
        server-side fault while verifying the credential also returns `401`,
        with a `Service temporarily unavailable` message. Retry that one; the
        key is fine.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalid-key:
              summary: The key is not one of yours
              value:
                error: Invalid API key
            no-credential:
              summary: No key and no session
              value:
                error: Authentication required
            account-wide-required:
              summary: The API key is workspace-scoped
              value:
                error: >-
                  This endpoint requires an account-wide credential
                  (workspace_scope_mismatch).
            service-unavailable:
              summary: Server-side fault while verifying the credential. Retry.
              value:
                error: >-
                  Service temporarily unavailable. The database is not accepting
                  requests. Retry shortly.
    TemplateInternalError:
      description: >-
        Unexpected server error (`internal error`), or the template registry
        host failed or timed out, with the underlying message in `error`. Retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TemplateError'
          examples:
            internal:
              summary: Unexpected server error
              value:
                error: internal error
            timeout:
              summary: The registry host did not answer in time
              value:
                error: timeout of 30000ms exceeded
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Get your key at orgo.ai/workspaces

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.