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

# Delete API Proxy

> Deletes an API proxy from a project. The API proxy is permanently removed and automatically undeployed from all environments.

## Endpoint

```
DELETE /apiops/projects/{projectName}/apiProxies/{apiProxyName}/
```

## Authentication

Requires a Personal API Access Token.

### Header

```
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value          | Required |
| ------------- | -------------- | -------- |
| Authorization | Bearer {token} | Yes      |

### Path Parameters

| Parameter    | Type   | Required | Description                 |
| ------------ | ------ | -------- | --------------------------- |
| projectName  | string | Yes      | Project name                |
| apiProxyName | string | Yes      | API Proxy name (must exist) |

### Query Parameters

None

### Request Body

This endpoint does not require a request body.

## Response

### Success Response (200 OK)

```json theme={null}
{
  "success": true,
  "deploymentResult": {
    "success": true,
    "deploymentResults": [
      {
        "environmentName": "production",
        "success": true,
        "message": "Undeployment successful"
      },
      {
        "environmentName": "staging",
        "success": true,
        "message": "Undeployment successful"
      }
    ]
  }
}
```

#### Response Fields

| Field                                                 | Type    | Description                                 |
| ----------------------------------------------------- | ------- | ------------------------------------------- |
| success                                               | boolean | Indicates if the request was successful     |
| deploymentResult                                      | object  | Undeployment result                         |
| deploymentResult.success                              | boolean | Overall undeployment success                |
| deploymentResult.deploymentResults                    | array   | Individual environment undeployment results |
| deploymentResult.deploymentResults\[].environmentName | string  | Environment name                            |
| deploymentResult.deploymentResults\[].success         | boolean | Undeployment success for this environment   |
| deploymentResult.deploymentResults\[].message         | string  | Undeployment message                        |

### Error Response (400 Bad Request)

```json theme={null}
{
  "error": "bad_request",
  "error_description": "Api Proxy (petstore-api) is not found!"
}
```

#### Common Causes

* API Proxy name does not exist
* API Proxy name is empty

### Error Response (401 Unauthorized)

```json theme={null}
{
  "error": "unauthorized_client",
  "error_description": "Invalid token"
}
```

### Error Response (404 Not Found)

```json theme={null}
{
  "error": "not_found",
  "error_description": "Project (MyProject) is not found or user does not have privilege to access it!"
}
```

## cURL Example

```bash theme={null}
curl -X DELETE \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/petstore-api/" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Full JSON Body Example

This endpoint does not require a request body.

## Notes and Warnings

* **Permanent Deletion**: API Proxy deletion is permanent and cannot be undone
* **Automatic Undeployment**: The API proxy is automatically undeployed from all environments where it was deployed
* **Dependencies**: Ensure no other resources depend on the API proxy before deletion
* **Policies**: All policies associated with the API proxy are also deleted
* **Case Sensitivity**: API Proxy names are case-sensitive

## Permissions

User must have **`API_MANAGEMENT` + `MANAGE`** permission in the project. For undeployment operations (when undeploying API Proxy from environments), user must also have **`API_MANAGEMENT` + `DEPLOY_UNDEPLOY`** permission.

## Related Documentation

* [List API Proxies](/api-reference/api-proxies/crud/list-api-proxies) - List all API proxies
* [Get API Proxy](/api-reference/api-proxies/crud/get-api-proxy) - Get API proxy details
* [Create API Proxy from URL](/api-reference/api-proxies/crud/create-api-proxy-from-url) - Create a new API proxy
* [Update API Proxy](/api-reference/api-proxies/crud/update-api-proxy) - Update an API proxy
