> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/networking/sdn/private-connect/createprivateconnect.md).

# CreatePrivateConnect

## 1. API Description

This API (CreatePrivateConnect) is used to create Private Connect

{% hint style="info" %}
**Notes**

* Currently only postpaid fixed-bandwidth Private Connects can be created.
* For cloud access operations, see the [Cloud Access Guide](https://docs.console.zenlayer.com/welcome/cloud-networking/get-started/validate-connection-in-public-cloud).
* This is an asynchronous API. Once the create request is successfully submitted, a Private Connect `ID` is returned, but the create operation is not completed immediately. During this period the instance status will be **`DEPLOYING`**. The creation result can be checked by calling the [**`DescribePrivateConnects`**](/api-reference/networking/sdn/private-connect/describeprivateconnects.md) API -- if the status (privateConnectStatus) changes from `DEPLOYING` (creating) to **AVAILABLE**, the creation succeeded; if no record is found, the creation failed. Do not perform any operation on the Private Connect while it is being created.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name     | Required | Type                                                                                      | Description                                                                                                                    |
| ------------------ | -------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| privateConnectName | Yes      | String                                                                                    | Private Connect name, up to 255 characters. Defaults to private-connect-{current timestamp}.                                   |
| bandwidthMbps      | Yes      | Integer                                                                                   | <p>Maximum bandwidth limit for the Private Connect, in Mbps.</p><p>Value range: \[10, +)</p><p>Default value: 10</p>           |
| endpointA          | Yes      | [CreateEndpointParam](/api-reference/networking/sdn/datastructure.md#createendpointparam) | Endpoint A of the Private Connect.                                                                                             |
| endpointZ          | Yes      | [CreateEndpointParam](/api-reference/networking/sdn/datastructure.md#createendpointparam) | Endpoint Z of the Private Connect.                                                                                             |
| resourceGroupId    | No       | String                                                                                    | Resource group ID. If not specified, the resource is placed in the default resource group.                                     |
| tags               | No       | [TagAssociation](/api-reference/networking/sdn/datastructure.md#tagassociation)           | <p>Tags associated when creating the Private Connect.</p><p>Note: associated <code>tag keys</code> must not be duplicated.</p> |
| marketingOptions   | No       | [MarketingInfo](/api-reference/networking/sdn/datastructure.md#marketinginfo)             | Marketing activity information.                                                                                                |

## 3. Output Parameters

| Parameter Name   | Type   | Description                                                                                                           |
| ---------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
| requestId        | String | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |
| orderNumber      | String | Order number.                                                                                                         |
| privateConnectId | String | Private Connect ID.                                                                                                   |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Create a Private Connect where Endpoint A is a data center port and Endpoint Z is a port, with a bandwidth of 10 Mbps.**

```json
POST /api/v2/sdn HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: CreatePrivateConnect
<Common Request Params>

Request:
{
   "endpointA": {
      "vlanId": 1001,
      "portId": "your port id"
   },
   "privateConnectName": "fra-sel-prviate-line",
   "endpointZ": {
      "vlanId": 2001,
      "portId": "your portId id"
   },
   "bandwidthMbps": 10
}

Response:
{   
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
     "requestId": "T98044459-95B2-477E-9A2F-00253A70CC6E",
     "privateConnectId": "your private connect id"
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                    | Description                                                      |
| ---------------- | ----------------------------- | ---------------------------------------------------------------- |
| 400              | INVALID\_GOOGLE\_PAIRING\_KEY | Invalid Google pairing key.                                      |
| 404              | INVALID\_PORT\_NOT\_FOUND     | The port does not exist.                                         |
| 400              | INVALID\_PORT\_STATUS         | Invalid port status.                                             |
| 400              | INVALID\_ENDPOINT\_PARAMETER  | Unable to determine the endpoint type from the given parameters. |
