> For the complete documentation index, see [llms.txt](https://docs.etelecom.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.etelecom.vn/api-etelecom-english/api-integration/vpbx/pbx-rest-apis/create-extension.md).

# Create extension

This API is used to create extensions on the tenant.

{% hint style="info" %}
**Note:**

* For APIs used for Shop, the API key is: [`<api_key>`](/api-etelecom-english/api-integration/shop/account.md). The base\_url information of the [Shop](/api-etelecom-english/api-integration/shop/account.md).
* For APIs used for Partner, the API key is: [`<shop_key>`](/api-etelecom-english/api-integration/partner/usage.md#retrieve-the-shop_key-information). The base\_url information of the [Partner](/api-etelecom-english/api-integration/partner/account.md).
  {% endhint %}

{% openapi src="/files/98tvgFAALfk6gcxXW2re" path="$BASE\_URL.ETelecom/CreateExtension" method="post" %}
[Etelecom.swagger.json](https://1712041776-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzzTMjVbVjwTuSbEGC7Ya%2Fuploads%2Fgit-blob-a79f1cdcdf6c0710885851e38f1e6c641fafb69b%2FEtelecom.swagger.json?alt=media)
{% endopenapi %}

**Request:**

```json
curl --location '$BASE_URL.Etelecom/CreateExtension' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $API_KEY' \
--data '{
  "extension_number": 1001,
  "hotline_id": "string",
  "user_id": "string"
}'
```

**Response Sample:**

```json
{
  "account_id": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "extension_number": "string",
  "extension_password": "string",
  "hotline_id": "string",
  "id": "string",
  "state": "Z",
  "subscription_id": "string",
  "tenant_domain": "string",
  "tenant_id": "string",
  "updated_at": "2019-08-24T14:15:22Z",
  "user_id": "string"
}
```

**Request body structure:**

| School name                                                             | Data type | Describe                          |
| ----------------------------------------------------------------------- | --------- | --------------------------------- |
| <p>hotline\_id</p><p><mark style="color:red;">required</mark></p>       | string    | ID hotline                        |
| <p>extension\_number</p><p><mark style="color:red;">required</mark></p> | int       | Extension number                  |
| user\_id                                                                | string    | Employee ID assigned to extension |

**Return data attribute structure:**

<table><thead><tr><th>School name</th><th width="189">Data type</th><th>Describe</th></tr></thead><tbody><tr><td>id</td><td>string</td><td>Extension ID</td></tr><tr><td>user_id</td><td>string</td><td>Employee ID assigned to extension</td></tr><tr><td>account_id</td><td>string</td><td>Account ID</td></tr><tr><td>extension_number</td><td>string</td><td>Extension number</td></tr><tr><td>extension_password</td><td>string</td><td>Extension password</td></tr><tr><td>tenant_id</td><td>string</td><td>Call center ID</td></tr><tr><td>tenant_domain</td><td>string</td><td>Domain of the switchboard</td></tr><tr><td>hotline_id</td><td>string</td><td>Hotline ID</td></tr><tr><td>created_at</td><td>string</td><td>Extension initialization time</td></tr><tr><td>updated_at</td><td>string</td><td>Extension update time</td></tr><tr><td>expires_at</td><td>string</td><td>Extension Expiration Time</td></tr><tr><td>subscription_id</td><td>string&#x3C;date-time></td><td>Registration ID</td></tr><tr><td>state</td><td>string</td><td><p>Status</p><p><strong><code>Z</code></strong>: Newly created<br><strong><code>P</code></strong>: Valid<br><strong><code>N</code></strong>: Expired</p></td></tr></tbody></table>
