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

# Create API Proxy from URL

> Creates an API proxy by parsing an OpenAPI (Swagger), WSDL specification from a URL, or creates a reverse proxy. The API proxy can be automatically deployed to specified environments after creation.

## Endpoint

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

## Authentication

Requires a Personal API Access Token.

### Header

```
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value            | Required |
| ------------- | ---------------- | -------- |
| Authorization | Bearer {token}   | Yes      |
| Content-Type  | application/json | Yes      |

### Path Parameters

| Parameter   | Type   | Required | Description  |
| ----------- | ------ | -------- | ------------ |
| projectName | string | Yes      | Project name |

### Request Body

#### Full JSON Body Example

```json theme={null}
{
  "apiProxyName": "petstore-api",
  "apiProxyDescription": "Petstore API Proxy",
  "apiProxyCreationType": "OPEN_API",
  "specUrl": "https://petstore.swagger.io/v2/swagger.json",
  "clientRoute": {
    "relativePathList": ["/api/v1"],
    "hostList": ["api.example.com"]
  },
  "routingInfo": {
    "routingAddressList": [
      {
        "address": "https://backend.example.com",
        "weight": 100,
        "healthCheckEnabled": true
      }
    ],
    "routingEnabled": true,
    "mirrorEnabled": false
  },
  "deploy": false,
  "deployTargetEnvironmentNameList": ["production"],
  "reParse": false,
  "soapToRest": false,
  "enableWSA": false,
  "enableWSRM": false,
  "backendApiVersion": "v1",
  "requestBodyReadBehavior": "ALWAYS_READ",
  "responseBodyReadBehavior": "ALWAYS_READ",
  "maintenanceModeSetting": {
    "enabled": false,
    "httpStatusCode": 503,
    "contentType": "application/json",
    "message": "Service is under maintenance"
  },
  "specAuthorizationValueList": [
    {
      "headerName": "Authorization",
      "headerValue": "Bearer token123"
    }
  ]
}
```

#### Request Body Fields

| Field                           | Type    | Required | Default      | Description                                                                               |
| ------------------------------- | ------- | -------- | ------------ | ----------------------------------------------------------------------------------------- |
| apiProxyName                    | string  | Yes      | -            | API Proxy name (must be unique within project)                                            |
| apiProxyDescription             | string  | No       | -            | API Proxy description                                                                     |
| apiProxyCreationType            | string  | Yes      | -            | API creation type                                                                         |
| specUrl                         | string  | Yes\*    | -            | Specification URL (required if not reverse proxy)                                         |
| clientRoute                     | object  | No       | -            | Client route configuration                                                                |
| routingInfo                     | object  | No       | -            | Routing configuration                                                                     |
| deploy                          | boolean | No       | false        | Whether to deploy after creation                                                          |
| deployTargetEnvironmentNameList | array   | No       | \[]          | List of environment names to deploy to                                                    |
| reParse                         | boolean | No       | false        | Whether to reparse existing API proxy                                                     |
| soapToRest                      | boolean | No       | false        | Enable SOAP to REST transformation                                                        |
| enableWSA                       | boolean | No       | false        | Enable WS-Addressing (SOAP only)                                                          |
| enableWSRM                      | boolean | No       | false        | Enable WS-ReliableMessaging (SOAP only)                                                   |
| backendApiVersion               | string  | No       | -            | Backend API version                                                                       |
| requestBodyReadBehavior         | string  | No       | ALWAYS\_READ | Request body read behavior. Values: `ALWAYS_READ`, `READ_IF_POLICY_EXISTS`, `NEVER_READ`  |
| responseBodyReadBehavior        | string  | No       | ALWAYS\_READ | Response body read behavior. Values: `ALWAYS_READ`, `READ_IF_POLICY_EXISTS`, `NEVER_READ` |
| maintenanceModeSetting          | object  | No       | -            | Maintenance mode settings                                                                 |
| specAuthorizationValueList      | array   | No       | \[]          | Authorization headers for spec URL access                                                 |

### EnumApiProxySpecType

* `OPEN_API` - OpenAPI 3.0 specification
* `SWAGGER` - Swagger 2.0 specification
* `WSDL` - WSDL specification (SOAP)
* `REVERSE_PROXY` - Reverse proxy (no spec file)

**Note:** For `REVERSE_PROXY`, `specUrl` is not required.

#### clientRoute

| Field            | Type  | Required | Description                                        |
| ---------------- | ----- | -------- | -------------------------------------------------- |
| relativePathList | array | No       | List of relative paths (e.g., \["/api/v1"])        |
| hostList         | array | No       | List of virtual hosts (e.g., \["api.example.com"]) |

#### routingInfo

| Field              | Type    | Required | Default | Description                  |
| ------------------ | ------- | -------- | ------- | ---------------------------- |
| routingAddressList | array   | No       | -       | List of backend addresses    |
| routingEnabled     | boolean | No       | true    | Whether routing is enabled   |
| mirrorEnabled      | boolean | No       | false   | Whether mirroring is enabled |

#### routingAddressList Item

| Field              | Type    | Required | Default | Description           |
| ------------------ | ------- | -------- | ------- | --------------------- |
| address            | string  | Yes      | -       | Backend address URL   |
| weight             | integer | No       | 100     | Load balancing weight |
| healthCheckEnabled | boolean | No       | false   | Enable health check   |

#### maintenanceModeSetting

| Field          | Type    | Required | Default          | Description                           |
| -------------- | ------- | -------- | ---------------- | ------------------------------------- |
| enabled        | boolean | No       | false            | Enable maintenance mode               |
| httpStatusCode | integer | No       | 503              | HTTP status code for maintenance      |
| contentType    | string  | No       | application/json | Content type for maintenance response |
| message        | string  | No       | -                | Maintenance message                   |

#### specAuthorizationValueList Item

| Field       | Type   | Required | Description                            |
| ----------- | ------ | -------- | -------------------------------------- |
| headerName  | string | Yes      | Header name (e.g., "Authorization")    |
| headerValue | string | Yes      | Header value (e.g., "Bearer token123") |

## Response

### Success Response (200 OK)

```json theme={null}
{
  "status": "SUCCESS",
  "resultList": null,
  "resultCount": null,
  "deploymentResult": {
    "envName": "production",
    "podName": "",
    "podIp": "",
    "success": true,
    "detail": "",
    "responseTime": 123,
    "detailList": []
  }
}
```

When `deploy: false` or deployment targets are empty, `deploymentResult` is `null`.

#### Response Fields

| Field                                  | Type    | Description                                                                      |
| -------------------------------------- | ------- | -------------------------------------------------------------------------------- |
| status                                 | string  | `SUCCESS` if the request was successful                                          |
| deploymentResult                       | object  | Deployment result (present only if `deploy=true` and environments are specified) |
| deploymentResult.success               | boolean | Overall deployment success                                                       |
| deploymentResult.detailList            | array   | Per-pod deployment results                                                       |
| deploymentResult.detailList\[].envName | string  | Environment name                                                                 |
| deploymentResult.detailList\[].success | boolean | Pod-level deployment success                                                     |
| deploymentResult.detailList\[].detail  | string  | Detail message (on failure)                                                      |

### Error Response (400 Bad Request)

```json theme={null}
{
  "status": "FAILURE",
  "resultMessage": "ApiProxy (name: petstore-api) is already exist!"
}
```

#### Common Causes

* API Proxy name already exists
* Invalid specification URL
* Invalid API creation type
* Invalid specification format
* Project not found or no permission

### Error Response (401 Unauthorized)

```json theme={null}
{
  "status": "FAILURE",
  "resultMessage": "Token is not valid!"
}
```

## cURL Example

```bash theme={null}
curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/url/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "apiProxyName": "petstore-api",
    "apiProxyDescription": "Petstore API Proxy",
    "apiProxyCreationType": "OPEN_API",
    "specUrl": "https://petstore.swagger.io/v2/swagger.json",
    "clientRoute": {
      "relativePathList": ["/api/v1"]
    },
    "deploy": false,
    "reParse": false,
    "soapToRest": false
  }'
```

## Permissions

User must have **`API_MANAGEMENT` + `MANAGE`** permission in the project. For deployment operations (when `deploy: true` is set), user must also have **`API_MANAGEMENT` + `DEPLOY_UNDEPLOY`** permission.

## Notes and Warnings

* **Unique Names**: API Proxy names must be unique within a project
* **Specification Access**: Ensure the specification URL is accessible. Use `specAuthorizationValueList` if authentication is required
* **Reparse**: Set `reParse: true` to update an existing API proxy from a new specification
* **Deployment**: If `deploy: true`, ensure environments exist and user has deployment permissions
* **SOAP Features**: `enableWSA` and `enableWSRM` are only applicable for SOAP APIs
* **Reverse Proxy**: For reverse proxy, `specUrl` is not required
* **License Limits**: Creating API proxies may be subject to license limits

## 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
* [Update API Proxy](/api-reference/api-proxies/crud/update-api-proxy) - Update API proxy
* [Deploy API Proxy](/api-reference/api-proxies/deployment/deploy-api-proxy) - Deploy API proxy
