> ## 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.

# Export API Proxy

> Exports an API Proxy with its policies and configuration in ZIP format. The exported file contains the complete API Proxy definition in JSON format, including all endpoints, policies, settings, and configurations.

## Endpoint

```
GET /apiops/projects/{projectName}/apiProxies/{apiProxyName}/export/
```

## 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 |

### Query Parameters

None.

## Response

### Success Response (200 OK)

The response is a ZIP file containing the API Proxy export.

### Headers

* `Content-Type: application/octet-stream`
* `Content-Disposition: attachment; filename="apiProxyExportFile.zip"`

### Response Body

* Binary ZIP file containing:
  * API Proxy JSON definition file
  * All associated policies
  * All configurations and settings

### ZIP File Contents

* `{apiProxyName}.json` - Complete API Proxy definition in JSON format
* Contains all endpoints, policies, settings, routing configurations, etc.

### Error Response (400 Bad Request)

```json theme={null}
{
  "error": "bad_request",
  "error_description": "projectName value can not be empty!"
}
```

or

```json theme={null}
{
  "error": "bad_request",
  "error_description": "apiProxyName value can not be empty!"
}
```

or

```json theme={null}
{
  "error": "bad_request",
  "error_description": "ApiProxy (name: MyAPI) was not found!"
}
```

#### Common Causes

* Empty `projectName` or `apiProxyName`
* API Proxy does not exist in the project
* Project does not exist or user does not have access

### 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) was not found or user does not have privilege to access it!"
}
```

## cURL Example

### Example 1: Export API Proxy

```bash theme={null}
curl -X GET \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/export/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  --output apiProxyExportFile.zip
```

### Example 2: Export API Proxy with Custom Filename

```bash theme={null}
curl -X GET \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/export/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  --output my-api-export.zip
```

## Notes and Warnings

* **Export Format**:
  * Exported file is a ZIP archive
  * Contains JSON file with complete API Proxy definition
  * Includes all policies, endpoints, settings, and configurations

* **File Naming**:
  * Default filename: `apiProxyExportFile.zip`
  * API Proxy name is sanitized for use in internal file names
  * You can rename the downloaded file as needed

* **Complete Export**:
  * Export includes all API Proxy configurations
  * Includes all associated policies
  * Includes routing, cache, CORS, and other settings

## Permissions

* User must have **`API_MANAGEMENT` + `EXPORT_IMPORT`** permission in the project

* Alternatively, user can have project admin role

* **File Size**:
  * Export file size depends on API Proxy complexity
  * Large API Proxies with many policies may result in larger files

* **Import Compatibility**:
  * Exported files can be imported using Import endpoints
  * Compatible with Import without Override and Import with Override endpoints

* **Security**:
  * Export files contain sensitive configuration data
  * Store exported files securely
  * Do not share exported files publicly

* **API Proxy State**:
  * Export includes current state of API Proxy
  * Includes deployed and undeployed configurations
  * Deployment status is preserved in export

## Related Documentation

* [Import API Proxy (Without Override)](/api-reference/api-proxies/crud/import-api-proxy-without-override) - Import API Proxy without overriding existing one
* [Import API Proxy (With Override)](/api-reference/api-proxies/crud/import-api-proxy-and-override) - Import API Proxy with override option
* [Get API Proxy](/api-reference/api-proxies/crud/get-api-proxy) - Get API Proxy details
