> 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/data-center-port/createport.md).

# CreatePort

## 1. API Description

This API (CreatePort) is used to create Port

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

* This is an asynchronous API. Once the create-port request is successfully submitted, a list of port `ID`s is returned, but the create operation is not completed immediately. During this period the port status will be **`CREATING`**. You can check the result by calling [**DescribePorts**](/api-reference/networking/sdn/data-center-port/describeports.md#describeports) — if the port status changes from **`CREATING`** to **`RUNNING`**, the port was created successfully; otherwise it is still being created. Do not perform any operation on the port while it is being created.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name     | Required | Type                                                                            | Description                                                                                                                                                      |
| ------------------ | -------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| dcId               | Yes      | String                                                                          | Data center four-letter code. Obtainable via the [DescribeDataCenters](/api-reference/networking/sdn/location/describedatacenters.md) API.                       |
| portName           | Yes      | String                                                                          | Port name, up to 255 characters. It is recommended to use the data center four-letter code plus the port spec.                                                   |
| portType           | Yes      | String                                                                          | Port spec. Obtainable via the [DescribeDataCenterPortPrice](/api-reference/networking/sdn/data-center-port/describedatacenterportprice.md) API. Valid values: 1G |
| businessEntityName | Yes      | String                                                                          | Business entity name, used as the LOA letterhead.                                                                                                                |
| portRemarks        | No       | String                                                                          | Port remarks, up to 255 characters.                                                                                                                              |
| marketingOptions   | No       | [MarketingInfo](/api-reference/networking/sdn/datastructure.md#marketinginfo)   | Marketing activity information.                                                                                                                                  |
| tags               | No       | [TagAssociation](/api-reference/networking/sdn/datastructure.md#tagassociation) | <p>Tags associated when creating the port.</p><p>Note: associated <code>tag keys</code> must not be duplicated.</p>                                              |

## 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 | The order number generated by creating the port.                                                                      |
| portId         | String | The ID of the successfully created port.                                                                              |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Create a 1G port in Singapore 1 (SIN1).**

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

Request:
{
  "dcId": "SIN1",
  "portName": "your-port-name",
  "portRemarks": "your-port-remarks",
  "portType": "1G",
  "businessEntityName": "your-business-entity-name"
}

Response:
{
  "requestId": "T3811A0E7-C250-40A2-96AD-08AD759E1BC2",
  "response": {
    "requestId": "T3811A0E7-C250-40A2-96AD-08AD759E1BC2",
    "orderNumber": "your-order-number",
    "portId": "your-port-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 |
| ---------------- | ---------- | ----------- |
