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

# Import API Proxy

> Imports an API Proxy from a ZIP file. If an API Proxy with the same name already exists, the imported API Proxy will have a suffix added to its name and relative path to prevent conflicts. This method does not override existing API Proxies.

## Endpoint

```
POST /apiops/projects/{projectName}/apiProxies/import/
```

## Authentication

Requires a Personal API Access Token.

### Header

```
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value               | Required |
| ------------- | ------------------- | -------- |
| Authorization | Bearer {token}      | Yes      |
| Content-Type  | multipart/form-data | Yes      |

### Path Parameters

| Parameter   | Type   | Required | Description                                       |
| ----------- | ------ | -------- | ------------------------------------------------- |
| projectName | string | Yes      | Project name where the API Proxy will be imported |

### Form Data

| Parameter          | Type | Required | Description                                                          |
| ------------------ | ---- | -------- | -------------------------------------------------------------------- |
| apiProxyExportFile | file | Yes      | ZIP file containing the API Proxy export. Must have `.zip` extension |

### Notes

* File must be a valid ZIP archive
* File must end with `.zip` extension (case-insensitive)
* ZIP file must contain a valid API Proxy export JSON file
* If an API Proxy with the same name exists, a suffix will be added automatically

## Response

### Success Response (200 OK)

```json theme={null}
{
  "status": "SUCCESS"
}
```

#### Response Fields

| Field  | Type   | Description                             |
| ------ | ------ | --------------------------------------- |
| status | string | Response status: `SUCCESS` or `FAILURE` |

### 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": "apiProxyExportFile value can not be empty!"
}
```

or

```json theme={null}
{
  "error": "bad_request",
  "error_description": "apiProxyExportFile parameter must be in zip file format and must end with zip extension!"
}
```

#### Common Causes

* Empty `projectName`
* Empty or missing file
* File is not a ZIP archive
* File does not have `.zip` extension
* Invalid API Proxy export format

### 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: Import API Proxy

```bash theme={null}
curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/import/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "apiProxyExportFile=@apiProxyExportFile.zip"
```

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

```bash theme={null}
curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/import/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "apiProxyExportFile=@my-api-export.zip"
```

## Notes and Warnings

* **No Override**:
  * This endpoint does not override existing API Proxies
  * If an API Proxy with the same name exists, a suffix will be added automatically
  * Original API Proxy remains unchanged

* **Automatic Naming**:
  * Imported API Proxy name may be modified if a conflict exists
  * Relative paths may also be modified to prevent conflicts
  * Check the imported API Proxy name after import

* **File Format**:
  * File must be a valid ZIP archive
  * File must end with `.zip` extension (case-insensitive)
  * ZIP file must contain valid API Proxy export JSON

* **Project Validation**:
  * Project must exist
  * User must have access to the project
  * User must have `API_MANAGEMENT` + `EXPORT_IMPORT` permission

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

* **Deployment Status**:
  * Imported API Proxy is not deployed by default
  * Deployment status from export is preserved
  * You may need to deploy the imported API Proxy manually

## Permissions

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

* Alternatively, user can have project admin role

* **File Size**:
  * Large export files may take longer to import
  * Ensure sufficient network bandwidth and server resources

* **Validation**:
  * Import validates API Proxy structure
  * Invalid configurations may cause import to fail
  * Check error messages for validation issues

## Related Documentation

* [Export API Proxy](/api-reference/api-proxies/crud/export-api-proxy) - Export API Proxy to ZIP file
* [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
* [List API Proxies](/api-reference/api-proxies/crud/list-api-proxies) - List all API Proxies in project
