# Tenants

Manage your tenants. Admin user has access to details for his account and other tenant users, whilst tenant user has access to his account info only.

## Retrieve current configurations

> Get detailed properties for current tenant.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/tenant":{"get":{"tags":["Tenant"],"operationId":"showCurrentConfigurations","summary":"Retrieve current configurations","description":"Get detailed properties for current tenant.\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 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"},"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"},"password_force_reset":{"type":"boolean","default":false,"description":"Whether to force reset the initial password.\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"},"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"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update a tenant

> Set tenant object that already exists.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/tenant":{"post":{"tags":["Tenant"],"operationId":"updateSettings","summary":"Update a tenant","description":"Set tenant object that already exists.\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"},"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_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"},"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"},"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"},"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"},"password_force_reset":{"type":"boolean","default":false,"description":"Whether to force reset the initial password.\n"},"avatar_file_id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of the file.\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"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve current tenant status

> Get status of current tenant.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/tenant/status":{"get":{"tags":["Tenant"],"operationId":"retrieveCurrentTenantStatus","summary":"Retrieve current tenant status","description":"Get status of current tenant.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"The version information of PortSIP PBX.\n"},"licensed_users":{"type":"integer","format":"int32","description":"The maximum number of authorized users purchased by the tenant from System Admin or Dealer.\n"},"current_users":{"type":"integer","format":"int32","description":"The number of current users of the tenant.\n"},"online_users":{"type":"integer","format":"int32","description":"The number of current online users of the tenant.\n"},"current_calls":{"type":"integer","format":"int32","description":"The current number of calls.\n"},"current_queues":{"type":"integer","format":"int32","description":"The current number of call queues.\n"},"current_conference_rooms":{"type":"integer","format":"int32","description":"The current number of conference rooms.\n"},"current_ring_groups":{"type":"integer","format":"int32","description":"The current number of ring groups.\n"},"current_ivrs":{"type":"integer","format":"int32","description":"The current number of virtual receptionists.\n"},"current_trunks":{"type":"integer","format":"int32","description":"The current number of trunks.\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"}}}}}}
```

## Retrieve tenant password policy

> Retrieve details of tenant password policy.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/tenant/password_policy":{"get":{"tags":["Tenant"],"operationId":"retrieveTenantPasswordPolicy","summary":"Retrieve tenant password policy","description":"Retrieve details of tenant password policy.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"min_length":{"type":"integer","format":"int32","minimum":6,"maximum":32,"default":6,"description":"The password must contains at least `min_length` characters.  \nMust be less than or equal the value of `max_length`.\n"},"max_length":{"type":"integer","format":"int32","minimum":6,"maximum":32,"default":32,"description":"The password must contains at most `max_length` characters.  \nMust be greater than or equal the value of `min_length`.\n"},"contains_letters":{"type":"boolean","default":true,"description":"The password must contains at least one letter (latin characters).\n"},"contains_numbers":{"type":"boolean","default":true,"description":"The password must contains at least one number (0-9).\n"},"contains_special_letters":{"type":"boolean","default":true,"description":"The password must contains at least one upper case letter or special character (e.g. ~,!,@,#,$,%,^,&,*,(,),_,+,=).\n"},"disable_sequential_characters":{"type":"boolean","default":true,"description":"The password must not contains sequential_characters.\n"},"disable_repeating_characters":{"type":"boolean","default":true,"description":"The password must not contains repeating_characters.\n"},"disable_account_information":{"type":"boolean","default":true,"description":"The password must not similar to the account information.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update tenant password policy

> Update tenant password policy.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/tenant/password_policy":{"post":{"tags":["Tenant"],"operationId":"updateTenantPasswordPolicy","summary":"Update tenant password policy","description":"Update tenant password policy.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"min_length":{"type":"integer","format":"int32","minimum":6,"maximum":32,"default":6,"description":"The password must contains at least `min_length` characters.  \nMust be less than or equal the value of `max_length`.\n"},"max_length":{"type":"integer","format":"int32","minimum":6,"maximum":32,"default":32,"description":"The password must contains at most `max_length` characters.  \nMust be greater than or equal the value of `min_length`.\n"},"contains_letters":{"type":"boolean","default":true,"description":"The password must contains at least one letter (latin characters).\n"},"contains_numbers":{"type":"boolean","default":true,"description":"The password must contains at least one number (0-9).\n"},"contains_special_letters":{"type":"boolean","default":true,"description":"The password must contains at least one upper case letter or special character (e.g. ~,!,@,#,$,%,^,&,*,(,),_,+,=).\n"},"disable_sequential_characters":{"type":"boolean","default":true,"description":"The password must not contains sequential_characters.\n"},"disable_repeating_characters":{"type":"boolean","default":true,"description":"The password must not contains repeating_characters.\n"},"disable_account_information":{"type":"boolean","default":true,"description":"The password must not similar to the account information.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve tenant balance

> Retrieve tenant's balance.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/tenant/balance":{"get":{"tags":["Tenant"],"operationId":"getTenantBalance","summary":"Retrieve tenant balance","description":"Retrieve tenant's balance.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"type":"number","format":"double","description":"User balance. Precision is five digits.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Recharge the tenant

> Recharge into the tenant's account.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/tenant/balance":{"post":{"tags":["Tenant"],"operationId":"rechargeTenant","summary":"Recharge the tenant","description":"Recharge into the tenant's account.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"type":"number","format":"double","description":"User balance. Precision is five digits.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve tenant custom headers

> Retrieve details of tenant custom headers.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/tenant/custom_headers":{"get":{"tags":["Tenant"],"operationId":"retrieveTenantCustomHeaders","summary":"Retrieve tenant custom headers","description":"Retrieve details of tenant custom headers.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"add":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":32,"description":"The name of custom SIP header.\n"},"value":{"type":"string","minLength":1,"maxLength":64,"description":"The value of custom SIP header.\n"},"scope":{"type":"string","enum":["ALL","TRUNK","USER"],"default":"TRUNK","description":"The applied calls of custom SIP headers:   \nCan be either:  \n- `ALL`: Applies to all calls.\n- `TRUNK`: Applies to trunk calls.\n- `USER`: Applies to user calls.\n"}}}},"relay":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":32,"description":"The name of custom SIP header.\n"},"scope":{"type":"string","enum":["ALL","TRUNK","USER"],"default":"TRUNK","description":"The applied calls of custom SIP headers:   \nCan be either:  \n- `ALL`: Applies to all calls.\n- `TRUNK`: Applies to trunk calls.\n- `USER`: Applies to user calls.\n"}}}}},"description":"The added custom SIP headers and forwarded SIP headers in tenant scope.\n"}}}},"4XX":{"description":"Error"}}}}}}
```

## Update tenant custom headers

> Update tenant custom headers.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/tenant/custom_headers":{"post":{"tags":["Tenant"],"operationId":"updateTenantCustomHeaders","summary":"Update tenant custom headers","description":"Update tenant custom headers.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"add":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":32,"description":"The name of custom SIP header.\n"},"value":{"type":"string","minLength":1,"maxLength":64,"description":"The value of custom SIP header.\n"},"scope":{"type":"string","enum":["ALL","TRUNK","USER"],"default":"TRUNK","description":"The applied calls of custom SIP headers:   \nCan be either:  \n- `ALL`: Applies to all calls.\n- `TRUNK`: Applies to trunk calls.\n- `USER`: Applies to user calls.\n"}}}},"relay":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":32,"description":"The name of custom SIP header.\n"},"scope":{"type":"string","enum":["ALL","TRUNK","USER"],"default":"TRUNK","description":"The applied calls of custom SIP headers:   \nCan be either:  \n- `ALL`: Applies to all calls.\n- `TRUNK`: Applies to trunk calls.\n- `USER`: Applies to user calls.\n"}}}}},"description":"The added custom SIP headers and forwarded SIP headers in tenant scope.\n"}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve voicemail server

> Retrieve voicemail server information.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/voicemail":{"get":{"tags":["Tenant"],"operationId":"showVoicemailServer","summary":"Retrieve voicemail server","description":"Retrieve voicemail server information.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"extension_number":{"allOf":[{"type":"string","minLength":3,"maxLength":64,"pattern":"[0-9]{3,64}","description":"The extension number.\n"}],"description":"The extension number of voicemail server."},"retain_days":{"type":"integer","format":"int32","minimum":0,"default":30,"description":"Duration the voicemail will be kept before auto deleted, in days.\n"},"min_seconds":{"type":"integer","format":"int32","minimum":0,"default":1,"description":"The minimum length of a voicemail, in seconds.\nAny callings shorter than this value will not be saved as voicemail.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update voicemail server

> Update voicemail server<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/voicemail":{"post":{"tags":["Tenant"],"operationId":"updateVoicemailServer","summary":"Update voicemail server","description":"Update voicemail server\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"extension_number":{"allOf":[{"type":"string","minLength":3,"maxLength":64,"pattern":"[0-9]{3,64}","description":"The extension number.\n"}],"description":"The extension number of voicemail server."},"retain_days":{"type":"integer","format":"int32","minimum":0,"default":30,"description":"Duration the voicemail will be kept before auto deleted, in days.\n"},"min_seconds":{"type":"integer","format":"int32","minimum":0,"default":1,"description":"The minimum length of a voicemail, in seconds.\nAny callings shorter than this value will not be saved as voicemail.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## List holidays

> Retrieve a collection of holiday entries.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/holidays":{"get":{"tags":["Tenant"],"operationId":"listHolidays","summary":"List holidays","description":"Retrieve a collection of holiday 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"}],"readOnly":true,"description":"The unique ID of holiday.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of the holiday.\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"},"consecutive":{"type":"boolean","description":"Whether the holiday consists of consecutive days.\n"},"every_year":{"type":"boolean","description":"Does the holiday take effect every year.\n"},"year_start":{"type":"integer","description":"The start year of holiday.\n"},"year_end":{"type":"integer","description":"The start year of holiday.\n"},"month_start":{"type":"integer","description":"The start month of holiday.\n"},"month_end":{"type":"integer","description":"The end month of holiday.\n"},"day_start":{"type":"integer","description":"The start day of holiday.\n"},"day_end":{"type":"integer","description":"The end day of holiday.\n"},"hour_start":{"type":"integer","description":"The start hour of holiday.\n"},"hour_end":{"type":"integer","description":"The end hour of holiday.\n"},"minute_start":{"type":"integer","description":"The start minute of holiday.\n"},"minute_end":{"type":"integer","description":"The end minute of holiday.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Create a new holiday

> Create a new holiday<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/holidays":{"post":{"tags":["Tenant"],"operationId":"createHoliday","summary":"Create a new holiday","description":"Create a new holiday\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of the holiday.\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"},"consecutive":{"type":"boolean","description":"Whether the holiday consists of consecutive days.\n"},"every_year":{"type":"boolean","description":"Does the holiday take effect every year.\n"},"year_start":{"type":"integer","description":"The start year of holiday.\n"},"year_end":{"type":"integer","description":"The start year of holiday.\n"},"month_start":{"type":"integer","description":"The start month of holiday.\n"},"month_end":{"type":"integer","description":"The end month of holiday.\n"},"day_start":{"type":"integer","description":"The start day of holiday.\n"},"day_end":{"type":"integer","description":"The end day of holiday.\n"},"hour_start":{"type":"integer","description":"The start hour of holiday.\n"},"hour_end":{"type":"integer","description":"The end hour of holiday.\n"},"minute_start":{"type":"integer","description":"The start minute of holiday.\n"},"minute_end":{"type":"integer","description":"The end minute of holiday.\n"}},"required":["name","region","consecutive","every_year"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"readOnly":true,"description":"The unique ID of holiday.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## GET /holidays/{id}

> Retrieve a holiday

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/holidays/{id}":{"get":{"tags":["Tenant"],"operationId":"showHoliday","summary":"Retrieve a holiday","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"readOnly":true,"description":"The unique ID of holiday.\n"},"description":"The unique ID of the holiday."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"readOnly":true,"description":"The unique ID of holiday.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of the holiday.\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"},"consecutive":{"type":"boolean","description":"Whether the holiday consists of consecutive days.\n"},"every_year":{"type":"boolean","description":"Does the holiday take effect every year.\n"},"year_start":{"type":"integer","description":"The start year of holiday.\n"},"year_end":{"type":"integer","description":"The start year of holiday.\n"},"month_start":{"type":"integer","description":"The start month of holiday.\n"},"month_end":{"type":"integer","description":"The end month of holiday.\n"},"day_start":{"type":"integer","description":"The start day of holiday.\n"},"day_end":{"type":"integer","description":"The end day of holiday.\n"},"hour_start":{"type":"integer","description":"The start hour of holiday.\n"},"hour_end":{"type":"integer","description":"The end hour of holiday.\n"},"minute_start":{"type":"integer","description":"The start minute of holiday.\n"},"minute_end":{"type":"integer","description":"The end minute of holiday.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update a holiday

> Update a holiday that already exists.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/holidays/{id}":{"post":{"tags":["Tenant"],"operationId":"updateHoliday","summary":"Update a holiday","description":"Update a holiday that already exists.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"readOnly":true,"description":"The unique ID of holiday.\n"},"description":"The unique ID of the holiday."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of the holiday.\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"},"consecutive":{"type":"boolean","description":"Whether the holiday consists of consecutive days.\n"},"every_year":{"type":"boolean","description":"Does the holiday take effect every year.\n"},"year_start":{"type":"integer","description":"The start year of holiday.\n"},"year_end":{"type":"integer","description":"The start year of holiday.\n"},"month_start":{"type":"integer","description":"The start month of holiday.\n"},"month_end":{"type":"integer","description":"The end month of holiday.\n"},"day_start":{"type":"integer","description":"The start day of holiday.\n"},"day_end":{"type":"integer","description":"The end day of holiday.\n"},"hour_start":{"type":"integer","description":"The start hour of holiday.\n"},"hour_end":{"type":"integer","description":"The end hour of holiday.\n"},"minute_start":{"type":"integer","description":"The start minute of holiday.\n"},"minute_end":{"type":"integer","description":"The end minute of holiday.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Destroy a holiday

> Destroy a certain holiday entry.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Tenant","description":"Manage your tenants.\nAdmin user has access to details for his account and other tenant users,\nwhilst tenant user has access to his account info only.\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":{"/holidays/{id}/destroy":{"post":{"tags":["Tenant"],"operationId":"deleteHoliday","summary":"Destroy a holiday","description":"Destroy a certain holiday entry.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"readOnly":true,"description":"The unique ID of holiday.\n"},"description":"The unique ID of the holiday."}],"responses":{"204":{"description":"No Content"},"400":{"description":"Invalid rule ID supplied."}}}}}}
```
