---
title: "Create a tenant"
method: POST
path: "/tenants"
tags: ["Administration"]
---

# Create a tenant

`POST /tenants`

Create an new tenant.

## Request body

- object
  - `name` string, required — The name of the tenant.
  - `domain` string, required — The SIP domain of tenant. It is usually a fully qualified domain name (FQDN). If there is no FQDN, you can also use the IP address of the PBX server as the SIP domain. The SIP domain name is only used for SIP message authentication and does not require analysis.
  - `website` string — The official website of tenant.
  - `timezone` string, required — The IANA Time Zone names, such as "Asia/Shanghai".
  - `currency` string, required — The Currency code (ISO 4217).
  - `region` string, required — A valid country code based on iso3166-1 alpha-3 standard. see: https://www.iso.org/iso-3166-country-codes.html
  - `enabled` boolean — Enable this tenant or not.
  - `enable_video_recording` boolean — Allow extension video recording.
  - `enable_audio_recording` boolean — Allow extension audio recording.
  - `enable_dual_track_recording` boolean — Allow dual track recording for calls.
  - `enable_billing` boolean — Enable call billing or not.
  - `enable_feature_billing` boolean — Enable call billing feature or not.
  - `enable_feature_call_statistics` boolean — Enable call statistics feature or not.
  - `enable_feature_contact_center` boolean — Enable contact center feature or not.
  - `enable_feature_message_channels` boolean — Enable message channels feature or not.
  - `enable_feature_microsoft_teams` boolean — Enable Microsoft Teams feature or not.
  - `enable_feature_trunks` boolean — Enable trunks feature or not.
  - `enable_feature_whats_app` boolean — Enable WhatsApp feature or not.
  - `custom_options` string — Some custom configuration options serialized as json string
  - `max_extensions` integer — The maximum number of users that the tenant is allowed to create.
  - `max_concurrent_calls` integer — The maximum number of concurrent calls that the tenant is allowed to have.
  - `max_ring_groups` integer — The maximum number of ring groups that the tenant is allowed to create.
  - `max_virtual_receptionists` integer — The maximum number of virtual receptionists that the tenant is allowed to create.
  - `max_call_queues` integer — The maximum number of call queues that the tenant is allowed to create.
  - `max_conference_rooms` integer — The maximum number of conference rooms that the tenant is allowed to be online at the same time.
  - `disk_quota` string — The maximum size of disk space that the tenant is allowed to have. Specify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed. For example: 100MB, 1000GB. Leave it empty, means unlimited.
  - `im_disk_quota` string — The maximum size of disk space that the tenant is allowed to have for IM service. Specify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed. For example: 100MB, 1000GB. Leave it empty, means unlimited.
  - `extension_im_disk_quota` string — The maximum size of disk space that the extension user is allowed to have for IM service. Specify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed. For example: 100MB, 1000GB. Leave it empty, means unlimited.
  - `recording_retention` integer — The retention period in days of recordings.
  - `call_report_retention` integer — The retention period in days of call report files.
  - `log_retention` integer — The retention period in days of audit logs and event logs.
  - `temp_file_retention` integer — The retention period in days of temporary files.
  - `office_hours` object
    - `monday` object
      - `enabled` boolean — When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[] — Multiple start and end time periods make up the working time.
        - `from` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `tuesday` object
      - `enabled` boolean — When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[] — Multiple start and end time periods make up the working time.
        - `from` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `wednesday` object
      - `enabled` boolean — When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[] — Multiple start and end time periods make up the working time.
        - `from` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `thursday` object
      - `enabled` boolean — When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[] — Multiple start and end time periods make up the working time.
        - `from` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `friday` object
      - `enabled` boolean — When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[] — Multiple start and end time periods make up the working time.
        - `from` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `saturday` object
      - `enabled` boolean — When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[] — Multiple start and end time periods make up the working time.
        - `from` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
    - `sunday` object
      - `enabled` boolean — When enabled, all day is working time, when disabled, all day is vacation time.
      - `ranges` object[] — Multiple start and end time periods make up the working time.
        - `from` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "09:00". Must be earlier than `to`.
        - `to` string — The start time for office hour with format `HH:MM` in 24 hour clock, such as "17:00". Must be later than `from`.
  - `e164` object
    - `enabled` boolean — Enable number processing or not.
    - `international_code` string — The International code.
    - `country` string — Country code.
    - `area_code` string — Area code.
    - `national_code` string — National code.
    - `prefix` string — Add prefix.
    - `remove_special_chars` boolean — Remove special characters in the numbers(the "(" and ")" and spaces).
    - `remove_duplicate_countries` boolean — Remove duplicate countries.
    - `remove_duplicate_area_codes` boolean — Remove duplicate area code.
  - `cdr_event` object
    - `enabled` boolean — Enabled this event or not.
    - `auth` 'DISABLE' | 'BASIC' | 'DIGEST' | 'BEARER' — The authentication method of event URL: Can be either: - `DISABLE`: Disable authentication. - `BASIC`: Use basic authentication. - `DIGEST`: Use digest authentication. - `BEARER`: Use bearer authentication.
    - `username` string — The username for authentication, when auth is `BASIC` or `DIGEST`.
    - `password` string — The password for authentication, when auth is `BASIC` or `DIGEST`.
    - `token` string — The token for authentication, when auth is `BEARER`.
    - `url` string — The event url.
  - `extension_event` object
    - `enabled` boolean — Enabled this event or not.
    - `auth` 'DISABLE' | 'BASIC' | 'DIGEST' | 'BEARER' — The authentication method of event URL: Can be either: - `DISABLE`: Disable authentication. - `BASIC`: Use basic authentication. - `DIGEST`: Use digest authentication. - `BEARER`: Use bearer authentication.
    - `username` string — The username for authentication, when auth is `BASIC` or `DIGEST`.
    - `password` string — The password for authentication, when auth is `BASIC` or `DIGEST`.
    - `token` string — The token for authentication, when auth is `BEARER`.
    - `url` string — The event url.
  - `contact_match_type` 'DISABLE' | 'MATCH_EXACTLY' | 'MATCH_LENGTH' — The match method of contact: Can be either: - `DISABLE`: Disable match. - `MATCH_EXACTLY`: Match exactly. - `MATCH_LENGTH`: Match at least specified number of characters.
  - `contact_match_length` integer — The matched length of characters when contact_match_type is `MATCH_LENGTH`.
  - `contact_append_type` 'DISABLE' | 'APPEND' | 'PREPEND' — Method for adding Group, Queue or DID/DDI Names to Caller ID: Can be either: - `DISABLE`: Do not add. - `APPEND`: Append names. - `PREPEND`: Prepend names.
  - `contact_update_interval` integer — The interval for synchronizing contacts from the server, in minutes.

## Response `201`

Created

- object
  - `id` string — The unique ID of the resource.

## Other responses

- `4XX` — Error

---

[API](https://skmtc.net/portsip/apis/portsip-pbx-rest-api.md) · [All operations](https://skmtc.net/portsip/apis/portsip-pbx-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portsip/portsip-pbx-rest-api/revisions/577415d4a3d5/schema)
