Export API Proxy
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 |
| X-Apinizer-Package-Passphrase | Base64 of the UTF-8 passphrase | Only when encrypt=true |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| encrypt | boolean | No | false | When true, encrypts the entire export package — including object names — with the passphrase supplied in the X-Apinizer-Package-Passphrase header |
| withDependencies | boolean | No | false | When true, the package also includes every object the proxy references (global policies, policy groups, certificates, credentials, connections, LLM providers, environment variables, etc.), which the import binds to same-named objects in the target project. When false (default), only the proxy itself is exported (previous behavior) |
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="<apiProxyName>.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)
{
"status": "FAILURE",
"resultMessage": "projectName value can not be empty!"
}
or
{
"status": "FAILURE",
"resultMessage": "apiProxyName value can not be empty!"
}
or
{
"status": "FAILURE",
"resultMessage": "ApiProxy (name: MyAPI) was not found!"
}
or
{
"status": "FAILURE",
"resultMessage": "Package encryption requested but no passphrase was supplied."
}
or
{
"status": "FAILURE",
"resultMessage": "Export package could not be encrypted."
}
Common Causes
- Empty
projectNameorapiProxyName - API Proxy does not exist in the project
- Project does not exist or user does not have access
encrypt=truewas requested but theX-Apinizer-Package-Passphraseheader was not provided- The package could not be encrypted with the supplied passphrase
Error Response (401 Unauthorized)
{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}
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
Example 3: Export an Encrypted API Proxy Package
curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/export/?encrypt=true" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Apinizer-Package-Passphrase: $(printf '%s' 'my-passphrase' | base64)" \
--output apiProxyExportFile.zip
Example 4: Export an API Proxy with its Dependencies
curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/export/?withDependencies=true" \
-H "Authorization: Bearer YOUR_TOKEN" \
--output apiProxyExportFile.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:
- The download is named after the API Proxy, for example
MyAPI.zip - The name is sanitized, so a proxy whose name contains a slash or another reserved character still produces a valid file name
- You can rename the downloaded file as needed
- The download is named after the API Proxy, for example
-
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_IMPORTpermission 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:
- By default, export files are unencrypted and contain sensitive configuration data
- Set
encrypt=truewith a passphrase to encrypt the entire package - Store exported files securely
- Do not share exported files publicly
- Share the passphrase through a channel separate from the exported file
-
Package Encryption:
- Encryption is optional and fully backward compatible — when
encryptis omitted orfalse, the package is produced as a plain ZIP file, byte-compatible with earlier Apinizer versions - When
encrypt=true, the entire package — including object names — is encrypted with the supplied passphrase, so nothing about its contents can be observed from the outside - The encryption key is derived from the passphrase; the passphrase itself is never written into the package
- The passphrase is never stored and cannot be recovered — if it is lost, the encrypted package can no longer be opened
- The same passphrase must be supplied when importing the encrypted package
- Encryption is optional and fully backward compatible — when
-
API Proxy State:
- Export includes current state of API Proxy
- Includes deployed and undeployed configurations
- Deployment status is preserved in export
-
Dependency Bundling (
withDependencies):- When omitted or
false, only the proxy itself is exported (default, previous behavior) - When
true, every object the proxy references — global policies, policy groups, certificates, credentials, connections, LLM providers, environment variables, and more — is bundled into the same package - On import, the target project's
withDependencies=trueresolves bundled objects against same-named objects already in the target project - Has no effect on the proxy itself; it only controls whether referenced objects are packaged alongside it
- When omitted or
Related Documentation
- Import API Proxy - 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