---
updatedAt: 2026-09-01T14:05:24.000Z
agentTools:
  siteIndex: https://developer.jamf.com/llms.txt
  projectIndex: https://developer.jamf.com/platform-api/llms.txt
---

# Delete a Gateway

Delete a dedicated Gateway. Returns `204` on success. Returns `404` if the gateway does not exist or belongs to a different tenant — never `403`. Returns `409` if the gateway is still referenced by an App, a Grouped Gateway, or a DNS Zone — disassociate it first, then retry.


**Required Permissions:** `ztna:delete`

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Jamf ZTNA Public API",
    "version": "1.0.0",
    "description": "Manage ZTNA Gateways, Grouped Gateways, Apps, and Predefined Apps",
    "termsOfService": "https://www.jamf.com/developer-resources/api-license-agreement/",
    "contact": {
      "name": "Jamf Developer",
      "url": "https://developer.jamf.com"
    }
  },
  "tags": [
    {
      "name": "gateways",
      "description": "Dedicated ZTNA Gateways — customer-owned gateways managed exclusively by the tenant. Full CRUD available.\n"
    }
  ],
  "paths": {
    "/v1/ztna/gateways/{gatewayId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/gatewayId"
        }
      ],
      "delete": {
        "tags": [
          "gateways"
        ],
        "summary": "Delete a Gateway",
        "description": "Delete a dedicated Gateway. Returns `204` on success. Returns `404` if the gateway does not exist or belongs to a different tenant — never `403`. Returns `409` if the gateway is still referenced by an App, a Grouped Gateway, or a DNS Zone — disassociate it first, then retry.\n\n\n**Required Permissions:** `ztna:delete`",
        "operationId": "deleteGateway",
        "x-required-privileges": [
          "ztna:delete"
        ],
        "responses": {
          "204": {
            "description": "Gateway deleted."
          },
          "404": {
            "description": "Gateway not found or belongs to a different tenant."
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          },
          "429": {
            "$ref": "#/components/responses/tooManyRequests"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Tenant-Id"
          },
          {
            "$ref": "#/components/parameters/X-Environment-Id"
          }
        ],
        "security": [
          {
            "oauth2": [
              "ztna:delete"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "parameters": {
      "gatewayId": {
        "name": "gatewayId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[0-9a-f]{4}$"
        },
        "description": "ID of the Gateway (obtained from `GET /gateways` or a create response). Format: 4-character lowercase hexadecimal string (e.g. `a1b2`).\n"
      },
      "X-Tenant-Id": {
        "name": "X-Tenant-Id",
        "in": "header",
        "required": false,
        "description": "The tenant UUID identifier. Send it to address tenant scope. This API is also published at environment scope — send that scope's header instead. Send exactly one scope header per request.",
        "schema": {
          "type": "string",
          "format": "uuid",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
          "example": "e77c1408-10c8-4007-b177-abc9157fbcaa"
        }
      },
      "X-Environment-Id": {
        "name": "X-Environment-Id",
        "in": "header",
        "required": false,
        "description": "The environment UUID identifier. Send it to address environment scope. This API is also published at tenant scope — send that scope's header instead. Send exactly one scope header per request.",
        "schema": {
          "type": "string",
          "format": "uuid",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
          "example": "e77c1408-10c8-4007-b177-abc9157fbcaa"
        }
      }
    },
    "responses": {
      "tooManyRequests": {
        "description": "Rate limit exceeded. Retry after the period indicated by `Retry-After`.",
        "headers": {
          "Retry-After": {
            "description": "Number of seconds to wait before retrying.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            },
            "example": {
              "httpStatus": 429,
              "traceId": "ecf2ca07e23c0abc12393472f2b783df",
              "errors": [
                {
                  "code": "RATE_LIMIT_EXCEEDED",
                  "description": "Too many requests. Retry after the indicated period."
                }
              ]
            }
          }
        }
      },
      "conflict": {
        "description": "Conflict — request is valid but cannot be processed due to current state. Common codes: `HOSTNAME_CONFLICT` — hostname already assigned to another App; `BARE_IPS_CONFLICT` — POST/PATCH app: one or more of the provided `bareIps` IP ranges conflict with an existing app (`field: bareIps`); `DEDICATED_IPS_LIMIT` — `dedicatedIps.enabled: true` quota exhausted; `IPSEC_LIMIT` — IPSec egress tunnel limit reached; `TLD_LIMIT_EXCEEDED` — limit on distinct top-level domains exceeded; `MISSING_CATEGORY_NAME` — `categoryName` does not match any category returned by `GET /v1/categories`; `MISSING_SKU2_FOR_RISK_CONTROL` — risk controls require SKU2 entitlement not held by this customer; `MISSING_USER_GROUPS` — one or more assignment group IDs do not exist for this customer; `UNSUPPORTED_BARE_IP_IN_REFERENCED_GATEWAY_IPSEC_CONFIG` — a `bareIps` subnet is not covered by the referenced gateway's IPSec tunnel `right.subnets`; `GATEWAY_REFERENCED_BY_ACCESS_POLICIES` — DELETE gateway: still referenced by one or more Access Policies; `GATEWAY_REFERENCED_BY_GROUPED_GATEWAYS` — DELETE gateway: still a member of one or more grouped gateways; `GATEWAY_REFERENCED_BY_DNS_ZONES` — DELETE gateway: still referenced by one or more Custom DNS Zones; `GROUPED_GATEWAY_REFERENCED_BY_ACCESS_POLICIES` — DELETE grouped-gateway: still referenced by one or more Access Policies; `GROUPED_GATEWAY_REFERENCED_BY_DNS_ZONES` — DELETE grouped-gateway: still referenced by one or more Custom DNS Zones; `CUSTOMERS_REFERENCED_BY_ACCESS_POLICIES` — PATCH gateway or grouped gateway: an unassigned customer is still referenced by one or more Access Policies; `CUSTOMERS_REFERENCED_BY_GROUPED_GATEWAYS` — PATCH gateway: an unassigned customer still uses this gateway via a grouped gateway; `CUSTOMERS_REFERENCED_BY_DNS_ZONES` — PATCH gateway or grouped gateway: an unassigned customer is still referenced by one or more Custom DNS Zones; `CUSTOMERS_FROM_DIFFERENT_ORGANIZATIONS` — PATCH gateway: the provided customers belong to different organizations; only customers from the same organization may be assigned together; `GATEWAYS_TUNNEL_FLAG_MISMATCH` — PATCH grouped-gateway: the combined set of referenced gateways (supplied plus the group's existing members) does not all share the same tunneled flag; distinct from `422 MIXED_TUNNEL_TYPES`, which rejects a supplied `gatewayIds` set that is itself mixed (`field: gatewayIds`); `IPSEC_CONFIG_DUPLICATE` — POST/PATCH gateway: a gateway with the same IPSec configuration already exists (`field: ipsec`); `PREDEFINED_APP_NOT_FOUND` — POST app: `predefinedAppId` does not resolve to an existing predefined app (`field: predefinedAppId`). Returned as `409` (not `422`): the id is checked against existing predefined apps, not the request's shape. `CONFLICT` — generic conflict fallback; emitted for conflict cases not covered by a specific code above (e.g. removing the contact from a dedicated VPN route). Note: inaccessible gateway IDs in request bodies return `422 GATEWAY_NOT_FOUND`, not `409`. An unresolvable `predefinedAppId` is the deliberate exception — it returns `409 PREDEFINED_APP_NOT_FOUND`.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            },
            "examples": {
              "hostnameConflict": {
                "summary": "HOSTNAME_CONFLICT",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "HOSTNAME_CONFLICT",
                      "field": "hostnames",
                      "description": "Hostname 'atlassian.com' is already assigned to another App.",
                      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
                    }
                  ]
                }
              },
              "bareIpsConflict": {
                "summary": "BARE_IPS_CONFLICT",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "BARE_IPS_CONFLICT",
                      "field": "bareIps",
                      "description": "One or more of the provided IP ranges conflict with an existing app."
                    }
                  ]
                }
              },
              "gatewayReferencedByAccessPolicies": {
                "summary": "GATEWAY_REFERENCED_BY_ACCESS_POLICIES",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "GATEWAY_REFERENCED_BY_ACCESS_POLICIES",
                      "description": "The gateway could not be deleted because it is referenced by one or more Access Policies. Disconnect this gateway from all policies, then try again."
                    }
                  ]
                }
              },
              "gatewayReferencedByGroupedGateways": {
                "summary": "GATEWAY_REFERENCED_BY_GROUPED_GATEWAYS",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "GATEWAY_REFERENCED_BY_GROUPED_GATEWAYS",
                      "description": "The gateway could not be deleted because it is referenced by one or more grouped gateways. Disconnect this gateway from all grouped gateways, then try again."
                    }
                  ]
                }
              },
              "gatewayReferencedByDnsZones": {
                "summary": "GATEWAY_REFERENCED_BY_DNS_ZONES",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "GATEWAY_REFERENCED_BY_DNS_ZONES",
                      "description": "The gateway could not be deleted because it is referenced by one or more Custom DNS Zones. Disconnect this gateway from all zones, then try again."
                    }
                  ]
                }
              },
              "groupedGatewayReferencedByAccessPolicies": {
                "summary": "GROUPED_GATEWAY_REFERENCED_BY_ACCESS_POLICIES",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "GROUPED_GATEWAY_REFERENCED_BY_ACCESS_POLICIES",
                      "description": "The grouped gateway could not be deleted because it is referenced by one or more Access Policies. Disconnect this grouped gateway from all policies, then try again."
                    }
                  ]
                }
              },
              "groupedGatewayReferencedByDnsZones": {
                "summary": "GROUPED_GATEWAY_REFERENCED_BY_DNS_ZONES",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "GROUPED_GATEWAY_REFERENCED_BY_DNS_ZONES",
                      "description": "The grouped gateway could not be deleted because it is referenced by one or more Custom DNS Zones. Disconnect this grouped gateway from all zones, then try again."
                    }
                  ]
                }
              },
              "customersReferencedByAccessPolicies": {
                "summary": "CUSTOMERS_REFERENCED_BY_ACCESS_POLICIES",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "CUSTOMERS_REFERENCED_BY_ACCESS_POLICIES",
                      "description": "The gateway or grouped gateway could not be modified because one or more unassigned customers are still referenced by one or more Access Policies. Remove the reference, then try again."
                    }
                  ]
                }
              },
              "customersReferencedByGroupedGateways": {
                "summary": "CUSTOMERS_REFERENCED_BY_GROUPED_GATEWAYS",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "CUSTOMERS_REFERENCED_BY_GROUPED_GATEWAYS",
                      "description": "The gateway could not be modified because one or more unassigned customers are still referenced by one or more grouped gateways. Remove the reference, then try again."
                    }
                  ]
                }
              },
              "customersReferencedByDnsZones": {
                "summary": "CUSTOMERS_REFERENCED_BY_DNS_ZONES",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "CUSTOMERS_REFERENCED_BY_DNS_ZONES",
                      "description": "The gateway or grouped gateway could not be modified because one or more unassigned customers are still referenced by one or more Custom DNS Zones. Remove the reference, then try again."
                    }
                  ]
                }
              },
              "customersFromDifferentOrganizations": {
                "summary": "CUSTOMERS_FROM_DIFFERENT_ORGANIZATIONS",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "CUSTOMERS_FROM_DIFFERENT_ORGANIZATIONS",
                      "description": "The provided customers belong to different organizations. Use only customers from the same organization."
                    }
                  ]
                }
              },
              "gatewaysTunnelFlagMismatch": {
                "summary": "GATEWAYS_TUNNEL_FLAG_MISMATCH",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "GATEWAYS_TUNNEL_FLAG_MISMATCH",
                      "field": "gatewayIds",
                      "description": "The combined set of referenced gateways, including existing members, must all have the same tunneled flag."
                    }
                  ]
                }
              },
              "ipsecConfigDuplicate": {
                "summary": "IPSEC_CONFIG_DUPLICATE",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "IPSEC_CONFIG_DUPLICATE",
                      "field": "ipsec",
                      "description": "A gateway with the same IPSec configuration already exists."
                    }
                  ]
                }
              },
              "predefinedAppNotFound": {
                "summary": "PREDEFINED_APP_NOT_FOUND",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "PREDEFINED_APP_NOT_FOUND",
                      "field": "predefinedAppId",
                      "description": "The predefined app 'atlassian-cloud' does not exist."
                    }
                  ]
                }
              },
              "ipsecLimit": {
                "summary": "IPSEC_LIMIT",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "IPSEC_LIMIT",
                      "description": "The IPSec egress limit has been reached (5 of 5)."
                    }
                  ]
                }
              },
              "tldLimitExceeded": {
                "summary": "TLD_LIMIT_EXCEEDED",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "TLD_LIMIT_EXCEEDED",
                      "description": "The number of distinct top-level domains (10) exceeds the maximum of 8."
                    }
                  ]
                }
              },
              "dedicatedIpsLimit": {
                "summary": "DEDICATED_IPS_LIMIT",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "DEDICATED_IPS_LIMIT",
                      "description": "The dedicated IP address limit has been reached (5 of 5)."
                    }
                  ]
                }
              },
              "missingCategoryName": {
                "summary": "MISSING_CATEGORY_NAME",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "MISSING_CATEGORY_NAME",
                      "description": "Category Web Browsing does not exist."
                    }
                  ]
                }
              },
              "missingUserGroups": {
                "summary": "MISSING_USER_GROUPS",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "MISSING_USER_GROUPS",
                      "description": "User groups [c375d769-0e0e-4cb3-99c0-3dcd5f48a36f, a1b2c3d4-e5f6-7890-abcd-ef1234567890] do not exist."
                    }
                  ]
                }
              },
              "missingSku2ForRiskControl": {
                "summary": "MISSING_SKU2_FOR_RISK_CONTROL",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "MISSING_SKU2_FOR_RISK_CONTROL",
                      "description": "The required component is not enabled for risk-based access control."
                    }
                  ]
                }
              },
              "unsupportedBareIpInReferencedGatewayIpsecConfig": {
                "summary": "UNSUPPORTED_BARE_IP_IN_REFERENCED_GATEWAY_IPSEC_CONFIG",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "UNSUPPORTED_BARE_IP_IN_REFERENCED_GATEWAY_IPSEC_CONFIG",
                      "description": "The referenced gateway's IPSec configuration does not support 10.10.0.0/24."
                    }
                  ]
                }
              },
              "genericConflict": {
                "summary": "CONFLICT",
                "value": {
                  "httpStatus": 409,
                  "traceId": "ecf2ca07e23c0abc12393472f2b783df",
                  "errors": [
                    {
                      "code": "CONFLICT",
                      "description": "The request conflicts with the current state of the resource."
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "ApiError": {
        "type": "object",
        "description": "Standard error response body. Returned for all non-2xx responses.\n",
        "required": [
          "httpStatus"
        ],
        "properties": {
          "httpStatus": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599,
            "example": 400
          },
          "traceId": {
            "type": "string",
            "description": "Trace ID for correlating server-side errors. Include this value when reporting issues to Jamf support.\n",
            "example": "ecf2ca07e23c0abc12393472f2b783df"
          },
          "errors": {
            "type": "array",
            "description": "One entry per problem in the request.",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Machine-readable error code.",
                  "example": "INVALID_FIELD"
                },
                "field": {
                  "type": "string",
                  "description": "Name of the field that caused the error, if applicable.",
                  "example": "categoryName"
                },
                "description": {
                  "type": "string",
                  "description": "Human-readable description for debugging. Do not display to end users.",
                  "example": "Value is not a recognized category."
                },
                "id": {
                  "type": "string",
                  "description": "ID of the object with the error, if applicable.",
                  "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "description": "Obtain an access token by calling the API Gateway's token endpoint using the OAuth2 client-credentials flow.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://{region}.api.jamfcloud.com/auth/token",
            "scopes": {
              "ztna:create": "",
              "ztna:delete": "",
              "ztna:read": "",
              "ztna:update": ""
            }
          }
        }
      }
    }
  },
  "x-scope-types": [
    "tenant",
    "environment"
  ],
  "servers": [
    {
      "url": "https://{region}.api.jamfcloud.com/securitycloud",
      "description": "Jamf Beta API Gateway - prod",
      "variables": {
        "region": {
          "default": "us",
          "enum": [
            "us",
            "eu",
            "apac"
          ],
          "description": "Geographic deployment region"
        }
      }
    }
  ],
  "security": [
    {
      "oauth2": []
    }
  ]
}
```