---
title: Delete a version
slug: api-documentation/delete-a-version
docTags: 
createdAt: 2026-10-09T16:36:44.630Z
---

{
  "id": "1KU9JAkjKiBvvGEWtMdLa",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "http://localhost:8080/idgen/namespaces/{name}/versions/{version}",
    "servers": [
      {
        "url": "{baseUrl}/idgen/namespaces/{name}/versions/{version}",
        "description": "The API gateway, or the service itself (port 8080).",
        "variables": {
          "baseUrl": {
            "default": "http://localhost:8080",
            "description": "Scheme and host, e.g. https://<gateway>. No trailing slash."
          }
        }
      }
    ],
    "name": "Delete a version",
    "description": "<p>Deletes a DRAFT or SCHEDULED version. Needs <code>idgen.namespaces.write</code>.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "name",
          "type": "string",
          "description": "<p>The namespace name (<code>^[a-z][a-z0-9._-]{0,63}$</code>).</p>"
        },
        {
          "kind": "required",
          "name": "version",
          "type": "integer<int32>",
          "description": "<p>The version number (from 1).</p>",
          "format": "int32"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "bearerAuth",
          "name": "bearerAuth",
          "kind": "optional",
          "type": "http",
          "description": "<p>A JWT from authentication-svc. The tenant comes from the token.</p>",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "204",
        "description": "The version is deleted.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "<p>INVALID_REQUEST: a malformed path or body value, or an invalid name.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>The body of every error response. Branch on <code>error</code>, never on <code>message</code>.</p>",
            "customType": "ErrorDto",
            "schema": [
              {
                "name": "error",
                "kind": "required",
                "type": "string",
                "description": "<p>The machine-readable error code, e.g. NAMESPACE_NOT_FOUND or FORMAT_OVERLAP.</p>"
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "<p>A human-readable explanation.</p>"
              },
              {
                "name": "status",
                "kind": "required",
                "type": "integer<int32>",
                "description": "<p>The HTTP status code, repeated.</p>",
                "format": "int32"
              },
              {
                "name": "details",
                "kind": "required",
                "type": "map",
                "description": "<p>Structured context: <code>retryable</code> (whether the same request can succeed later) and, depending on the code, <code>namespace</code>, <code>version</code>, <code>templateExists</code>, <code>conflictingVersion</code> and <code>exampleId</code>.</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "links",
                "kind": "required",
                "type": "map",
                "description": "<p>Related resources, e.g. <code>namespace</code> (paths under /idgen).</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/ErrorDto",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "<p>UNAUTHENTICATED: missing, expired or invalid credentials.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>The body of every error response. Branch on <code>error</code>, never on <code>message</code>.</p>",
            "customType": "ErrorDto",
            "schema": [
              {
                "name": "error",
                "kind": "required",
                "type": "string",
                "description": "<p>The machine-readable error code, e.g. NAMESPACE_NOT_FOUND or FORMAT_OVERLAP.</p>"
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "<p>A human-readable explanation.</p>"
              },
              {
                "name": "status",
                "kind": "required",
                "type": "integer<int32>",
                "description": "<p>The HTTP status code, repeated.</p>",
                "format": "int32"
              },
              {
                "name": "details",
                "kind": "required",
                "type": "map",
                "description": "<p>Structured context: <code>retryable</code> (whether the same request can succeed later) and, depending on the code, <code>namespace</code>, <code>version</code>, <code>templateExists</code>, <code>conflictingVersion</code> and <code>exampleId</code>.</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "links",
                "kind": "required",
                "type": "map",
                "description": "<p>Related resources, e.g. <code>namespace</code> (paths under /idgen).</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/ErrorDto",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "<p>FORBIDDEN: the caller lacks the <code>idgen.namespaces.write</code> permission, or its tenant or site scope does not match.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>The body of every error response. Branch on <code>error</code>, never on <code>message</code>.</p>",
            "customType": "ErrorDto",
            "schema": [
              {
                "name": "error",
                "kind": "required",
                "type": "string",
                "description": "<p>The machine-readable error code, e.g. NAMESPACE_NOT_FOUND or FORMAT_OVERLAP.</p>"
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "<p>A human-readable explanation.</p>"
              },
              {
                "name": "status",
                "kind": "required",
                "type": "integer<int32>",
                "description": "<p>The HTTP status code, repeated.</p>",
                "format": "int32"
              },
              {
                "name": "details",
                "kind": "required",
                "type": "map",
                "description": "<p>Structured context: <code>retryable</code> (whether the same request can succeed later) and, depending on the code, <code>namespace</code>, <code>version</code>, <code>templateExists</code>, <code>conflictingVersion</code> and <code>exampleId</code>.</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "links",
                "kind": "required",
                "type": "map",
                "description": "<p>Related resources, e.g. <code>namespace</code> (paths under /idgen).</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/ErrorDto",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "<p>NAMESPACE_NOT_FOUND or VERSION_NOT_FOUND: no such namespace or version.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>The body of every error response. Branch on <code>error</code>, never on <code>message</code>.</p>",
            "customType": "ErrorDto",
            "schema": [
              {
                "name": "error",
                "kind": "required",
                "type": "string",
                "description": "<p>The machine-readable error code, e.g. NAMESPACE_NOT_FOUND or FORMAT_OVERLAP.</p>"
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "<p>A human-readable explanation.</p>"
              },
              {
                "name": "status",
                "kind": "required",
                "type": "integer<int32>",
                "description": "<p>The HTTP status code, repeated.</p>",
                "format": "int32"
              },
              {
                "name": "details",
                "kind": "required",
                "type": "map",
                "description": "<p>Structured context: <code>retryable</code> (whether the same request can succeed later) and, depending on the code, <code>namespace</code>, <code>version</code>, <code>templateExists</code>, <code>conflictingVersion</code> and <code>exampleId</code>.</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "links",
                "kind": "required",
                "type": "map",
                "description": "<p>Related resources, e.g. <code>namespace</code> (paths under /idgen).</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/ErrorDto",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "409",
        "description": "<p>VERSION_NOT_MUTABLE: the version's state does not allow this change.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>The body of every error response. Branch on <code>error</code>, never on <code>message</code>.</p>",
            "customType": "ErrorDto",
            "schema": [
              {
                "name": "error",
                "kind": "required",
                "type": "string",
                "description": "<p>The machine-readable error code, e.g. NAMESPACE_NOT_FOUND or FORMAT_OVERLAP.</p>"
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "<p>A human-readable explanation.</p>"
              },
              {
                "name": "status",
                "kind": "required",
                "type": "integer<int32>",
                "description": "<p>The HTTP status code, repeated.</p>",
                "format": "int32"
              },
              {
                "name": "details",
                "kind": "required",
                "type": "map",
                "description": "<p>Structured context: <code>retryable</code> (whether the same request can succeed later) and, depending on the code, <code>namespace</code>, <code>version</code>, <code>templateExists</code>, <code>conflictingVersion</code> and <code>exampleId</code>.</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "links",
                "kind": "required",
                "type": "map",
                "description": "<p>Related resources, e.g. <code>namespace</code> (paths under /idgen).</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/ErrorDto",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "<p>INTERNAL_ERROR: an unexpected failure. Retry once, then report it with the <code>x-request-id</code>.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>The body of every error response. Branch on <code>error</code>, never on <code>message</code>.</p>",
            "customType": "ErrorDto",
            "schema": [
              {
                "name": "error",
                "kind": "required",
                "type": "string",
                "description": "<p>The machine-readable error code, e.g. NAMESPACE_NOT_FOUND or FORMAT_OVERLAP.</p>"
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "<p>A human-readable explanation.</p>"
              },
              {
                "name": "status",
                "kind": "required",
                "type": "integer<int32>",
                "description": "<p>The HTTP status code, repeated.</p>",
                "format": "int32"
              },
              {
                "name": "details",
                "kind": "required",
                "type": "map",
                "description": "<p>Structured context: <code>retryable</code> (whether the same request can succeed later) and, depending on the code, <code>namespace</code>, <code>version</code>, <code>templateExists</code>, <code>conflictingVersion</code> and <code>exampleId</code>.</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "links",
                "kind": "required",
                "type": "map",
                "description": "<p>Related resources, e.g. <code>namespace</code> (paths under /idgen).</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/ErrorDto",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "503",
        "description": "<p>AUTH_UNAVAILABLE or BACKEND_UNAVAILABLE (both retryable): retry with backoff.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>The body of every error response. Branch on <code>error</code>, never on <code>message</code>.</p>",
            "customType": "ErrorDto",
            "schema": [
              {
                "name": "error",
                "kind": "required",
                "type": "string",
                "description": "<p>The machine-readable error code, e.g. NAMESPACE_NOT_FOUND or FORMAT_OVERLAP.</p>"
              },
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "<p>A human-readable explanation.</p>"
              },
              {
                "name": "status",
                "kind": "required",
                "type": "integer<int32>",
                "description": "<p>The HTTP status code, repeated.</p>",
                "format": "int32"
              },
              {
                "name": "details",
                "kind": "required",
                "type": "map",
                "description": "<p>Structured context: <code>retryable</code> (whether the same request can succeed later) and, depending on the code, <code>namespace</code>, <code>version</code>, <code>templateExists</code>, <code>conflictingVersion</code> and <code>exampleId</code>.</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              },
              {
                "name": "links",
                "kind": "required",
                "type": "map",
                "description": "<p>Related resources, e.g. <code>namespace</code> (paths under /idgen).</p>",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/ErrorDto",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "fViuKGAZttiM8-lHeUeov",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url http://localhost:8080/idgen/namespaces/{name}/versions/{version} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "4U6Ioy_ndwAn1-V6T2bSK",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"http://localhost:8080/idgen/namespaces/{name}/versions/{version}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "CfWEdCjyNXU86EsIJ0CoG",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"http://localhost:8080/idgen/namespaces/{name}/versions/{version}\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "WcaEszOH24F96SrNNxXJD",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"http://localhost:8080/idgen/namespaces/{name}/versions/{version}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "fViuKGAZttiM8-lHeUeov"
    },
    "results": {
      "languages": [
        {
          "id": "tTIuUGouw3G_iXnx25dHb",
          "language": "204",
          "code": "// The version is deleted.\n"
        },
        {
          "id": "NEK3Uvs-NfZoaiyf0hPof",
          "language": "400",
          "code": "// INVALID_REQUEST: a malformed path or body value, or an invalid name.\n{\n  \"error\": \"\",\n  \"message\": \"\",\n  \"status\": \"\",\n  \"details\": \"\",\n  \"links\": \"\"\n}"
        },
        {
          "id": "ikICittr00eoWm7Y-Vgjn",
          "language": "401",
          "code": "// UNAUTHENTICATED: missing, expired or invalid credentials.\n{\n  \"error\": \"\",\n  \"message\": \"\",\n  \"status\": \"\",\n  \"details\": \"\",\n  \"links\": \"\"\n}"
        },
        {
          "id": "q7F5Zkr4UK3JWJqdHscI4",
          "language": "403",
          "code": "// FORBIDDEN: the caller lacks the idgen.namespaces.write permission, or its tenant or site scope does not match.\n{\n  \"error\": \"\",\n  \"message\": \"\",\n  \"status\": \"\",\n  \"details\": \"\",\n  \"links\": \"\"\n}"
        },
        {
          "id": "yLcweoJRincmUwtzgPyEq",
          "language": "404",
          "code": "// NAMESPACE_NOT_FOUND or VERSION_NOT_FOUND: no such namespace or version.\n{\n  \"error\": \"\",\n  \"message\": \"\",\n  \"status\": \"\",\n  \"details\": \"\",\n  \"links\": \"\"\n}"
        },
        {
          "id": "8tm5b0YRJq4nQX5M7Zr6p",
          "language": "409",
          "code": "// VERSION_NOT_MUTABLE: the version's state does not allow this change.\n{\n  \"error\": \"\",\n  \"message\": \"\",\n  \"status\": \"\",\n  \"details\": \"\",\n  \"links\": \"\"\n}"
        },
        {
          "id": "OxcnybXzVuIFi2Lklg60H",
          "language": "500",
          "code": "// INTERNAL_ERROR: an unexpected failure. Retry once, then report it with the x-request-id.\n{\n  \"error\": \"\",\n  \"message\": \"\",\n  \"status\": \"\",\n  \"details\": \"\",\n  \"links\": \"\"\n}"
        },
        {
          "id": "5gO8rL6lqlWh3iaqXZr-U",
          "language": "503",
          "code": "// AUTH_UNAVAILABLE or BACKEND_UNAVAILABLE (both retryable): retry with backoff.\n{\n  \"error\": \"\",\n  \"message\": \"\",\n  \"status\": \"\",\n  \"details\": \"\",\n  \"links\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "tTIuUGouw3G_iXnx25dHb"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}