---
title: Delete Tenant by ID
slug: api-documentation/delete-tenant-by-id
docTags: 
createdAt: 2026-10-19T10:26:54.944Z
---

{
  "id": "mRRbMJFUnET6ZO3ZpsHyb",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://api.upstartcommerce.com/v1/tenants/{tenantId}",
    "servers": [
      {
        "url": "https://api.upstartcommerce.com/v1/tenants/{tenantId}"
      }
    ],
    "name": "Delete Tenant by ID",
    "description": "<p>This endpoint deletes a tenant making all of its associated data inaccessible.</p>\n<p>Authorized permissions:</p>\n<ul>\n<li><code>tenant.delete</code></li>\n</ul>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "tenantId",
          "type": "string",
          "description": "Unique identifier for a given tenant."
        }
      ],
      "headerParameters": [
        {
          "kind": "required",
          "name": "x-upstart-tenant",
          "type": "string",
          "description": "Tenant identifier associated with the site this call is for."
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "NoChannelPortalAccess",
          "name": "NoChannelPortalAccess",
          "kind": "optional",
          "type": "http",
          "description": "<p>This authentication is required for clients to interact with any of the management APIs. Similar to 'LoggedIn', it indicates that the user has actually logged into the system, but in this case with a management role.</p>",
          "scheme": "bearer"
        },
        {
          "id": "SessionIdAuth",
          "name": "X-Upstart-Session-Id",
          "kind": "optional",
          "type": "apiKey",
          "description": "<p>Legacy auth-mgmt session credential, obtained from user-svc <code>POST /v1/user/session-login</code>.</p>\n<p>Accepted as an alternative to a bearer token: every operation that lists both schemes takes either one.\nThis is what control-center sends -- it attaches <code>X-Upstart-Session-Id</code> and never an <code>Authorization</code> header.\nDeclaring it here is what stops Tapir refusing those requests at the transport for a missing <code>Authorization</code>.</p>",
          "in": "header"
        },
        {
          "id": "ApiKeyAuth",
          "name": "X-UpStart-API-Key",
          "kind": "optional",
          "type": "apiKey",
          "description": "<p>Legacy auth-mgmt API key, for service and integration callers.</p>\n<p>Accepted as an alternative to a bearer token or session id: every operation that lists these schemes takes any one of them.\nDeclaring it here is what stops Tapir refusing API-key-only requests at the transport for a missing <code>Authorization</code>.</p>",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>Success-tenant deleted.</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "The request contained information that the server was unable to process. Appropriate errors are provided in the response body.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"name\":\"ValidationError\",\"code\":\"INVALID_EMAIL_FORMAT\",\"detail\":\"The email field must be a valid email address. Received: \\\"invalid-email\\\"\"}",
            "description": "<p>Error response returned when request validation fails (HTTP 400). Contains details about which fields failed validation and why. Used for client-side error display and form validation feedback.</p>",
            "customType": "ValidationErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "<p>The error type, typically 'ValidationError' for all validation failures. Use this to distinguish validation errors from other error types in your error handling logic.</p>",
                "example": "ValidationError"
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": "<p>A validation-specific error code indicating the validation rule that failed. Examples include 'REQUIRED_FIELD_MISSING', 'INVALID_FORMAT', 'VALUE_OUT_OF_RANGE', 'DUPLICATE_VALUE'. Use for specific handling of different validation scenarios.</p>",
                "example": "INVALID_EMAIL_FORMAT"
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "description": "<p>Human-readable validation error message describing which field(s) failed and why. Should be specific enough for developers to fix the issue. May include field paths for nested objects (e.g., 'sites[0].url is not a valid domain').</p>",
                "example": "The email field must be a valid email address. Received: \"invalid-email\""
              }
            ],
            "modelRef": "#/components/schemas/ValidationErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "The provided credentials were not valid for this endpoint. It may be that they are expired or that the user's roles are insufficient.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"name\":\"AuthorizationError\",\"code\":\"INSUFFICIENT_PERMISSIONS\",\"detail\":\"User does not have the required tenant.create permission to perform this operation.\",\"reason\":\"Your access token does not include the necessary permissions. Contact your administrator to request access.\"}",
            "description": "<p>Returned when credentials are missing, expired or insufficient (HTTP 401).</p>",
            "customType": "UnauthorizedError",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "<p>The high-level error category or type name.</p>"
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": "A specific error code identifying the exact error condition."
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of what went wrong.</p>"
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": "Optional additional context or suggested resolution."
              }
            ],
            "modelRef": "#/components/schemas/UnauthorizedError",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "The requested resource was not found in the NoChannel system.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"name\":\"ResourceNotFoundError\",\"code\":\"TENANT_NOT_FOUND\",\"detail\":\"The tenant with ID \\\"acme001\\\" was not found in the system.\",\"reason\":\"The tenant may have been deleted or you may not have permission to access it. Verify the tenant ID and your access rights.\"}",
            "description": "<p>Returned when the requested resource does not exist (HTTP 404).</p>",
            "customType": "NotFoundError",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "<p>The high-level error category or type name.</p>"
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": "A specific error code identifying the exact error condition."
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of what went wrong.</p>"
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": "Optional additional context or suggested resolution."
              }
            ],
            "modelRef": "#/components/schemas/NotFoundError",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "<p>The request was well-formed but contains semantic errors or violates business rules that prevent processing.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"name\":\"UnprocessableEntityError\",\"code\":\"INVALID_SITE_CONFIGURATION\",\"detail\":\"The deactivationDate must be after the activationDate.\",\"reason\":\"A site cannot be deactivated before it is activated. Please adjust the dates so that deactivation occurs after activation.\"}",
            "description": "<p>Returned when the request is well-formed but violates business rules (HTTP 422).</p>",
            "customType": "UnprocessableEntityError",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "<p>The high-level error category or type name.</p>"
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": "A specific error code identifying the exact error condition."
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of what went wrong.</p>"
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": "Optional additional context or suggested resolution."
              }
            ],
            "modelRef": "#/components/schemas/UnprocessableEntityError",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "<p>An unexpected internal server error occurred. The request may be retried, and if the problem persists, contact support with the traceId from the error response.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"name\":\"InternalServerError\",\"code\":\"UNEXPECTED_ERROR\",\"detail\":\"An unexpected error occurred while processing your request.\",\"reason\":\"Our team has been notified. Please try again, and if the problem persists, contact support with trace ID: 550e8400-e29b-41d4-a716-446655440000\"}",
            "description": "<p>Returned for an unexpected server-side failure (HTTP 500).</p>",
            "customType": "InternalServerError",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "<p>The high-level error category or type name.</p>"
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": "A specific error code identifying the exact error condition."
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of what went wrong.</p>"
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": "Optional additional context or suggested resolution."
              }
            ],
            "modelRef": "#/components/schemas/InternalServerError",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "503",
        "description": "<p>A downstream dependency was unavailable, so the request could not be authorized or completed. The request may be retried.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"name\":\"Service Unavailable\",\"code\":\"UNKNOWN\",\"detail\":\"Permission resolution is unavailable, please retry\",\"reason\":\"A dependency required to authorize this request is temporarily unreachable. Please retry shortly.\"}",
            "description": "<p>Returned when a downstream dependency this request needed is unavailable (HTTP 503).</p>\n<p>Distinct from 401: the caller's credentials are fine. The service could not resolve the permissions\nrequired to authorize the request, so the outcome is unknown rather than denied. The request may be retried.</p>",
            "customType": "ServiceUnavailableError",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "<p>The high-level error category or type name.</p>"
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": "A specific error code identifying the exact error condition."
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of what went wrong.</p>"
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": "Optional additional context or suggested resolution."
              }
            ],
            "modelRef": "#/components/schemas/ServiceUnavailableError",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "VNGLKd2nEygGjed1PQ8ZW",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url https://api.upstartcommerce.com/v1/tenants/{tenantId} \\\n     --header 'accept: application/json' \\\n     --header 'x-upstart-tenant: string'"
        },
        {
          "id": "RdKRNM1bZcXQG7UzNki-v",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-upstart-tenant\", \"string\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.upstartcommerce.com/v1/tenants/{tenantId}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "HSTeqLqDL6FpWF6eDidIf",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.upstartcommerce.com/v1/tenants/{tenantId}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-upstart-tenant\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "y_7QUAgqIctR1rdYTrQOI",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.upstartcommerce.com/v1/tenants/{tenantId}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-upstart-tenant': 'string'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "VNGLKd2nEygGjed1PQ8ZW"
    },
    "results": {
      "languages": [
        {
          "id": "XIB7TAMRouZD-A8TbjgdF",
          "language": "200",
          "code": "// Success-tenant deleted.\n"
        },
        {
          "id": "-nxESVJshTBMgMnUNZwHG",
          "language": "400",
          "code": "// The request contained information that the server was unable to process. Appropriate errors are provided in the response body.\n{\n  \"name\": \"ValidationError\",\n  \"code\": \"INVALID_EMAIL_FORMAT\",\n  \"detail\": \"The email field must be a valid email address. Received: \\\"invalid-email\\\"\"\n}"
        },
        {
          "id": "iNzUFZJh2hPnD9L72eXJ3",
          "language": "401",
          "code": "// The provided credentials were not valid for this endpoint. It may be that they are expired or that the user's roles are insufficient.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        },
        {
          "id": "UWiJ2hhGYSR-wfIh0HKsa",
          "language": "404",
          "code": "// The requested resource was not found in the NoChannel system.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        },
        {
          "id": "l5-SQRZvfHJMoAq5GKYbf",
          "language": "422",
          "code": "// The request was well-formed but contains semantic errors or violates business rules that prevent processing.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        },
        {
          "id": "tuUqGEMlwcAm9hbn-XKfJ",
          "language": "500",
          "code": "// An unexpected internal server error occurred. The request may be retried, and if the problem persists, contact support with the traceId from the error response.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        },
        {
          "id": "bJ4inKRNLHalmF-fPl1ze",
          "language": "503",
          "code": "// A downstream dependency was unavailable, so the request could not be authorized or completed. The request may be retried.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "XIB7TAMRouZD-A8TbjgdF"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}