Export API Proxy
Overview
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-streamContent-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)
{
"error": "bad_request",
"error_description": "projectName value can not be empty!"
}
or
{
"error": "bad_request",
"error_description": "apiProxyName value can not be empty!"
}
or
{
"error": "bad_request",
"error_description": "ApiProxy (name: MyAPI) was not found!"
}
Common Causes
- Empty
projectNameorapiProxyName - API Proxy does not exist in the project
- Project does not exist or user does not have access
Error Response (401 Unauthorized)
{
"error": "unauthorized_client",
"error_description": "Invalid token"
}
Error Response (404 Not Found)
{
"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
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
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
- Default filename:
- Complete Export:
- Export includes all API Proxy configurations
- Includes all associated policies
- Includes routing, cache, CORS, and other settings
- Permissions:
- Requires
ROLE_MANAGE_PROXIESpermission - User must have access to the project
- Requires
- 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) - Import API Proxy without overriding existing one
- Import API Proxy (With Override) - Import API Proxy with override option
- Get API Proxy - Get API Proxy details