# Administrations

Manage PBX System.

## Retrieve network configurations

> Get network configurations.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/network":{"get":{"tags":["Administration"],"operationId":"retrieveNetworkConfigurations","summary":"Retrieve network configurations","description":"Get network configurations.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"web_domain":{"type":"string","description":"The web domain for PortSIP PBX\n"},"private_ipv4":{"type":"string","description":"The private IPv4 of system.\n"},"public_ipv4":{"type":"string","description":"The public IPv4 of system.\n"},"enable_ipv6":{"type":"boolean","default":true,"description":"Indicates if IPv6 would be enabled.\n"},"private_ipv6":{"type":"string","description":"The private IPv6 of system.\n"},"public_ipv6":{"type":"string","description":"The public IPv6 of system.\n"},"primary_dns_server":{"type":"string","description":"The primary DNS server.\n"},"secondary_dns_server":{"type":"string","description":"The secondary DNS server.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update network configurations

> Update network configurations for PortSIP PBX.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/network":{"post":{"tags":["Administration"],"operationId":"updateNetworkConfigurations","summary":"Update network configurations","description":"Update network configurations for PortSIP PBX.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"web_domain":{"type":"string","description":"The web domain for PortSIP PBX\n"},"private_ipv4":{"type":"string","description":"The private IPv4 of system.\n"},"public_ipv4":{"type":"string","description":"The public IPv4 of system.\n"},"enable_ipv6":{"type":"boolean","default":true,"description":"Indicates if IPv6 would be enabled.\n"},"private_ipv6":{"type":"string","description":"The private IPv6 of system.\n"},"public_ipv6":{"type":"string","description":"The public IPv6 of system.\n"},"primary_dns_server":{"type":"string","description":"The primary DNS server.\n"},"secondary_dns_server":{"type":"string","description":"The secondary DNS server.\n"}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve current system status

> Get current status of system.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/admin/status":{"get":{"tags":["Administration"],"operationId":"retrieveCurrentSystemStatus","summary":"Retrieve current system status","description":"Get current status of system.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"The version information of PortSIP PBX.\n"},"news":{"type":"string","description":"The news information of PortSIP PBX.\n"},"license_key":{"type":"string","description":"The license key of PortSIP PBX.\n"},"license_type":{"type":"string","description":"The license type of product.\n"},"maintenance_expires_at":{"allOf":[{"type":"string","format":"date_time","description":"The RFC 3339 format is defined by\nThe date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), \nfor example, 2017-07-21T17:32:28Z\n"}],"description":"The maintenance expiry time.\n"},"max_concurrent_calls":{"type":"integer","format":"int32","description":"The number of authorized concurrent calls purchased by the user.\n"},"licensed_users":{"type":"integer","format":"int32","description":"The maximum number of authorized users purchased by the system admin.\n"},"current_users":{"type":"integer","format":"int32","description":"The number of current users of the system.\n"},"online_users":{"type":"integer","format":"int32","description":"The number of current online users of the system.\n"},"current_tenants":{"type":"integer","format":"int32","description":"The number of current tenants of the system.\n"},"current_dealers":{"type":"integer","format":"int32","description":"The number of current dealers of the system.\n"},"current_calls":{"type":"integer","format":"int32","description":"The current number of calls.\n"},"current_trunks":{"type":"integer","format":"int32","description":"The current number of trunks.\n"},"current_conference_servers":{"type":"integer","format":"int32","description":"The current number of conference servers.\n"},"current_media_servers":{"type":"integer","format":"int32","description":"The current number of media servers.\n"},"current_call_queue_servers":{"type":"integer","format":"int32","description":"The current number of call queue servers.\n"},"current_ivr_servers":{"type":"integer","format":"int32","description":"The current number of ivr servers.\n"},"calls_in_24_hours":{"type":"array","items":{"type":"object","properties":{"time":{"allOf":[{"type":"string","format":"date_time","description":"The RFC 3339 format is defined by\nThe date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), \nfor example, 2017-07-21T17:32:28Z\n"}],"description":"Time on which calls were started.\n"},"count":{"type":"integer","format":"int32","description":"The number of calls at this time.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Change system admin username

> Change system admin username.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/admin/username":{"post":{"tags":["Administration"],"operationId":"changeSystemAdminUsername","summary":"Change system admin username","description":"Change system admin username.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"The user's account name.   \nOnly letters, numbers, and the following special characters can be added: underscore, dash, single quote, and period (_, -, ', and .).   \nUsername cannot start or end with period (.).   \n`admin`, `system`, `administrator`, and `root` are reserved names for system admin only with case ignored.\n"}},"required":["name"]}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Reset system admin password

> Reset system admin password.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/admin/password":{"post":{"tags":["Administration"],"operationId":"resetSystemAdminPassword","summary":"Reset system admin password","description":"Reset system admin password.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"old_password":{"allOf":[{"type":"string","description":"The password of system admin.\n"}],"description":"The old password of system admin.\n"},"new_password":{"allOf":[{"type":"string","description":"The password of system admin.\n"}],"description":"The new password pf system admin.\n"}},"required":["old_password","new_password"]}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve system settings

> Retrieve settings for PortSIP PBX.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/admin/settings":{"get":{"tags":["Administration"],"operationId":"listOptions","summary":"Retrieve system settings","description":"Retrieve settings for PortSIP PBX.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"user_agent":{"type":"string","minLength":1,"maxLength":1024,"default":"PortSIP UC","description":"User agent.\n"},"blocked_user_agents":{"type":"string","description":"The semicolon separated list of blocked user agents.\n"},"enable_shared_address_space_address_range":{"type":"boolean","default":true,"description":"Enable Shared Address Space Address Range or not (RFC 6598).\n"},"enable_digest_auth":{"type":"boolean","default":true,"description":"Indicates if DIGEST authentication would be enabled.\n"},"enable_auth_mid_dialog":{"type":"boolean","default":false,"description":"Indicates if PortSIP PBX requires authentication against all subsequent\nrequests originated from one calling.\n"},"enable_digest_auth_int":{"type":"boolean","default":false,"description":"Indicates if auth-int DIGEST authentication mode would be enabled.\n"},"enable_external_recording":{"type":"boolean","default":true,"description":"Allow external calls recording.\n"},"enable_reject_bad_nonce":{"type":"boolean","default":false,"description":"When a client sends a bad nonce in their credentials,\nreturn 403 message if this parameter is true, or send a new  challenge if this parameter is false.\n"},"statistics_log_interval":{"type":"integer","format":"int32","minimum":0,"default":600,"description":"Interval for statistics logs, in seconds.\n"},"dead_session_timeout":{"type":"integer","format":"int32","minimum":0,"default":600,"description":"Close the session if no RTP packets received within specified duration, in seconds.\n"},"enable_session_timer":{"type":"boolean","default":true,"description":"Indicates if session timer (RFC 4028) would be enabled. \nThis also requires client support.\n"},"session_timer_duration":{"type":"integer","format":"int32","minimum":90,"maximum":3600,"default":3600,"description":"Duration recorded by Session timer.\nPrecondition: \"enable_session_timer\" MUST be set to true.\n"},"enable_to_tag_in_register":{"type":"boolean","default":false,"description":"Indicates if \"to\" tag is allowed in REGISTER message.\n"},"enable_congestion_management":{"type":"boolean","default":true,"description":"Indicates if congestion management would be enabled.\n"},"congestion_management_metric":{"type":"string","enum":["WAIT_TIME","TIME_DEPTH","SIZE"],"description":"Precondition: \"enable_congestion_management\" parameter MUST be set to true.\nThe recommended is WAIT_TIME based on the expected wait time for each FIFO.\n- `WAIT_TIME`:\n- `TIME_DEPTH`:\n- `SIZE`:\n"},"congestion_management_tolerance":{"type":"integer","format":"int32","minimum":0,"default":600,"description":"Precondition: \"enable_congestion_management\" parameter MUST be set to true.\nCongestion management tolerance for the given metric.\nThis parameter determines when the Rejection Behavior changes.\n"},"enable_create_non_exist_extension":{"type":"boolean","default":false,"description":"Indicates if the extension would be automatically created when a non-existent extension try to register.\nIf it is set to true, when a non-included extension tries to send\nregistry message to PBX, the PBX will create the extension with\ndefault password \"portsip\" automatically.\n"},"enable_prack":{"type":"boolean","default":false,"description":"Enable prack or not.\n"},"enable_tenant_level_trunk":{"type":"boolean","default":true,"description":"Whether to enable tenant-level trunk.\n"},"enable_diversion_support":{"type":"boolean","default":false,"description":"Enable Diversion support or not (RFC 5806).\n"},"enable_history_info_support":{"type":"boolean","default":false,"description":"Enable History-Info support (RFC 7044).\n"},"enable_outbound_support":{"type":"boolean","default":true,"description":"Enable Outbound Support or not (RFC 5626).\n"},"flow_timer":{"type":"integer","format":"int32","minimum":0,"default":0,"description":"The flow timer interval in seconds.\n"},"register_expiration_time":{"type":"integer","minimum":90,"maximum":3600,"default":300,"description":"The register expiration time in seconds.\n"},"enable_auto_answer_alert_info_header":{"type":"boolean","default":false,"description":"Enable call-info header for auto answer or not.\n"},"auto_answer_alert_info_header":{"type":"string","enum":["INTERCOM","ALERT_AUTO_ANSWER","AUTO_ANSWER"],"description":"Alert-info header to be added in INVITE message when PBX is forwarding the page/intercom.\nValues includes:\n- `INTERCOM`: info=intercom.\n- `ALERT_AUTO_ANSWER`: Alert-Info:;info=alert-autoanswer;delay=0.\n- `AUTO_ANSWER`: info=Auto Answer.\n"},"enable_auto_answer_call_info_header":{"type":"boolean","default":true,"description":"Enable call-info header for auto answer.\nThe value is \"sip:portsip.com;answer-after=0\".\n"},"enable_require_answer_mode":{"type":"boolean","default":false,"description":"Enable Require Answer Mode (RFC 5373) for auto answer.\n"},"enable_www_auth":{"type":"boolean","default":false,"description":"Enable WWW authentication or not.\n"},"user_equal_required_for_auth_name":{"type":"boolean","default":true,"description":"User equal required for authentication name.\n"},"trace_server_host":{"type":"string","description":"Tracer server host.\n"},"trace_server_port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"description":"The tracer server port.\n"},"web_failed_auth_amount":{"type":"integer","format":"int32","minimum":0,"default":5,"description":"Block if failed to login PortSIP PBX Web more than this times.\n"},"web_blacklist_time_interval":{"type":"integer","format":"int32","minimum":0,"default":3600,"description":"The web blocked time in seconds.\n"},"sip_failed_auth_amount":{"type":"integer","format":"int32","minimum":0,"default":50,"description":"The number of authentication failures.\n"},"sip_failed_challenge_requests_amount":{"type":"integer","format":"int32","minimum":0,"default":1000,"description":"DOS attacks can send REGISTER/INVITE requests but do not reply to Challenge (407).\nConfigure the amount of \"fake\" requests that PortSIP PBX will accept per IP Address.\nIf this value is exceeded in \"Detection Period\" interval the source IP address is put in the Blacklist.\nIP will remain blacklisted till \"SIP Blacklist time interval\" expires.\n"},"sip_blacklist_time_interval":{"type":"integer","format":"int32","minimum":0,"default":3600,"description":"The sip blocked time in seconds.\n"},"sip_detection_period":{"type":"integer","format":"int32","minimum":0,"default":10,"description":"The detection period in seconds.\n"},"sip_barrier_1_packets":{"type":"integer","format":"int32","minimum":0,"default":5000,"description":"If the amount of packets is exceeded, the PBX will block the source IP for \"Level 1 blacklist time interval\" seconds.\n"},"sip_barrier_1_blocking_time":{"type":"integer","format":"int32","minimum":0,"default":3600,"description":"This is the time interval in seconds that an abusive IP Address remains in the blacklist\n"},"sip_barrier_2_packets":{"type":"integer","format":"int32","minimum":0,"default":2000,"description":"If the amount of packets is exceeded, the PBX will block the source IP for \"Level 2 blacklist time interval\" seconds.\n"},"sip_barrier_2_blocking_time":{"type":"integer","format":"int32","minimum":0,"default":30,"description":"This is the time interval in seconds that an abusive IP Address remains in the blacklist\n"},"stir_shaken_cert":{"type":"string","description":"Content of this certificate file for STIR/SHAKEN support.\n"},"stir_shaken_key":{"type":"string","description":"Content of this private certificate file for STIR/SHAKEN support.\n"},"custom_options":{"type":"string","description":"Some custom configuration options serialized as json string.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update system settings

> Update settings for PortSIP PBX<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/admin/settings":{"post":{"tags":["Administration"],"operationId":"updateOptions","summary":"Update system settings","description":"Update settings for PortSIP PBX\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"user_agent":{"type":"string","minLength":1,"maxLength":1024,"default":"PortSIP UC","description":"User agent.\n"},"blocked_user_agents":{"type":"string","description":"The semicolon separated list of blocked user agents.\n"},"enable_shared_address_space_address_range":{"type":"boolean","default":true,"description":"Enable Shared Address Space Address Range or not (RFC 6598).\n"},"enable_digest_auth":{"type":"boolean","default":true,"description":"Indicates if DIGEST authentication would be enabled.\n"},"enable_auth_mid_dialog":{"type":"boolean","default":false,"description":"Indicates if PortSIP PBX requires authentication against all subsequent\nrequests originated from one calling.\n"},"enable_digest_auth_int":{"type":"boolean","default":false,"description":"Indicates if auth-int DIGEST authentication mode would be enabled.\n"},"enable_external_recording":{"type":"boolean","default":true,"description":"Allow external calls recording.\n"},"enable_reject_bad_nonce":{"type":"boolean","default":false,"description":"When a client sends a bad nonce in their credentials,\nreturn 403 message if this parameter is true, or send a new  challenge if this parameter is false.\n"},"statistics_log_interval":{"type":"integer","format":"int32","minimum":0,"default":600,"description":"Interval for statistics logs, in seconds.\n"},"dead_session_timeout":{"type":"integer","format":"int32","minimum":0,"default":600,"description":"Close the session if no RTP packets received within specified duration, in seconds.\n"},"enable_session_timer":{"type":"boolean","default":true,"description":"Indicates if session timer (RFC 4028) would be enabled. \nThis also requires client support.\n"},"session_timer_duration":{"type":"integer","format":"int32","minimum":90,"maximum":3600,"default":3600,"description":"Duration recorded by Session timer.\nPrecondition: \"enable_session_timer\" MUST be set to true.\n"},"enable_to_tag_in_register":{"type":"boolean","default":false,"description":"Indicates if \"to\" tag is allowed in REGISTER message.\n"},"enable_congestion_management":{"type":"boolean","default":true,"description":"Indicates if congestion management would be enabled.\n"},"congestion_management_metric":{"type":"string","enum":["WAIT_TIME","TIME_DEPTH","SIZE"],"description":"Precondition: \"enable_congestion_management\" parameter MUST be set to true.\nThe recommended is WAIT_TIME based on the expected wait time for each FIFO.\n- `WAIT_TIME`:\n- `TIME_DEPTH`:\n- `SIZE`:\n"},"congestion_management_tolerance":{"type":"integer","format":"int32","minimum":0,"default":600,"description":"Precondition: \"enable_congestion_management\" parameter MUST be set to true.\nCongestion management tolerance for the given metric.\nThis parameter determines when the Rejection Behavior changes.\n"},"enable_create_non_exist_extension":{"type":"boolean","default":false,"description":"Indicates if the extension would be automatically created when a non-existent extension try to register.\nIf it is set to true, when a non-included extension tries to send\nregistry message to PBX, the PBX will create the extension with\ndefault password \"portsip\" automatically.\n"},"enable_prack":{"type":"boolean","default":false,"description":"Enable prack or not.\n"},"enable_tenant_level_trunk":{"type":"boolean","default":true,"description":"Whether to enable tenant-level trunk.\n"},"enable_diversion_support":{"type":"boolean","default":false,"description":"Enable Diversion support or not (RFC 5806).\n"},"enable_history_info_support":{"type":"boolean","default":false,"description":"Enable History-Info support (RFC 7044).\n"},"enable_outbound_support":{"type":"boolean","default":true,"description":"Enable Outbound Support or not (RFC 5626).\n"},"flow_timer":{"type":"integer","format":"int32","minimum":0,"default":0,"description":"The flow timer interval in seconds.\n"},"register_expiration_time":{"type":"integer","minimum":90,"maximum":3600,"default":300,"description":"The register expiration time in seconds.\n"},"enable_auto_answer_alert_info_header":{"type":"boolean","default":false,"description":"Enable call-info header for auto answer or not.\n"},"auto_answer_alert_info_header":{"type":"string","enum":["INTERCOM","ALERT_AUTO_ANSWER","AUTO_ANSWER"],"description":"Alert-info header to be added in INVITE message when PBX is forwarding the page/intercom.\nValues includes:\n- `INTERCOM`: info=intercom.\n- `ALERT_AUTO_ANSWER`: Alert-Info:;info=alert-autoanswer;delay=0.\n- `AUTO_ANSWER`: info=Auto Answer.\n"},"enable_auto_answer_call_info_header":{"type":"boolean","default":true,"description":"Enable call-info header for auto answer.\nThe value is \"sip:portsip.com;answer-after=0\".\n"},"enable_require_answer_mode":{"type":"boolean","default":false,"description":"Enable Require Answer Mode (RFC 5373) for auto answer.\n"},"enable_www_auth":{"type":"boolean","default":false,"description":"Enable WWW authentication or not.\n"},"user_equal_required_for_auth_name":{"type":"boolean","default":true,"description":"User equal required for authentication name.\n"},"trace_server_host":{"type":"string","description":"Tracer server host.\n"},"trace_server_port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"description":"The tracer server port.\n"},"web_failed_auth_amount":{"type":"integer","format":"int32","minimum":0,"default":5,"description":"Block if failed to login PortSIP PBX Web more than this times.\n"},"web_blacklist_time_interval":{"type":"integer","format":"int32","minimum":0,"default":3600,"description":"The web blocked time in seconds.\n"},"sip_failed_auth_amount":{"type":"integer","format":"int32","minimum":0,"default":50,"description":"The number of authentication failures.\n"},"sip_failed_challenge_requests_amount":{"type":"integer","format":"int32","minimum":0,"default":1000,"description":"DOS attacks can send REGISTER/INVITE requests but do not reply to Challenge (407).\nConfigure the amount of \"fake\" requests that PortSIP PBX will accept per IP Address.\nIf this value is exceeded in \"Detection Period\" interval the source IP address is put in the Blacklist.\nIP will remain blacklisted till \"SIP Blacklist time interval\" expires.\n"},"sip_blacklist_time_interval":{"type":"integer","format":"int32","minimum":0,"default":3600,"description":"The sip blocked time in seconds.\n"},"sip_detection_period":{"type":"integer","format":"int32","minimum":0,"default":10,"description":"The detection period in seconds.\n"},"sip_barrier_1_packets":{"type":"integer","format":"int32","minimum":0,"default":5000,"description":"If the amount of packets is exceeded, the PBX will block the source IP for \"Level 1 blacklist time interval\" seconds.\n"},"sip_barrier_1_blocking_time":{"type":"integer","format":"int32","minimum":0,"default":3600,"description":"This is the time interval in seconds that an abusive IP Address remains in the blacklist\n"},"sip_barrier_2_packets":{"type":"integer","format":"int32","minimum":0,"default":2000,"description":"If the amount of packets is exceeded, the PBX will block the source IP for \"Level 2 blacklist time interval\" seconds.\n"},"sip_barrier_2_blocking_time":{"type":"integer","format":"int32","minimum":0,"default":30,"description":"This is the time interval in seconds that an abusive IP Address remains in the blacklist\n"},"stir_shaken_cert":{"type":"string","description":"Content of this certificate file for STIR/SHAKEN support.\n"},"stir_shaken_key":{"type":"string","description":"Content of this private certificate file for STIR/SHAKEN support.\n"},"custom_options":{"type":"string","description":"Some custom configuration options serialized as json string.\n"}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve system notification settings

> Retrieve details of system notification settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/admin/notification":{"get":{"tags":["Administration"],"operationId":"getSystemNotificationSettings","summary":"Retrieve system notification settings","description":"Retrieve details of system notification settings.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["SMTP","MS365","GMAIL"],"description":"The email server type.   \nCan be either:   \n- `SMTP`: Use generic SMTP server.\n- `MS365` Use Microsoft 365 email service.\n- `GMAIL` Use Google Gmail service.\n"},"server":{"type":"string","description":"SMTP server used for sending mails.\n"},"port":{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"},"reply_to":{"type":"string","description":"A Reply-To address is identified by inserting the Reply-To header in your email.  \nIt is the email address that the reply message is sent \nwhen you want the reply to go to an email address that is different than the From: address.\n"},"username":{"type":"string","maxLength":128,"description":"Username or email address.\n"},"auth":{"type":"string","enum":["DISABLE","AUTO","LOGIN","PLAIN"],"default":"AUTO","description":"The authentication protocols.   \nCan be either:   \n- `DISABLE`: Skip authentication mechanism.\n- `AUTO`: Use auto-selected authentication algorithms by server (Currently only supports LOGIN and PLAIN).\n- `LOGIN`: Use LOGIN authentication mechanism.\n- `PLAIN` Use PLAIN authentication mechanism.\n"},"enable_tls_ssl":{"type":"boolean","default":true,"description":"Whether to enable TLS/SSL.\n"},"enable_starttls_auto":{"type":"boolean","default":false,"description":"Whether StartTLS is automatically enabled.\n"},"recipients":{"type":"string","description":"Comma-separated list of email address that should receive notifications.   \nAllow up to 15 email addresses.\n"},"enable_tenant_access":{"type":"boolean","default":true,"description":"Apply the email server settings to all tenants.\n"},"hard_disk_threshold":{"type":"number","format":"double","description":"The hard disk threshold for email warning.\n"},"notify_hard_disk_exceeded_threshold":{"type":"boolean","default":false,"description":"Send a notification email when specified hard disk threshold is exceeded.\n"},"cpu_threshold":{"type":"number","format":"double","description":"The CPU threshold for email warning.\n"},"notify_cpu_exceeded_threshold":{"type":"boolean","default":false,"description":"Send a notification email when specified CPU threshold is exceeded.\n"},"memory_threshold":{"type":"number","format":"double","description":"The memory threshold for email warning.\n"},"notify_memory_exceeded_threshold":{"type":"boolean","default":false,"description":"Send an email notification when specified memory threshold is exceeded.\n"},"notify_ip_blocked":{"type":"boolean","default":false,"description":"Send a notification email when ip blocked.\n"},"notify_license_limited":{"type":"boolean","default":false,"description":"Send a notification email when license limit reached.\n"},"notify_service_disconnected":{"type":"boolean","default":false,"description":"Send a notification email when some service disconnected.\n"},"notify_push_certs_update_failed":{"type":"boolean","default":false,"description":"Send a notification email when push notification certificates update failed.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update system notification settings

> Update system notification settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/admin/notification":{"post":{"tags":["Administration"],"operationId":"updateSystemNotificationSettings","summary":"Update system notification settings","description":"Update system notification settings.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["SMTP","MS365","GMAIL"],"description":"The email server type.   \nCan be either:   \n- `SMTP`: Use generic SMTP server.\n- `MS365` Use Microsoft 365 email service.\n- `GMAIL` Use Google Gmail service.\n"},"server":{"type":"string","description":"SMTP server used for sending mails.\n"},"port":{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"},"reply_to":{"type":"string","description":"A Reply-To address is identified by inserting the Reply-To header in your email.  \nIt is the email address that the reply message is sent \nwhen you want the reply to go to an email address that is different than the From: address.\n"},"username":{"type":"string","maxLength":128,"description":"Username or email address.\n"},"password":{"type":"string","description":"Password for email account.\n"},"auth":{"type":"string","enum":["DISABLE","AUTO","LOGIN","PLAIN"],"default":"AUTO","description":"The authentication protocols.   \nCan be either:   \n- `DISABLE`: Skip authentication mechanism.\n- `AUTO`: Use auto-selected authentication algorithms by server (Currently only supports LOGIN and PLAIN).\n- `LOGIN`: Use LOGIN authentication mechanism.\n- `PLAIN` Use PLAIN authentication mechanism.\n"},"enable_tls_ssl":{"type":"boolean","default":true,"description":"Whether to enable TLS/SSL.\n"},"enable_starttls_auto":{"type":"boolean","default":false,"description":"Whether StartTLS is automatically enabled.\n"},"recipients":{"type":"string","description":"Comma-separated list of email address that should receive notifications.   \nAllow up to 15 email addresses.\n"},"enable_tenant_access":{"type":"boolean","default":true,"description":"Apply the email server settings to all tenants.\n"},"hard_disk_threshold":{"type":"number","format":"double","description":"The hard disk threshold for email warning.\n"},"notify_hard_disk_exceeded_threshold":{"type":"boolean","default":false,"description":"Send a notification email when specified hard disk threshold is exceeded.\n"},"cpu_threshold":{"type":"number","format":"double","description":"The CPU threshold for email warning.\n"},"notify_cpu_exceeded_threshold":{"type":"boolean","default":false,"description":"Send a notification email when specified CPU threshold is exceeded.\n"},"memory_threshold":{"type":"number","format":"double","description":"The memory threshold for email warning.\n"},"notify_memory_exceeded_threshold":{"type":"boolean","default":false,"description":"Send an email notification when specified memory threshold is exceeded.\n"},"notify_ip_blocked":{"type":"boolean","default":false,"description":"Send a notification email when ip blocked.\n"},"notify_license_limited":{"type":"boolean","default":false,"description":"Send a notification email when license limit reached.\n"},"notify_service_disconnected":{"type":"boolean","default":false,"description":"Send a notification email when some service disconnected.\n"},"notify_push_certs_update_failed":{"type":"boolean","default":false,"description":"Send a notification email when push notification certificates update failed.\n"}},"required":["type","username"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Test email

> Check email server configurations by sending testing email.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/admin/notification/test_email":{"post":{"tags":["Administration"],"operationId":"sendGlobalNotificationTestEmail","summary":"Test email","description":"Check email server configurations by sending testing email.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"recipient":{"type":"string","description":"The recipient's e-mail address.\n"},"subject":{"type":"string","description":"Mail subject.\n"},"content":{"type":"string","description":"Mail content.\n"}},"required":["recipient","subject","content"]}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve SBC configuration

> Retrieve settings for SBC.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/sbc":{"get":{"tags":["Administration"],"operationId":"getSBCConfiguration","summary":"Retrieve SBC configuration","description":"Retrieve settings for SBC.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"The SBC domain.\n"},"http_port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"default":8882,"description":"The SBC web port for http.\n"},"https_port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"default":8883,"description":"The SBC web port fot https.\n"},"transports":{"type":"array","items":{"type":"object","properties":{"protocol":{"type":"string","enum":["UDP","TCP","TLS"],"description":"The transport protocol:  \nCan be either:  \n- `UDP`:\n- `TCP`:\n- `TLS`:\n"},"port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"description":"The port of transport.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update SBC configuration

> Update SBC configuration.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/sbc":{"post":{"tags":["Administration"],"operationId":"updateSBCConfiguration","summary":"Update SBC configuration","description":"Update SBC configuration.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"The SBC domain.\n"},"http_port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"default":8882,"description":"The SBC web port for http.\n"},"https_port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"default":8883,"description":"The SBC web port fot https.\n"},"transports":{"type":"array","items":{"type":"object","properties":{"protocol":{"type":"string","enum":["UDP","TCP","TLS"],"description":"The transport protocol:  \nCan be either:  \n- `UDP`:\n- `TCP`:\n- `TLS`:\n"},"port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"description":"The port of transport.\n"}}}}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve SBC token

> Retrieve SBC token<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/sbc/token":{"get":{"tags":["Administration"],"operationId":"getSBCToken","summary":"Retrieve SBC token","description":"Retrieve SBC token\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The access token for SBC.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Regenerate SBC token

> Regenerate SBC token<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/sbc/token":{"post":{"tags":["Administration"],"operationId":"regenerateSBCToken","summary":"Regenerate SBC token","description":"Regenerate SBC token\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The access token for SBC.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Destroy SBC Token

> Destroy SBC Token.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/sbc/token/destroy":{"post":{"tags":["Administration"],"operationId":"destroySBCToken","summary":"Destroy SBC Token","description":"Destroy SBC Token.\n","responses":{"204":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve IM server configuration

> Retrieve settings of IM server.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/im":{"get":{"tags":["Administration"],"operationId":"getIMServerConfiguration","summary":"Retrieve IM server configuration","description":"Retrieve settings of IM server.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"private_ipv4":{"type":"string","description":"Host IPV4 address.\n"},"private_ipv6":{"type":"string","description":"Host IPV6 address.\n"},"public_ipv4":{"type":"string","description":"Host IPV4 address.\n"},"public_ipv6":{"type":"string","description":"Host IPV6 address.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update IM server configuration

> Update IM server configuration.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/im":{"post":{"tags":["Administration"],"operationId":"updateIMServerConfiguration","summary":"Update IM server configuration","description":"Update IM server configuration.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"private_ipv4":{"type":"string","description":"Host IPV4 address.\n"},"private_ipv6":{"type":"string","description":"Host IPV6 address.\n"},"public_ipv4":{"type":"string","description":"Host IPV4 address.\n"},"public_ipv6":{"type":"string","description":"Host IPV6 address.\n"}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve IM Server token

> Retrieve IM server token<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/im/token":{"get":{"tags":["Administration"],"operationId":"getIMServerToken","summary":"Retrieve IM Server token","description":"Retrieve IM server token\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The access token for IM Server.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Regenerate IM server token

> Regenerate IM server token<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/im/token":{"post":{"tags":["Administration"],"operationId":"regenerateIMServerToken","summary":"Regenerate IM server token","description":"Regenerate IM server token\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The access token for IM Server.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Destroy IM server Token

> Destroy IM server Token.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/im/token/destroy":{"post":{"tags":["Administration"],"operationId":"destroyIMServerToken","summary":"Destroy IM server Token","description":"Destroy IM server Token.\n","responses":{"204":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```

## List dealers

> List a collection of dealers.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dealers":{"get":{"tags":["Administration"],"operationId":"listDealers","summary":"List dealers","description":"List a collection of dealers.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64","minimum":0,"description":"Total number of resource.\n"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of dealer.\n"},"enabled":{"type":"boolean","default":true,"description":"Enable this dealer or not.\n"},"level":{"type":"string","enum":["DISTRIBUTOR","SUB_DISTRIBUTOR","RESELLER"],"description":"Dealer level includes:\n- `DISTRIBUTOR`: the first level of dealers.\n- `SUB_DISTRIBUTOR`: the second level of dealers.\n- `RESELLER`: the third level of dealers.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The user's account name.   \nOnly letters, numbers, and the following special characters can be added: underscore, dash, single quote, and period (_, -, ', and .).   \nUsername cannot start or end with period (.).   \n`admin`, `system`, `administrator`, and `root` are reserved names for system admin only with case ignored.\n"},"email":{"allOf":[{"type":"string","maxLength":128,"description":"The email address.\n"}],"description":"The email address of user.\n"},"display_name":{"type":"string","maxLength":1024,"description":"The display name of user.\n"},"website":{"type":"string","description":"The website of user.\n"},"phone":{"type":"string","maxLength":32,"description":"The mobile phone number of user.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"description":{"type":"string","description":"The description of dealer.\n"},"max_tenants":{"type":"integer","format":"int32","minimum":0,"default":100,"description":"The maximum number of tenants that the dealer is allowed to create.\n"},"max_extensions":{"type":"integer","format":"int32","minimum":0,"default":50000,"description":"The maximum number of extensions that the dealer is allowed to create.\n"},"tenant_full_access":{"type":"boolean","default":true,"description":"Whether or not the reseller is allowed to have full control over the tenant.   \nThis attribute is not valid if not modified by first level dealer.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Create a dealer

> Create a dealer.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dealers":{"post":{"tags":["Administration"],"operationId":"createDealer","summary":"Create a dealer","description":"Create a dealer.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","default":true,"description":"Enable this dealer or not.\n"},"level":{"type":"string","enum":["DISTRIBUTOR","SUB_DISTRIBUTOR","RESELLER"],"description":"Dealer level includes:\n- `DISTRIBUTOR`: the first level of dealers.\n- `SUB_DISTRIBUTOR`: the second level of dealers.\n- `RESELLER`: the third level of dealers.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The user's account name.   \nOnly letters, numbers, and the following special characters can be added: underscore, dash, single quote, and period (_, -, ', and .).   \nUsername cannot start or end with period (.).   \n`admin`, `system`, `administrator`, and `root` are reserved names for system admin only with case ignored.\n"},"password":{"type":"string","description":"The password of dealer.\n"},"email":{"allOf":[{"type":"string","maxLength":128,"description":"The email address.\n"}],"description":"The email address of user.\n"},"display_name":{"type":"string","maxLength":1024,"description":"The display name of user.\n"},"website":{"type":"string","description":"The website of user.\n"},"phone":{"type":"string","maxLength":32,"description":"The mobile phone number of user.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"description":{"type":"string","description":"The description of dealer.\n"},"max_tenants":{"type":"integer","format":"int32","minimum":0,"default":100,"description":"The maximum number of tenants that the dealer is allowed to create.\n"},"max_extensions":{"type":"integer","format":"int32","minimum":0,"default":50000,"description":"The maximum number of extensions that the dealer is allowed to create.\n"},"tenant_full_access":{"type":"boolean","default":true,"description":"Whether or not the reseller is allowed to have full control over the tenant.   \nThis attribute is not valid if not modified by first level dealer.\n"}},"required":["name","level","password","max_tenants","max_extensions"]}}},"required":true},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of dealer.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Retrieve a dealer

> Get details of the dealer by it's unique ID.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dealers/{id}":{"get":{"tags":["Administration"],"operationId":"retrieveDealer","summary":"Retrieve a dealer","description":"Get details of the dealer by it's unique ID.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of dealer.\n"},"description":"The unique ID of the dealer."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of dealer.\n"},"enabled":{"type":"boolean","default":true,"description":"Enable this dealer or not.\n"},"level":{"type":"string","enum":["DISTRIBUTOR","SUB_DISTRIBUTOR","RESELLER"],"description":"Dealer level includes:\n- `DISTRIBUTOR`: the first level of dealers.\n- `SUB_DISTRIBUTOR`: the second level of dealers.\n- `RESELLER`: the third level of dealers.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The user's account name.   \nOnly letters, numbers, and the following special characters can be added: underscore, dash, single quote, and period (_, -, ', and .).   \nUsername cannot start or end with period (.).   \n`admin`, `system`, `administrator`, and `root` are reserved names for system admin only with case ignored.\n"},"email":{"allOf":[{"type":"string","maxLength":128,"description":"The email address.\n"}],"description":"The email address of user.\n"},"display_name":{"type":"string","maxLength":1024,"description":"The display name of user.\n"},"website":{"type":"string","description":"The website of user.\n"},"phone":{"type":"string","maxLength":32,"description":"The mobile phone number of user.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"description":{"type":"string","description":"The description of dealer.\n"},"max_tenants":{"type":"integer","format":"int32","minimum":0,"default":100,"description":"The maximum number of tenants that the dealer is allowed to create.\n"},"max_extensions":{"type":"integer","format":"int32","minimum":0,"default":50000,"description":"The maximum number of extensions that the dealer is allowed to create.\n"},"tenant_full_access":{"type":"boolean","default":true,"description":"Whether or not the reseller is allowed to have full control over the tenant.   \nThis attribute is not valid if not modified by first level dealer.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update a dealer

> Modify the settings of the dealer.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dealers/{id}":{"post":{"tags":["Administration"],"operationId":"updateDealer","summary":"Update a dealer","description":"Modify the settings of the dealer.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of dealer.\n"},"description":"The unique ID of the dealer."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","default":true,"description":"Enable this dealer or not.\n"},"email":{"allOf":[{"type":"string","maxLength":128,"description":"The email address.\n"}],"description":"The email address of user.\n"},"display_name":{"type":"string","maxLength":1024,"description":"The display name of user.\n"},"website":{"type":"string","description":"The website of user.\n"},"phone":{"type":"string","maxLength":32,"description":"The mobile phone number of user.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"description":{"type":"string","description":"The description of dealer.\n"},"max_tenants":{"type":"integer","format":"int32","minimum":0,"default":100,"description":"The maximum number of tenants that the dealer is allowed to create.\n"},"max_extensions":{"type":"integer","format":"int32","minimum":0,"default":50000,"description":"The maximum number of extensions that the dealer is allowed to create.\n"},"tenant_full_access":{"type":"boolean","default":true,"description":"Whether or not the reseller is allowed to have full control over the tenant.   \nThis attribute is not valid if not modified by first level dealer.\n"}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Reset dealer password

> Reset dealer's password.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dealers/{id}/password":{"post":{"tags":["Administration"],"operationId":"resetDealerPassword","summary":"Reset dealer password","description":"Reset dealer's password.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of dealer.\n"},"description":"The unique ID of the dealer."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"The password of dealer.\n"}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Delete a dealer

> Delete a dealer by it's unique ID.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dealers/{id}/destroy":{"post":{"tags":["Administration"],"operationId":"deleteDealer","summary":"Delete a dealer","description":"Delete a dealer by it's unique ID.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of dealer.\n"},"description":"The unique ID of the dealer."}],"responses":{"204":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```

## List IP rules

> Retrieve a collection of IP blacklist entries or whitelist entries.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/ip_filters":{"get":{"tags":["Administration"],"operationId":"listIpRules","summary":"List IP rules","description":"Retrieve a collection of IP blacklist entries or whitelist entries.\n","parameters":[{"name":"filter","in":"query","schema":{"type":"string"},"description":"Use the `filter` query parameter to retrieve just a subset of a collection.\n"},{"name":"search","in":"query","schema":{"type":"string"},"description":"Use the `search` query parameter to restrict the results of a request to match a search criterion.\n"},{"name":"orderby","in":"query","schema":{"type":"string"},"description":"Use the `orderby` query parameter to specify the sort order of the items returned from server.  \nThe default order is ascending order.\n"},{"name":"skip","in":"query","schema":{"type":"integer","format":"int32","minimum":0,"default":0},"description":"Use the `skip` query parameter to set the number of items to skip at the start of a collection.\n"},{"name":"top","in":"query","schema":{"type":"integer","format":"int32","minimum":1,"maximum":100,"default":100},"description":"Use the `top` query parameter to specify the page size of the result set.\n"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64","minimum":0,"description":"Total number of resource.\n"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of IP rule.\n"},"cidr":{"type":"string","description":"The `CIDR` notation IP address and prefix length,\nlike \"192.0.2.0/24\" or \"2001:db8::/32\", as defined in RFC 4632 and RFC 4291.\n"},"target":{"type":"string","enum":["ACCEPT","DENY"],"description":"IP rule's target:\n- `ACCEPT`: An accepted rule.\n- `DENY`: A rejection rule.\n"},"expire_at":{"allOf":[{"type":"string","format":"date_time","description":"The RFC 3339 format is defined by\nThe date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), \nfor example, 2017-07-21T17:32:28Z\n"}],"description":"IP rule's expire time.\n"},"description":{"type":"string","maxLength":255,"description":"Remarks for the IP rule.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Create an IP rule

> Add a new IP blacklist entry or whitelist entry to the system.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/ip_filters":{"post":{"tags":["Administration"],"operationId":"createIpRule","summary":"Create an IP rule","description":"Add a new IP blacklist entry or whitelist entry to the system.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"cidr":{"type":"string","description":"The `CIDR` notation IP address and prefix length,\nlike \"192.0.2.0/24\" or \"2001:db8::/32\", as defined in RFC 4632 and RFC 4291.\n"},"target":{"type":"string","enum":["ACCEPT","DENY"],"description":"IP rule's target:\n- `ACCEPT`: An accepted rule.\n- `DENY`: A rejection rule.\n"},"expire_at":{"allOf":[{"type":"string","format":"date_time","description":"The RFC 3339 format is defined by\nThe date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), \nfor example, 2017-07-21T17:32:28Z\n"}],"description":"IP rule's expire time.\n"},"description":{"type":"string","maxLength":255,"description":"Remarks for the IP rule.\n"}},"required":["cidr","target"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of IP rule.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Retrieve an IP rule

> Retrieve IP blacklist entry or whitelist entry.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/ip_filters/{id}":{"get":{"tags":["Administration"],"operationId":"showIpRule","summary":"Retrieve an IP rule","description":"Retrieve IP blacklist entry or whitelist entry.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of IP rule.\n"},"description":"The unique ID of the rule."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of IP rule.\n"},"cidr":{"type":"string","description":"The `CIDR` notation IP address and prefix length,\nlike \"192.0.2.0/24\" or \"2001:db8::/32\", as defined in RFC 4632 and RFC 4291.\n"},"target":{"type":"string","enum":["ACCEPT","DENY"],"description":"IP rule's target:\n- `ACCEPT`: An accepted rule.\n- `DENY`: A rejection rule.\n"},"expire_at":{"allOf":[{"type":"string","format":"date_time","description":"The RFC 3339 format is defined by\nThe date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), \nfor example, 2017-07-21T17:32:28Z\n"}],"description":"IP rule's expire time.\n"},"description":{"type":"string","maxLength":255,"description":"Remarks for the IP rule.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update an IP rule

> Update IP blacklist entry or whitelist entry that already exists.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/ip_filters/{id}":{"post":{"tags":["Administration"],"operationId":"updateIpRule","summary":"Update an IP rule","description":"Update IP blacklist entry or whitelist entry that already exists.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of IP rule.\n"},"description":"The unique ID of the rule."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"cidr":{"type":"string","description":"The `CIDR` notation IP address and prefix length,\nlike \"192.0.2.0/24\" or \"2001:db8::/32\", as defined in RFC 4632 and RFC 4291.\n"},"target":{"type":"string","enum":["ACCEPT","DENY"],"description":"IP rule's target:\n- `ACCEPT`: An accepted rule.\n- `DENY`: A rejection rule.\n"},"expire_at":{"allOf":[{"type":"string","format":"date_time","description":"The RFC 3339 format is defined by\nThe date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), \nfor example, 2017-07-21T17:32:28Z\n"}],"description":"IP rule's expire time.\n"},"description":{"type":"string","maxLength":255,"description":"Remarks for the IP rule.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Delete an IP rule

> Destroy a certain IP rule.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/ip_filters/{id}/destroy":{"post":{"tags":["Administration"],"operationId":"deleteIpRule","summary":"Delete an IP rule","description":"Destroy a certain IP rule.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of IP rule.\n"},"description":"The unique ID of the rule."}],"responses":{"204":{"description":"No Content"},"400":{"description":"Invalid rule ID supplied."}}}}}}
```

## Export IP rules

> Export a collection of IP rules to file.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/ip_filters/export":{"get":{"tags":["Administration"],"operationId":"exportIpRules","summary":"Export IP rules","description":"Export a collection of IP rules to file.\n","responses":{"200":{"description":"OK","headers":{"Content-Disposition":{"schema":{"type":"string"},"description":"the format is `attachment; filename=\"example\"`"}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"4XX":{"description":"Error"}}}}}}
```

## List transports

> Retrieve a collection of transports<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/transports":{"get":{"tags":["Administration"],"operationId":"listTransports","summary":"List transports","description":"Retrieve a collection of transports\n","parameters":[{"name":"filter","in":"query","schema":{"type":"string"},"description":"Use the `filter` query parameter to retrieve just a subset of a collection.\n"},{"name":"search","in":"query","schema":{"type":"string"},"description":"Use the `search` query parameter to restrict the results of a request to match a search criterion.\n"},{"name":"orderby","in":"query","schema":{"type":"string"},"description":"Use the `orderby` query parameter to specify the sort order of the items returned from server.  \nThe default order is ascending order.\n"},{"name":"skip","in":"query","schema":{"type":"integer","format":"int32","minimum":0,"default":0},"description":"Use the `skip` query parameter to set the number of items to skip at the start of a collection.\n"},{"name":"top","in":"query","schema":{"type":"integer","format":"int32","minimum":1,"maximum":100,"default":100},"description":"Use the `top` query parameter to specify the page size of the result set.\n"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64","minimum":0,"description":"Total number of resource.\n"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of transport.\n"},"protocol":{"type":"string","enum":["UDP","TCP","TLS"],"description":"The transport protocol:  \nCan be either:  \n- `UDP`:\n- `TCP`:\n- `TLS`:\n"},"port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"description":"The port of transport.\n"},"verification":{"type":"string","enum":["DISABLE","OPTIONAL","MANDATORY"],"description":"Indicates if PBX wishes (Optional) or requires (Mandatory) TLS clients to present a client certificate:\n- `DISABLE`: disable client certificate.\n- `OPTIONAL`: client authentication optional.\n- `MANDATORY`: force client authentication.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Create a transport

> Add a new transport.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/transports":{"post":{"tags":["Administration"],"operationId":"createTransport","summary":"Create a transport","description":"Add a new transport.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"protocol":{"type":"string","enum":["UDP","TCP","TLS"],"description":"The transport protocol:  \nCan be either:  \n- `UDP`:\n- `TCP`:\n- `TLS`:\n"},"port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"description":"The port of transport.\n"},"verification":{"type":"string","enum":["DISABLE","OPTIONAL","MANDATORY"],"description":"Indicates if PBX wishes (Optional) or requires (Mandatory) TLS clients to present a client certificate:\n- `DISABLE`: disable client certificate.\n- `OPTIONAL`: client authentication optional.\n- `MANDATORY`: force client authentication.\n"}},"required":["protocol","port"]}}},"required":true},"responses":{"201":{"description":"Created transport","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of transport.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Retrieve a transport

> Retrieve a transport by it's unique ID.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/transports/{id}":{"get":{"tags":["Administration"],"operationId":"showTransport","summary":"Retrieve a transport","description":"Retrieve a transport by it's unique ID.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The unique ID of the resource.\n"},"description":"The unique ID of the transport."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of transport.\n"},"protocol":{"type":"string","enum":["UDP","TCP","TLS"],"description":"The transport protocol:  \nCan be either:  \n- `UDP`:\n- `TCP`:\n- `TLS`:\n"},"port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"description":"The port of transport.\n"},"verification":{"type":"string","enum":["DISABLE","OPTIONAL","MANDATORY"],"description":"Indicates if PBX wishes (Optional) or requires (Mandatory) TLS clients to present a client certificate:\n- `DISABLE`: disable client certificate.\n- `OPTIONAL`: client authentication optional.\n- `MANDATORY`: force client authentication.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update transport

> Update a new transport.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/transports/{id}":{"post":{"tags":["Administration"],"operationId":"updateTransport","summary":"Update transport","description":"Update a new transport.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of transport.\n"},"description":"The unique ID of the transport."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"port":{"allOf":[{"type":"integer","format":"int32","minimum":0,"maximum":65535,"description":"A port number is a 16-bit unsigned integer, thus ranging from 0 to 65535.\nFor TCP, port number 0 is reserved and cannot be used, while for UDP, the source port is optional and a value of zero means no port\n"}],"description":"The port of transport.\n"},"verification":{"type":"string","enum":["DISABLE","OPTIONAL","MANDATORY"],"description":"Indicates if PBX wishes (Optional) or requires (Mandatory) TLS clients to present a client certificate:\n- `DISABLE`: disable client certificate.\n- `OPTIONAL`: client authentication optional.\n- `MANDATORY`: force client authentication.\n"}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Destroy transport

> Destroy transport<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/transports/{id}/destroy":{"post":{"tags":["Administration"],"operationId":"deleteTransport","summary":"Destroy transport","description":"Destroy transport\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of transport.\n"},"description":"The unique ID of the transport."}],"responses":{"204":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```

## Query transport's status

> Query transport's status<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/transports/{id}/status":{"get":{"tags":["Administration"],"operationId":"getTransportStatus","summary":"Query transport's status","description":"Query transport's status\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","enum":["UDP","TCP","TLS"],"description":"The transport protocol:  \nCan be either:  \n- `UDP`:\n- `TCP`:\n- `TLS`:\n"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVATED","DEACTIVATED"],"readOnly":true,"description":"Status of transport includes:\n- `ACTIVATED`:\n- `DEACTIVATED`:\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## List tenants

> Returns a list of tenant summary information.\
> Note that it uses a different, smaller representation of a tenant than retrieving a single tenant.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/tenants":{"get":{"tags":["Administration"],"operationId":"listTenants","summary":"List tenants","description":"Returns a list of tenant summary information.\nNote that it uses a different, smaller representation of a tenant than retrieving a single tenant.\n","parameters":[{"name":"filter","in":"query","schema":{"type":"string"},"description":"Use the `filter` query parameter to retrieve just a subset of a collection.\n"},{"name":"search","in":"query","schema":{"type":"string"},"description":"Use the `search` query parameter to restrict the results of a request to match a search criterion.\n"},{"name":"orderby","in":"query","schema":{"type":"string"},"description":"Use the `orderby` query parameter to specify the sort order of the items returned from server.  \nThe default order is ascending order.\n"},{"name":"skip","in":"query","schema":{"type":"integer","format":"int32","minimum":0,"default":0},"description":"Use the `skip` query parameter to set the number of items to skip at the start of a collection.\n"},{"name":"top","in":"query","schema":{"type":"integer","format":"int32","minimum":1,"maximum":100,"default":100},"description":"Use the `top` query parameter to specify the page size of the result set.\n"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64","minimum":0,"description":"Total number of resource.\n"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"name":{"type":"string","minLength":1,"maxLength":1024,"description":"The name of the tenant.\n"},"domain":{"type":"string","minLength":1,"maxLength":280,"description":"The SIP domain of tenant.  \nIt is usually a fully qualified domain name (FQDN).\nIf there is no FQDN, you can also use the IP address of the PBX server as the SIP domain.\nThe SIP domain name is only used for SIP message authentication and does not require analysis.\n"},"max_extensions":{"type":"integer","format":"int32","minimum":0,"default":1000,"description":"The maximum number of users that the tenant is allowed to create.\n"},"max_concurrent_calls":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of concurrent calls that the tenant is allowed to have.\n"},"enabled":{"type":"boolean","default":true,"description":"Enable this tenant or not.\n"},"website":{"type":"string","maxLength":255,"description":"The official website of tenant.\n"},"timezone":{"allOf":[{"type":"string","description":"The IANA Time Zone names, such as \"Asia/Shanghai\".\n"}],"description":"Timezone for tenant.\n"},"currency":{"type":"string","description":"The Currency code (ISO 4217).\n"},"region":{"type":"string","description":"A valid country code based on iso3166-1 alpha-3 standard. see: https://www.iso.org/iso-3166-country-codes.html\n"},"avatar_file_name":{"type":"string","description":"The name of the file.\n"},"avatar_file_size":{"type":"integer","format":"int64","minimum":0,"description":"The file size in bytes.\n"},"avatar_file_url":{"type":"string","readOnly":true,"description":"The relative path to file url for file downloading.\n"},"created_at":{"allOf":[{"type":"string","format":"date_time","description":"The RFC 3339 format is defined by\nThe date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), \nfor example, 2017-07-21T17:32:28Z\n"}],"description":"The creation time of tenant.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Create a tenant

> Create an new tenant.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/tenants":{"post":{"tags":["Administration"],"operationId":"createTenant","summary":"Create a tenant","description":"Create an new tenant.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":1024,"description":"The name of the tenant.\n"},"domain":{"type":"string","minLength":1,"maxLength":280,"description":"The SIP domain of tenant.  \nIt is usually a fully qualified domain name (FQDN).\nIf there is no FQDN, you can also use the IP address of the PBX server as the SIP domain.\nThe SIP domain name is only used for SIP message authentication and does not require analysis.\n"},"website":{"type":"string","maxLength":255,"description":"The official website of tenant.\n"},"timezone":{"allOf":[{"type":"string","description":"The IANA Time Zone names, such as \"Asia/Shanghai\".\n"}],"description":"Timezone for tenant.\n"},"currency":{"type":"string","description":"The Currency code (ISO 4217).\n"},"region":{"type":"string","description":"A valid country code based on iso3166-1 alpha-3 standard. see: https://www.iso.org/iso-3166-country-codes.html\n"},"enabled":{"type":"boolean","default":true,"description":"Enable this tenant or not.\n"},"enable_video_recording":{"type":"boolean","default":false,"description":"Allow extension video recording.\n"},"enable_audio_recording":{"type":"boolean","default":false,"description":"Allow extension audio recording.\n"},"enable_dual_track_recording":{"type":"boolean","default":false,"description":"Allow dual track recording for calls.\n"},"enable_billing":{"type":"boolean","default":false,"description":"Enable call billing or not.\n"},"enable_feature_billing":{"type":"boolean","default":false,"description":"Enable call billing feature or not.\n"},"enable_feature_call_statistics":{"type":"boolean","default":true,"description":"Enable call statistics feature or not.\n"},"enable_feature_contact_center":{"type":"boolean","default":true,"description":"Enable contact center feature or not.\n"},"enable_feature_message_channels":{"type":"boolean","default":true,"description":"Enable message channels feature or not.\n"},"enable_feature_microsoft_teams":{"type":"boolean","default":true,"description":"Enable Microsoft Teams feature or not.\n"},"enable_feature_trunks":{"type":"boolean","default":true,"description":"Enable trunks feature or not.\n"},"enable_feature_whats_app":{"type":"boolean","default":true,"description":"Enable WhatsApp feature or not.\n"},"enable_night_mode":{"type":"boolean","default":false,"description":"Whether to enable night mode.\n"},"enable_two_factor_authentication":{"type":"boolean","default":false,"description":"Whether to enable two-factor authentication.\n"},"custom_options":{"type":"string","description":"Some custom configuration options serialized as json string\n"},"max_extensions":{"type":"integer","format":"int32","minimum":0,"default":1000,"description":"The maximum number of users that the tenant is allowed to create.\n"},"max_concurrent_calls":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of concurrent calls that the tenant is allowed to have.\n"},"max_ring_groups":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of ring groups that the tenant is allowed to create.\n"},"max_virtual_receptionists":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of virtual receptionists that the tenant is allowed to create.\n"},"max_call_queues":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of call queues that the tenant is allowed to create.\n"},"max_conference_rooms":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of conference rooms that the tenant is allowed to be online at the same time.\n"},"disk_quota":{"type":"string","default":"","description":"The maximum size of disk space that the tenant is allowed to have.  \nSpecify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed.  \nFor example: 100MB, 1000GB. Leave it empty, means unlimited.\n"},"im_disk_quota":{"type":"string","default":"","description":"The maximum size of disk space that the tenant is allowed to have for IM service.  \nSpecify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed.  \nFor example: 100MB, 1000GB. Leave it empty, means unlimited.\n"},"extension_im_disk_quota":{"type":"string","default":"1GB","description":"The maximum size of disk space that the extension user is allowed to have for IM service.  \nSpecify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed.  \nFor example: 100MB, 1000GB. Leave it empty, means unlimited.\n"},"recording_retention":{"type":"integer","format":"int32","minimum":1,"default":180,"description":"The retention period in days of recordings.\n"},"call_report_retention":{"type":"integer","minimum":1,"default":30,"description":"The retention period in days of call report files.\n"},"log_retention":{"type":"integer","minimum":1,"default":180,"description":"The retention period in days of audit logs and event logs.\n"},"temp_file_retention":{"type":"integer","minimum":1,"default":30,"description":"The retention period in days of temporary files.\n"},"office_hours":{"type":"object","properties":{"monday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"tuesday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"wednesday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"thursday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"friday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"saturday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"sunday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}}}},"e164":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Enable number processing or not.\n"},"international_code":{"type":"string","description":"The International code.\n"},"country":{"type":"string","description":"Country code.\n"},"area_code":{"type":"string","description":"Area code.\n"},"national_code":{"type":"string","description":"National code.\n"},"prefix":{"type":"string","description":"Add prefix.\n"},"remove_special_chars":{"type":"boolean","default":false,"description":"Remove special characters in the numbers(the \"(\" and \")\" and spaces).\n"},"remove_duplicate_countries":{"type":"boolean","default":true,"description":"Remove duplicate countries.\n"},"remove_duplicate_area_codes":{"type":"boolean","default":true,"description":"Remove duplicate area code.\n"}}},"cdr_event":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Enabled this event or not.\n"},"auth":{"type":"string","enum":["DISABLE","BASIC","DIGEST","BEARER"],"default":"DISABLE","description":"The authentication method of event URL:  \nCan be either:  \n- `DISABLE`: Disable authentication.\n- `BASIC`: Use basic authentication.\n- `DIGEST`: Use digest authentication.\n- `BEARER`: Use bearer authentication.\n"},"username":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The username for authentication, when auth is `BASIC` or `DIGEST`.\n"},"password":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The password for authentication, when auth is `BASIC` or `DIGEST`.\n"},"token":{"type":"string","description":"The token for authentication, when auth is `BEARER`.\n"},"url":{"type":"string","minLength":1,"maxLength":128,"pattern":"[a-z0-9]{6,64}","description":"The event url.\n"}}},"extension_event":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Enabled this event or not.\n"},"auth":{"type":"string","enum":["DISABLE","BASIC","DIGEST","BEARER"],"default":"DISABLE","description":"The authentication method of event URL:  \nCan be either:  \n- `DISABLE`: Disable authentication.\n- `BASIC`: Use basic authentication.\n- `DIGEST`: Use digest authentication.\n- `BEARER`: Use bearer authentication.\n"},"username":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The username for authentication, when auth is `BASIC` or `DIGEST`.\n"},"password":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The password for authentication, when auth is `BASIC` or `DIGEST`.\n"},"token":{"type":"string","description":"The token for authentication, when auth is `BEARER`.\n"},"url":{"type":"string","minLength":1,"maxLength":128,"pattern":"[a-z0-9]{6,64}","description":"The event url.\n"}}},"contact_match_type":{"type":"string","enum":["DISABLE","MATCH_EXACTLY","MATCH_LENGTH"],"default":"MATCH_EXACTLY","description":"The match method of contact:  \nCan be either:  \n- `DISABLE`: Disable match.\n- `MATCH_EXACTLY`: Match exactly.\n- `MATCH_LENGTH`: Match at least specified number of characters.\n"},"contact_match_length":{"type":"integer","format":"int32","minimum":0,"description":"The matched length of characters when contact_match_type is `MATCH_LENGTH`.\n"},"contact_append_type":{"type":"string","enum":["DISABLE","APPEND","PREPEND"],"default":"APPEND","description":"Method for adding Group, Queue or DID/DDI Names to Caller ID:  \nCan be either:  \n- `DISABLE`: Do not add.\n- `APPEND`: Append names.\n- `PREPEND`: Prepend names.\n"},"contact_update_interval":{"type":"integer","format":"uint32","minimum":1,"maximum":43200,"default":720,"description":"The interval for synchronizing contacts from the server, in minutes.\n"},"email_recipients":{"type":"string","description":"Comma-separated list of email address that should receive notifications.   \nAllow up to 15 email addresses.\n"},"password_force_reset":{"type":"boolean","default":false,"description":"Whether to force reset the initial password.\n"}},"required":["name","domain","timezone","currency","region"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Retrieve a tenant

> Get detailed properties for a tenant.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/tenants/{id}":{"get":{"tags":["Administration"],"operationId":"showTenant","summary":"Retrieve a tenant","description":"Get detailed properties for a tenant.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"description":"The unique ID of the tenant."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"name":{"type":"string","minLength":1,"maxLength":1024,"description":"The name of the tenant.\n"},"domain":{"type":"string","minLength":1,"maxLength":280,"description":"The SIP domain of tenant.  \nIt is usually a fully qualified domain name (FQDN).\nIf there is no FQDN, you can also use the IP address of the PBX server as the SIP domain.\nThe SIP domain name is only used for SIP message authentication and does not require analysis.\n"},"website":{"type":"string","maxLength":255,"description":"The official website of tenant.\n"},"timezone":{"allOf":[{"type":"string","description":"The IANA Time Zone names, such as \"Asia/Shanghai\".\n"}],"description":"Timezone for tenant.\n"},"currency":{"type":"string","description":"The Currency code (ISO 4217).\n"},"region":{"type":"string","description":"A valid country code based on iso3166-1 alpha-3 standard. see: https://www.iso.org/iso-3166-country-codes.html\n"},"enabled":{"type":"boolean","default":true,"description":"Enable this tenant or not.\n"},"enable_video_recording":{"type":"boolean","default":false,"description":"Allow extension video recording.\n"},"enable_audio_recording":{"type":"boolean","default":false,"description":"Allow extension audio recording.\n"},"enable_dual_track_recording":{"type":"boolean","default":false,"description":"Allow dual track recording for calls.\n"},"enable_billing":{"type":"boolean","default":false,"description":"Enable call billing or not.\n"},"enable_feature_billing":{"type":"boolean","default":false,"description":"Enable call billing feature or not.\n"},"enable_feature_call_statistics":{"type":"boolean","default":true,"description":"Enable call statistics feature or not.\n"},"enable_feature_contact_center":{"type":"boolean","default":true,"description":"Enable contact center feature or not.\n"},"enable_feature_message_channels":{"type":"boolean","default":true,"description":"Enable message channels feature or not.\n"},"enable_feature_microsoft_teams":{"type":"boolean","default":true,"description":"Enable Microsoft Teams feature or not.\n"},"enable_feature_trunks":{"type":"boolean","default":true,"description":"Enable trunks feature or not.\n"},"enable_feature_whats_app":{"type":"boolean","default":true,"description":"Enable WhatsApp feature or not.\n"},"enable_night_mode":{"type":"boolean","default":false,"description":"Whether to enable night mode.\n"},"enable_two_factor_authentication":{"type":"boolean","default":false,"description":"Whether to enable two-factor authentication.\n"},"custom_options":{"type":"string","description":"Some custom configuration options serialized as json string\n"},"max_extensions":{"type":"integer","format":"int32","minimum":0,"default":1000,"description":"The maximum number of users that the tenant is allowed to create.\n"},"max_concurrent_calls":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of concurrent calls that the tenant is allowed to have.\n"},"max_ring_groups":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of ring groups that the tenant is allowed to create.\n"},"max_virtual_receptionists":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of virtual receptionists that the tenant is allowed to create.\n"},"max_call_queues":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of call queues that the tenant is allowed to create.\n"},"max_conference_rooms":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of conference rooms that the tenant is allowed to be online at the same time.\n"},"disk_quota":{"type":"string","default":"","description":"The maximum size of disk space that the tenant is allowed to have.  \nSpecify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed.  \nFor example: 100MB, 1000GB. Leave it empty, means unlimited.\n"},"used_disk_quota":{"type":"string","description":"The used disk quota, an number followed by unit (KB, MB, GB, PB).\n"},"im_disk_quota":{"type":"string","default":"","description":"The maximum size of disk space that the tenant is allowed to have for IM service.  \nSpecify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed.  \nFor example: 100MB, 1000GB. Leave it empty, means unlimited.\n"},"extension_im_disk_quota":{"type":"string","default":"1GB","description":"The maximum size of disk space that the extension user is allowed to have for IM service.  \nSpecify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed.  \nFor example: 100MB, 1000GB. Leave it empty, means unlimited.\n"},"recording_retention":{"type":"integer","format":"int32","minimum":1,"default":180,"description":"The retention period in days of recordings.\n"},"call_report_retention":{"type":"integer","minimum":1,"default":30,"description":"The retention period in days of call report files.\n"},"log_retention":{"type":"integer","minimum":1,"default":180,"description":"The retention period in days of audit logs and event logs.\n"},"temp_file_retention":{"type":"integer","minimum":1,"default":30,"description":"The retention period in days of temporary files.\n"},"office_hours":{"type":"object","properties":{"monday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"tuesday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"wednesday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"thursday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"friday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"saturday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"sunday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}}}},"outbound_caller_ids":{"type":"array","items":{"type":"object","properties":{"provider_id":{"allOf":[{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of trunk.\n"}],"description":"The unique ID of trunk.\n"},"caller_id":{"allOf":[{"type":"string","minLength":1,"maxLength":64,"description":"Outbound caller id.\n"}],"description":"The caller ID.\n"},"description":{"type":"string","maxLength":1024,"description":"The descriptive information about this outbound caller id.\n"}}},"description":"A collection of outbound caller IDs.\n"},"e164":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Enable number processing or not.\n"},"international_code":{"type":"string","description":"The International code.\n"},"country":{"type":"string","description":"Country code.\n"},"area_code":{"type":"string","description":"Area code.\n"},"national_code":{"type":"string","description":"National code.\n"},"prefix":{"type":"string","description":"Add prefix.\n"},"remove_special_chars":{"type":"boolean","default":false,"description":"Remove special characters in the numbers(the \"(\" and \")\" and spaces).\n"},"remove_duplicate_countries":{"type":"boolean","default":true,"description":"Remove duplicate countries.\n"},"remove_duplicate_area_codes":{"type":"boolean","default":true,"description":"Remove duplicate area code.\n"}}},"cdr_event":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Enabled this event or not.\n"},"auth":{"type":"string","enum":["DISABLE","BASIC","DIGEST","BEARER"],"default":"DISABLE","description":"The authentication method of event URL:  \nCan be either:  \n- `DISABLE`: Disable authentication.\n- `BASIC`: Use basic authentication.\n- `DIGEST`: Use digest authentication.\n- `BEARER`: Use bearer authentication.\n"},"username":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The username for authentication, when auth is `BASIC` or `DIGEST`.\n"},"password":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The password for authentication, when auth is `BASIC` or `DIGEST`.\n"},"token":{"type":"string","description":"The token for authentication, when auth is `BEARER`.\n"},"url":{"type":"string","minLength":1,"maxLength":128,"pattern":"[a-z0-9]{6,64}","description":"The event url.\n"}}},"extension_event":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Enabled this event or not.\n"},"auth":{"type":"string","enum":["DISABLE","BASIC","DIGEST","BEARER"],"default":"DISABLE","description":"The authentication method of event URL:  \nCan be either:  \n- `DISABLE`: Disable authentication.\n- `BASIC`: Use basic authentication.\n- `DIGEST`: Use digest authentication.\n- `BEARER`: Use bearer authentication.\n"},"username":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The username for authentication, when auth is `BASIC` or `DIGEST`.\n"},"password":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The password for authentication, when auth is `BASIC` or `DIGEST`.\n"},"token":{"type":"string","description":"The token for authentication, when auth is `BEARER`.\n"},"url":{"type":"string","minLength":1,"maxLength":128,"pattern":"[a-z0-9]{6,64}","description":"The event url.\n"}}},"contact_match_type":{"type":"string","enum":["DISABLE","MATCH_EXACTLY","MATCH_LENGTH"],"default":"MATCH_EXACTLY","description":"The match method of contact:  \nCan be either:  \n- `DISABLE`: Disable match.\n- `MATCH_EXACTLY`: Match exactly.\n- `MATCH_LENGTH`: Match at least specified number of characters.\n"},"contact_match_length":{"type":"integer","format":"int32","minimum":0,"description":"The matched length of characters when contact_match_type is `MATCH_LENGTH`.\n"},"contact_append_type":{"type":"string","enum":["DISABLE","APPEND","PREPEND"],"default":"APPEND","description":"Method for adding Group, Queue or DID/DDI Names to Caller ID:  \nCan be either:  \n- `DISABLE`: Do not add.\n- `APPEND`: Append names.\n- `PREPEND`: Prepend names.\n"},"contact_update_interval":{"type":"integer","format":"uint32","minimum":1,"maximum":43200,"default":720,"description":"The interval for synchronizing contacts from the server, in minutes.\n"},"email_recipients":{"type":"string","description":"Comma-separated list of email address that should receive notifications.   \nAllow up to 15 email addresses.\n"},"password_force_reset":{"type":"boolean","default":false,"description":"Whether to force reset the initial password.\n"},"created_at":{"allOf":[{"type":"string","format":"date_time","description":"The RFC 3339 format is defined by\nThe date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), \nfor example, 2017-07-21T17:32:28Z\n"}],"description":"The creation time of tenant.\n"},"avatar_file_name":{"type":"string","description":"The name of the file.\n"},"avatar_file_size":{"type":"integer","format":"int64","minimum":0,"description":"The file size in bytes.\n"},"avatar_file_url":{"type":"string","readOnly":true,"description":"The relative path to file url for file downloading.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update a tenant

> Update tenant properties by it's unique ID.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/tenants/{id}":{"post":{"tags":["Administration"],"operationId":"updateTenant","summary":"Update a tenant","description":"Update tenant properties by it's unique ID.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"description":"The unique ID of the tenant."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":1,"maxLength":280,"description":"The SIP domain of tenant.  \nIt is usually a fully qualified domain name (FQDN).\nIf there is no FQDN, you can also use the IP address of the PBX server as the SIP domain.\nThe SIP domain name is only used for SIP message authentication and does not require analysis.\n"},"website":{"type":"string","maxLength":255,"description":"The official website of tenant.\n"},"timezone":{"allOf":[{"type":"string","description":"The IANA Time Zone names, such as \"Asia/Shanghai\".\n"}],"description":"Timezone for tenant.\n"},"currency":{"type":"string","description":"The Currency code (ISO 4217).\n"},"region":{"type":"string","description":"A valid country code based on iso3166-1 alpha-3 standard. see: https://www.iso.org/iso-3166-country-codes.html\n"},"enabled":{"type":"boolean","default":true,"description":"Enable this tenant or not.\n"},"enable_video_recording":{"type":"boolean","default":false,"description":"Allow extension video recording.\n"},"enable_audio_recording":{"type":"boolean","default":false,"description":"Allow extension audio recording.\n"},"enable_dual_track_recording":{"type":"boolean","default":false,"description":"Allow dual track recording for calls.\n"},"enable_billing":{"type":"boolean","default":false,"description":"Enable call billing or not.\n"},"enable_feature_billing":{"type":"boolean","default":false,"description":"Enable call billing feature or not.\n"},"enable_feature_call_statistics":{"type":"boolean","default":true,"description":"Enable call statistics feature or not.\n"},"enable_feature_contact_center":{"type":"boolean","default":true,"description":"Enable contact center feature or not.\n"},"enable_feature_message_channels":{"type":"boolean","default":true,"description":"Enable message channels feature or not.\n"},"enable_feature_microsoft_teams":{"type":"boolean","default":true,"description":"Enable Microsoft Teams feature or not.\n"},"enable_feature_trunks":{"type":"boolean","default":true,"description":"Enable trunks feature or not.\n"},"enable_feature_whats_app":{"type":"boolean","default":true,"description":"Enable WhatsApp feature or not.\n"},"enable_night_mode":{"type":"boolean","default":false,"description":"Whether to enable night mode.\n"},"enable_two_factor_authentication":{"type":"boolean","default":false,"description":"Whether to enable two-factor authentication.\n"},"custom_options":{"type":"string","description":"Some custom configuration options serialized as json string\n"},"max_extensions":{"type":"integer","format":"int32","minimum":0,"default":1000,"description":"The maximum number of users that the tenant is allowed to create.\n"},"max_concurrent_calls":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of concurrent calls that the tenant is allowed to have.\n"},"max_ring_groups":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of ring groups that the tenant is allowed to create.\n"},"max_virtual_receptionists":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of virtual receptionists that the tenant is allowed to create.\n"},"max_call_queues":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of call queues that the tenant is allowed to create.\n"},"max_conference_rooms":{"type":"integer","format":"int32","minimum":0,"default":20,"description":"The maximum number of conference rooms that the tenant is allowed to be online at the same time.\n"},"disk_quota":{"type":"string","default":"","description":"The maximum size of disk space that the tenant is allowed to have.  \nSpecify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed.  \nFor example: 100MB, 1000GB. Leave it empty, means unlimited.\n"},"im_disk_quota":{"type":"string","default":"","description":"The maximum size of disk space that the tenant is allowed to have for IM service.  \nSpecify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed.  \nFor example: 100MB, 1000GB. Leave it empty, means unlimited.\n"},"extension_im_disk_quota":{"type":"string","default":"1GB","description":"The maximum size of disk space that the extension user is allowed to have for IM service.  \nSpecify a positive number and specify the unit at the same time, KB, MB, GB, PB are all allowed.  \nFor example: 100MB, 1000GB. Leave it empty, means unlimited.\n"},"recording_retention":{"type":"integer","format":"int32","minimum":1,"default":180,"description":"The retention period in days of recordings.\n"},"call_report_retention":{"type":"integer","minimum":1,"default":30,"description":"The retention period in days of call report files.\n"},"log_retention":{"type":"integer","minimum":1,"default":180,"description":"The retention period in days of audit logs and event logs.\n"},"temp_file_retention":{"type":"integer","minimum":1,"default":30,"description":"The retention period in days of temporary files.\n"},"office_hours":{"type":"object","properties":{"monday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"tuesday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"wednesday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"thursday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"friday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"saturday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}},"sunday":{"type":"object","properties":{"enabled":{"type":"boolean","description":"When enabled, all day is working time, when disabled, all day is vacation time.\n"},"ranges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"09:00\".  \nMust be earlier than `to`.\n"},"to":{"type":"string","description":"The start time for office hour with format `HH:MM` in 24 hour clock, such as \"17:00\".  \nMust be later than `from`.\n"}}},"description":"Multiple start and end time periods make up the working time.\n"}}}}},"e164":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Enable number processing or not.\n"},"international_code":{"type":"string","description":"The International code.\n"},"country":{"type":"string","description":"Country code.\n"},"area_code":{"type":"string","description":"Area code.\n"},"national_code":{"type":"string","description":"National code.\n"},"prefix":{"type":"string","description":"Add prefix.\n"},"remove_special_chars":{"type":"boolean","default":false,"description":"Remove special characters in the numbers(the \"(\" and \")\" and spaces).\n"},"remove_duplicate_countries":{"type":"boolean","default":true,"description":"Remove duplicate countries.\n"},"remove_duplicate_area_codes":{"type":"boolean","default":true,"description":"Remove duplicate area code.\n"}}},"cdr_event":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Enabled this event or not.\n"},"auth":{"type":"string","enum":["DISABLE","BASIC","DIGEST","BEARER"],"default":"DISABLE","description":"The authentication method of event URL:  \nCan be either:  \n- `DISABLE`: Disable authentication.\n- `BASIC`: Use basic authentication.\n- `DIGEST`: Use digest authentication.\n- `BEARER`: Use bearer authentication.\n"},"username":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The username for authentication, when auth is `BASIC` or `DIGEST`.\n"},"password":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The password for authentication, when auth is `BASIC` or `DIGEST`.\n"},"token":{"type":"string","description":"The token for authentication, when auth is `BEARER`.\n"},"url":{"type":"string","minLength":1,"maxLength":128,"pattern":"[a-z0-9]{6,64}","description":"The event url.\n"}}},"extension_event":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Enabled this event or not.\n"},"auth":{"type":"string","enum":["DISABLE","BASIC","DIGEST","BEARER"],"default":"DISABLE","description":"The authentication method of event URL:  \nCan be either:  \n- `DISABLE`: Disable authentication.\n- `BASIC`: Use basic authentication.\n- `DIGEST`: Use digest authentication.\n- `BEARER`: Use bearer authentication.\n"},"username":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The username for authentication, when auth is `BASIC` or `DIGEST`.\n"},"password":{"type":"string","minLength":6,"maxLength":64,"pattern":"[a-z0-9]{6,64}","description":"The password for authentication, when auth is `BASIC` or `DIGEST`.\n"},"token":{"type":"string","description":"The token for authentication, when auth is `BEARER`.\n"},"url":{"type":"string","minLength":1,"maxLength":128,"pattern":"[a-z0-9]{6,64}","description":"The event url.\n"}}},"contact_match_type":{"type":"string","enum":["DISABLE","MATCH_EXACTLY","MATCH_LENGTH"],"default":"MATCH_EXACTLY","description":"The match method of contact:  \nCan be either:  \n- `DISABLE`: Disable match.\n- `MATCH_EXACTLY`: Match exactly.\n- `MATCH_LENGTH`: Match at least specified number of characters.\n"},"contact_match_length":{"type":"integer","format":"int32","minimum":0,"description":"The matched length of characters when contact_match_type is `MATCH_LENGTH`.\n"},"contact_append_type":{"type":"string","enum":["DISABLE","APPEND","PREPEND"],"default":"APPEND","description":"Method for adding Group, Queue or DID/DDI Names to Caller ID:  \nCan be either:  \n- `DISABLE`: Do not add.\n- `APPEND`: Append names.\n- `PREPEND`: Prepend names.\n"},"contact_update_interval":{"type":"integer","format":"uint32","minimum":1,"maximum":43200,"default":720,"description":"The interval for synchronizing contacts from the server, in minutes.\n"},"email_recipients":{"type":"string","description":"Comma-separated list of email address that should receive notifications.   \nAllow up to 15 email addresses.\n"},"password_force_reset":{"type":"boolean","default":false,"description":"Whether to force reset the initial password.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Switch between tenants

> Switch between tenants.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/tenants/switch":{"post":{"tags":["Administration"],"operationId":"switchTenants","summary":"Switch between tenants","description":"Switch between tenants.\n","parameters":[{"name":"id","in":"query","schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"description":"The unique ID of the tenant.\n"}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve dealer information the tenant belongs

> Get the dealer to which the tenant belongs.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/tenants/{id}/dealers":{"get":{"tags":["Administration"],"operationId":"retrieveTenantDealer","summary":"Retrieve dealer information the tenant belongs","description":"Get the dealer to which the tenant belongs.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"description":"The unique ID of the tenant."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of dealer.\n"},"enabled":{"type":"boolean","default":true,"description":"Enable this dealer or not.\n"},"level":{"type":"string","enum":["DISTRIBUTOR","SUB_DISTRIBUTOR","RESELLER"],"description":"Dealer level includes:\n- `DISTRIBUTOR`: the first level of dealers.\n- `SUB_DISTRIBUTOR`: the second level of dealers.\n- `RESELLER`: the third level of dealers.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The user's account name.   \nOnly letters, numbers, and the following special characters can be added: underscore, dash, single quote, and period (_, -, ', and .).   \nUsername cannot start or end with period (.).   \n`admin`, `system`, `administrator`, and `root` are reserved names for system admin only with case ignored.\n"},"display_name":{"type":"string","maxLength":1024,"description":"The display name of user.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Designate tenant to dealer

> Designate tenant to dealer.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/tenants/{id}/dealers/{dealer_id}":{"post":{"tags":["Administration"],"operationId":"designateTenantToDealer","summary":"Designate tenant to dealer","description":"Designate tenant to dealer.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"description":"The unique ID of the tenant."},{"name":"dealer_id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of dealer.\n"},"description":"The unique ID of the dealer."}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Remove tenant to dealer

> Remove tenant from dealer.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/tenants/{id}/dealers/{dealer_id}/destroy":{"post":{"tags":["Administration"],"operationId":"removeTenantFromDealer","summary":"Remove tenant to dealer","description":"Remove tenant from dealer.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"description":"The unique ID of the tenant."},{"name":"dealer_id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of dealer.\n"},"description":"The unique ID of the dealer."}],"responses":{"204":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```

## POST /tenants/{id}/destroy

> Delete a tenant

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/tenants/{id}/destroy":{"post":{"tags":["Administration"],"operationId":"deleteTenant","summary":"Delete a tenant","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"description":"The unique ID of the tenant."}],"responses":{"204":{"description":"No Content"},"400":{"description":"Invalid name supplied"},"404":{"description":"Tenant not found"}}}}}}
```

## Retrieve license information

> Retrieve license information<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/license":{"get":{"tags":["Administration"],"operationId":"showLicense","summary":"Retrieve license information","description":"Retrieve license information\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"api_version":{"type":"string","description":"API version of PortSIP PBX.\n"},"product_name":{"type":"string","description":"Product name of PortSIP PBX.\n"},"max_sim_calls":{"type":"integer","format":"int32","description":"Max Simultaneous Calls allowed for this version.\n"},"license_key":{"type":"string","description":"License key of PortSIP PBX.\n"},"company_name":{"type":"string","description":"Company name of license user.\n"},"contact_email":{"type":"string","description":"Contact email of license user.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update license

> Update license<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/license":{"post":{"tags":["Administration"],"operationId":"updateLicense","summary":"Update license","description":"Update license\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"license_key":{"type":"string","description":"License key of PortSIP PBX.\n"}},"required":["license_key"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Show certificate key

> Retrieve content of certificate key.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/key":{"get":{"tags":["Administration"],"operationId":"showKey","summary":"Show certificate key","description":"Retrieve content of certificate key.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"crt":{"type":"string","description":"Content of this certificate file for TLS or WSS transport protocol.\nThe certificate file MUST be PEM-encoded with X.509.\n"},"key":{"type":"string","description":"Content of this private certificate file for TLS or WSS transport protocol.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update certificate key

> Update certificate key.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/key":{"post":{"tags":["Administration"],"operationId":"updateKey","summary":"Update certificate key","description":"Update certificate key.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"crt":{"type":"string","description":"Content of this certificate file for TLS or WSS transport protocol.\nThe certificate file MUST be PEM-encoded with X.509.\n"},"key":{"type":"string","description":"Content of this private certificate file for TLS or WSS transport protocol.\n"}},"required":["crt","key"]}}},"required":true},"responses":{"204":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```

## Update brand information

> Update brand information.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/brand":{"post":{"tags":["Administration"],"operationId":"updateBrandInformation","summary":"Update brand information","description":"Update brand information.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"theme":{"type":"string","enum":["BLUE","DARK","GREEN","LIGHT_BLUE","PURPLE"],"description":"The color scheme:   \nCan be either:   \n- `BLUE`: Blue\n- `DARK`: Dark\n- `GREEN`: Green\n- `LIGHT_BLUE`: Light Blue\n- `PURPLE`: Purple\n"},"logo":{"allOf":[{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of the file.\n"}],"description":"The unique ID of file from your file library.  \nThis file will be used as the logo image.\n"},"favicon":{"allOf":[{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of the file.\n"}],"description":"The unique ID of file from your file library.  \nThis file will be used as the favicon image.\n"},"title":{"type":"string","description":"The title text.  \nThis text will be displayed as the title.\n"},"copyright":{"type":"string","description":"The copyright text.  \nThis text will be displayed as the copyright.\n"},"product":{"type":"string","description":"The product name text.  \nThis text will be displayed as the product name.\n"},"website":{"type":"string","description":"The website text.  \nThis text will be displayed as the product website.\n"},"forum":{"type":"string","description":"The forum url.  \nThis text will be displayed as the forum url.\n"},"bottom_text":{"type":"string","description":"The bottom text, maximum size is 256 characters.\nThis text will be displayed at the bottom of the login page. It can be either plain text or HTML code.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve current dealer

> Get details of current dealer.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dealer":{"get":{"tags":["Administration"],"operationId":"retrieveCurrentDealer","summary":"Retrieve current dealer","description":"Get details of current dealer.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of dealer.\n"},"enabled":{"type":"boolean","default":true,"description":"Enable this dealer or not.\n"},"level":{"type":"string","enum":["DISTRIBUTOR","SUB_DISTRIBUTOR","RESELLER"],"description":"Dealer level includes:\n- `DISTRIBUTOR`: the first level of dealers.\n- `SUB_DISTRIBUTOR`: the second level of dealers.\n- `RESELLER`: the third level of dealers.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The user's account name.   \nOnly letters, numbers, and the following special characters can be added: underscore, dash, single quote, and period (_, -, ', and .).   \nUsername cannot start or end with period (.).   \n`admin`, `system`, `administrator`, and `root` are reserved names for system admin only with case ignored.\n"},"email":{"allOf":[{"type":"string","maxLength":128,"description":"The email address.\n"}],"description":"The email address of user.\n"},"display_name":{"type":"string","maxLength":1024,"description":"The display name of user.\n"},"website":{"type":"string","description":"The website of user.\n"},"phone":{"type":"string","maxLength":32,"description":"The mobile phone number of user.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"description":{"type":"string","description":"The description of dealer.\n"},"max_tenants":{"type":"integer","format":"int32","minimum":0,"default":100,"description":"The maximum number of tenants that the dealer is allowed to create.\n"},"max_extensions":{"type":"integer","format":"int32","minimum":0,"default":50000,"description":"The maximum number of extensions that the dealer is allowed to create.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update current dealer

> Modify the settings of the current dealer.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dealer":{"post":{"tags":["Administration"],"operationId":"updateCurrentDealer","summary":"Update current dealer","description":"Modify the settings of the current dealer.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"allOf":[{"type":"string","maxLength":128,"description":"The email address.\n"}],"description":"The email address of user.\n"},"display_name":{"type":"string","maxLength":1024,"description":"The display name of user.\n"},"website":{"type":"string","description":"The website of user.\n"},"phone":{"type":"string","maxLength":32,"description":"The mobile phone number of user.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"description":{"type":"string","description":"The description of dealer.\n"}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve current dealer status

> Get status of current dealer.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dealer/status":{"get":{"tags":["Administration"],"operationId":"retrieveCurrentDealerStatus","summary":"Retrieve current dealer status","description":"Get status of current dealer.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"The version information of PortSIP PBX.\n"},"max_dealers":{"type":"integer","format":"int32","description":"The maximum number of sub-dealers.\n"},"current_dealers":{"type":"integer","format":"int32","description":"The number of current sub-dealers.\n"},"max_users":{"type":"integer","format":"int32","description":"The maximum number of authorized users purchased by the dealer from distributor.\n"},"current_users":{"type":"integer","format":"int32","description":"The number of current users of the dealer.\n"},"max_tenants":{"type":"integer","format":"int32","description":"The maximum number of tenants the current dealer is allowed to create.\n"},"current_tenants":{"type":"integer","format":"int32","description":"The number of current tenants of the dealer.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Change current dealer username

> Change current dealer username.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dealer/username":{"post":{"tags":["Administration"],"operationId":"changeCurrentDealerUsername","summary":"Change current dealer username","description":"Change current dealer username.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"The user's account name.   \nOnly letters, numbers, and the following special characters can be added: underscore, dash, single quote, and period (_, -, ', and .).   \nUsername cannot start or end with period (.).   \n`admin`, `system`, `administrator`, and `root` are reserved names for system admin only with case ignored.\n"}},"required":["name"]}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Reset current dealer password

> Reset current dealer password.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/dealer/password":{"post":{"tags":["Administration"],"operationId":"resetCurrentDealerPassword","summary":"Reset current dealer password","description":"Reset current dealer password.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"old_password":{"type":"string","description":"The password of dealer.\n"},"new_password":{"type":"string","description":"The password of dealer.\n"}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## List provider assignees

> Get a collection of assignees of provider.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/providers/{id}/assignees":{"get":{"tags":["Administration"],"operationId":"listProviderAssignees","summary":"List provider assignees","description":"Get a collection of assignees of provider.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of trunk.\n"},"description":"The unique ID of the provider."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"tenant_id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"did_numbers":{"type":"string","description":"The semicolon-separated list of DID/DDI pool number range or DID/DDI number.\nAssign a DID/DDI pool number range or DID/DDI number to the tenant.\nFor example: 3000;12000-18000.\nThe DID/DDI pool number range should not overlap with other tenant DID/DDI pool number ranges and numbers.\n"},"concurrency":{"type":"integer","format":"int32","minimum":0,"description":"The max number of concurrent calls.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Check provider assignee

> Check if a provider is assigned to the tenant.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/providers/{id}/assignees/{tenant_id}":{"get":{"tags":["Administration"],"operationId":"checkProviderAssignee","summary":"Check provider assignee","description":"Check if a provider is assigned to the tenant.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of trunk.\n"},"description":"The unique ID of the provider."},{"name":"tenant_id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"description":"The unique ID of the tenant."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"did_numbers":{"type":"string","description":"The semicolon-separated list of DID/DDI pool number range or DID/DDI number.\nAssign a DID/DDI pool number range or DID/DDI number to the tenant.\nFor example: 3000;12000-18000.\nThe DID/DDI pool number range should not overlap with other tenant DID/DDI pool number ranges and numbers.\n"},"concurrency":{"type":"integer","format":"int32","minimum":0,"description":"The max number of concurrent calls.\n"}}}}}},"404":{"description":"Not Found"}}}}}}
```

## Assign provider

> Assign provider to tenant.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/providers/{id}/assignees/{tenant_id}":{"post":{"tags":["Administration"],"operationId":"assignProvider","summary":"Assign provider","description":"Assign provider to tenant.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of trunk.\n"},"description":"The unique ID of the provider."},{"name":"tenant_id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"description":"The unique ID of the tenant."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"did_numbers":{"type":"string","description":"The semicolon-separated list of DID/DDI pool number range or DID/DDI number.\nAssign a DID/DDI pool number range or DID/DDI number to the tenant.\nFor example: 3000;12000-18000.\nThe DID/DDI pool number range should not overlap with other tenant DID/DDI pool number ranges and numbers.\n"},"concurrency":{"type":"integer","format":"int32","minimum":0,"description":"The max number of concurrent calls.\n"}}}}}},"responses":{"204":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```

## Destroy a provider assignee

> Unassign provider from tenant.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Administration","description":"Manage PBX System.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/providers/{id}/assignees/{tenant_id}/destroy":{"post":{"tags":["Administration"],"operationId":"destroyProviderAssignee","summary":"Destroy a provider assignee","description":"Unassign provider from tenant.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of trunk.\n"},"description":"The unique ID of the provider."},{"name":"tenant_id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of tenant.\n"},"description":"The unique ID of the tenant."}],"responses":{"204":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```
