---
updatedAt: 2026-05-18T19:39:50.000Z
agentTools:
  projectIndex: https://docs.cloudzero.com/llms.txt
---

# /v2/costformation/namespace/{id}

Delete a User-Managed CloudZero CostFormation Namespace

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "version": "2.0.0",
    "title": "CloudZero API V2 Resources",
    "description": "CloudZero V2 API",
    "contact": {
      "name": "CloudZero Support",
      "url": "https://www.cloudzero.com/contact",
      "email": "support@cloudzero.com"
    },
    "license": {
      "name": "BSD 3",
      "identifier": "BSD-3"
    }
  },
  "servers": [
    {
      "url": "https://api.cloudzero.com"
    }
  ],
  "tags": [
    {
      "name": "costformation-namespaces",
      "description": "CloudZero CostFormation Namespace Resources"
    }
  ],
  "paths": {
    "/v2/costformation/namespace/{id}": {
      "delete": {
        "tags": [
          "costformation-namespaces"
        ],
        "summary": "Delete a namespace",
        "description": "Deletes a specific namespace by its identifier",
        "operationId": "deleteNamespace",
        "parameters": [
          {
            "$ref": "#/components/parameters/cloudzero_idempotency_key"
          },
          {
            "$ref": "#/components/parameters/cloudzero_test_key"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The namespace identifier (FQN format)"
          }
        ],
        "responses": {
          "200": {
            "description": "Namespace deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "namespace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The namespace identifier that was deleted"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "namespace"
                  ]
                },
                "example": {
                  "namespace": {
                    "id": "User:Production"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/badRequestError"
          },
          "403": {
            "$ref": "#/components/responses/forbiddenError"
          },
          "422": {
            "$ref": "#/components/responses/invalidCostFormationNamespaceError"
          }
        },
        "security": [
          {
            "APIKeyAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "parameters": {
      "cloudzero_test_key": {
        "description": "If passed, the operation executes in the namespace specified by this key.\nResource mutations in the namespace last for 1 hour.\n",
        "name": "cloudzero-test-key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "cloudzero_idempotency_key": {
        "description": "If passed, any subsequent operation with the same value for this header will return the exact same result.\nThis is true for all responses, i.e. successes and errors.\n",
        "name": "cloudzero-idempotency-key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "forbiddenError": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            }
          }
        }
      },
      "badRequestError": {
        "description": "Bad Request Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      },
      "invalidCostFormationNamespaceError": {
        "description": "Invalid CloudZero CostFormation Namespace Format Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "$ref": "#/components/schemas/costformation_invalid_namespace_error"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "costformation_invalid_namespace_error": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "APIKeyAuth": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "x-readme": {}
}
```