> For the complete documentation index, see [llms.txt](https://support.portsip.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.portsip.com/development-portsip/rest-apis/version-22.9/integrations.md).

# Integrations

Manage integrations.

## Retrieve global Microsoft 365 provisioning details

> Retrieve details of global Microsoft 365 settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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/ms365":{"get":{"tags":["Integration"],"operationId":"getGlobalMicrosoft365ProvisioningDetails","summary":"Retrieve global Microsoft 365 provisioning details","description":"Retrieve details of global Microsoft 365 settings.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"national_cloud":{"type":"string","enum":["GLOBAL","CHINA"],"default":"GLOBAL","description":"The Microsoft cloud services are available in several separate national clouds.   \nThese national cloud versions are physical and logical network-isolated instances of Microsoft enterprise cloud services   \nthat are confined within the geographic borders of specific countries and operated by local personnel.\nCan be either:   \n- `GLOBAL`: Azure global service.\n- `CHINA`: Azure China service.\n"},"directory_id":{"type":"string","description":"The Directory ID (Tenant ID) of Microsoft identity platform.\n"},"application_id":{"type":"string","description":"The Application (client) ID of Azure AD.\n"},"redirect_uri":{"type":"string","readOnly":true,"description":"Redirect URI. The URIs we will accept as destinations when returning authentication responses (tokens) after successfully authenticating or signing out users.   \nThe redirect URI you send in the request to the login server should match one listed here. Also referred to as reply URLs.\n"},"sbc_redirect_uri":{"type":"string","readOnly":true,"description":"Same as the `redirect_uri`, but via the sbc network topology.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Reprovision global Microsoft 365 integration.

> Update global Microsoft 365 settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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/ms365":{"post":{"tags":["Integration"],"operationId":"updateGlobalMicrosoft365Provisioning","summary":"Reprovision global Microsoft 365 integration.","description":"Update global Microsoft 365 settings.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"national_cloud":{"type":"string","enum":["GLOBAL","CHINA"],"default":"GLOBAL","description":"The Microsoft cloud services are available in several separate national clouds.   \nThese national cloud versions are physical and logical network-isolated instances of Microsoft enterprise cloud services   \nthat are confined within the geographic borders of specific countries and operated by local personnel.\nCan be either:   \n- `GLOBAL`: Azure global service.\n- `CHINA`: Azure China service.\n"},"directory_id":{"type":"string","description":"The Directory ID (Tenant ID) of Microsoft identity platform.\n"},"application_id":{"type":"string","description":"The Application (client) ID of Azure AD.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Download global Microsoft 365 certificate

> Download global Microsoft 365 certificate.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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/ms365/certificate":{"get":{"tags":["Integration"],"operationId":"downloadGlobalMicrosoft365Certificate","summary":"Download global Microsoft 365 certificate","description":"Download global Microsoft 365 certificate.\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"}}}}}}
```

## Generate new global Microsoft 365 certificate

> Generate new global Microsoft 365 certificate.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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/ms365/certificate":{"post":{"tags":["Integration"],"operationId":"generateGlobalMicrosoft365Certificate","summary":"Generate new global Microsoft 365 certificate","description":"Generate new global Microsoft 365 certificate.\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"}}}}}}
```

## Retrieve global Google integrations

> Retrieve details of global Google integrations settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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/google":{"get":{"tags":["Integration"],"operationId":"getGlobalGoogleIntegrations","summary":"Retrieve global Google integrations","description":"Retrieve details of global Google integrations settings.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","description":"The client ID of Google Cloud project.\n"},"client_secret":{"type":"string","description":"The client secret of Google Cloud project.\n"},"redirect_uri":{"type":"string","readOnly":true,"description":"Redirect URI. The URIs we will accept as destinations when returning authentication responses (tokens) after successfully authenticating or signing out users.   \nThe redirect URI you send in the request to the login server should match one listed here. Also referred to as reply URLs.\n"},"sbc_redirect_uri":{"type":"string","readOnly":true,"description":"Same as the `redirect_uri`, but via the sbc network topology.\n"},"auth_consent_uri":{"type":"string","readOnly":true,"description":"The Google OAuth2 consent uri.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update global Google integration.

> Update global Google integration settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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/google":{"post":{"tags":["Integration"],"operationId":"updateGlobalGoogleIntegrations","summary":"Update global Google integration.","description":"Update global Google integration settings.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","description":"The client ID of Google Cloud project.\n"},"client_secret":{"type":"string","description":"The client secret of Google Cloud project.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Delete global Google integration

> Delete global Google integration settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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/google/destroy":{"post":{"tags":["Integration"],"operationId":"deleteGlobalGoogle","summary":"Delete global Google integration","description":"Delete global Google integration settings.\n","responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Delete global Microsoft 365 integration

> Delete global Microsoft 365 integration settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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/ms365/destroy":{"post":{"tags":["Integration"],"operationId":"deleteGlobalMS365","summary":"Delete global Microsoft 365 integration","description":"Delete global Microsoft 365 integration settings.\n","responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve tenant Microsoft 365 provisioning details

> Retrieve details of tenant Microsoft 365 settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/ms365":{"get":{"tags":["Integration"],"operationId":"getTenantMicrosoft365ProvisioningDetails","summary":"Retrieve tenant Microsoft 365 provisioning details","description":"Retrieve details of tenant Microsoft 365 settings.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"national_cloud":{"type":"string","enum":["GLOBAL","CHINA"],"default":"GLOBAL","description":"The Microsoft cloud services are available in several separate national clouds.   \nThese national cloud versions are physical and logical network-isolated instances of Microsoft enterprise cloud services   \nthat are confined within the geographic borders of specific countries and operated by local personnel.\nCan be either:   \n- `GLOBAL`: Azure global service.\n- `CHINA`: Azure China service.\n"},"directory_id":{"type":"string","description":"The Directory ID (Tenant ID) of Microsoft identity platform.\n"},"application_id":{"type":"string","description":"The Application (client) ID of Azure AD.\n"},"redirect_uri":{"type":"string","readOnly":true,"description":"Redirect URI. The URIs we will accept as destinations when returning authentication responses (tokens) after successfully authenticating or signing out users.   \nThe redirect URI you send in the request to the login server should match one listed here. Also referred to as reply URLs.\n"},"sbc_redirect_uri":{"type":"string","readOnly":true,"description":"Same as the `redirect_uri`, but via the sbc network topology.\n"},"sync_time":{"type":"string","description":"The crontab expression <https://en.wikipedia.org/wiki/Cron>\n"},"users":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Whether to enable Microsoft 365 users with extensions synchronization.\n"},"sync_guest_users":{"type":"boolean","default":false,"description":"Whether to enable gust user synchronization.\n"},"sync_photo":{"type":"boolean","default":false,"description":"Whether to synchronize user photo.\n"},"starting_extension_number":{"type":"string","minLength":3,"maxLength":13,"pattern":"[0-9]{3,13}","description":"The starting extension number for synchronized users.   \nLeft padding with zeros is not allowed.\n"},"selected_users":{"type":"array","items":{"type":"string","description":"The `Principal Name` of Microsoft 365 user.\n"},"description":"A collection of Microsoft 365 user's ID.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The synchronization policy:   \nCan be either:   \n- `ALL`: All users will be synced.\n- `INCLUDE`: All users except selected users will be synced.\n- `EXCLUDE`: All selected users will be synced.\n"}}},"sign_in_as_standard_user":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Whether to enable Microsoft 365 users with extensions synchronization.\n"},"selected_users":{"type":"array","items":{"type":"string","description":"The `Principal Name` of Microsoft 365 user.\n"},"description":"A collection of Microsoft 365 user's ID.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The synchronization policy:   \nCan be either:   \n- `ALL`: All users will be synced.\n- `INCLUDE`: All users except selected users will be synced.\n- `EXCLUDE`: All selected users will be synced.\n"}}},"personal_contacts":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Whether to enable user personal contacts synchronization.\n"},"selected_users":{"type":"array","items":{"type":"string","description":"The `Principal Name` of Microsoft 365 user.\n"},"description":"A collection of Microsoft 365 user's ID.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The synchronization policy:   \nCan be either:   \n- `ALL`: All users will be synced.\n- `INCLUDE`: All users except selected users will be synced.\n- `EXCLUDE`: All selected users will be synced.\n"}}},"shared_mailbox":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Whether to enable Microsoft 365 users with extensions synchronization.\n"},"selected_users":{"type":"array","items":{"type":"string","description":"The `Principal Name` of Microsoft 365 user.\n"},"description":"A collection of Microsoft 365 user's ID.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The synchronization policy:   \nCan be either:   \n- `ALL`: All users will be synced.\n- `INCLUDE`: All users except selected users will be synced.\n- `EXCLUDE`: All selected users will be synced.\n"}}},"events":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Whether to enable Microsoft 365 users with extensions synchronization.\n"},"selected_users":{"type":"array","items":{"type":"string","description":"The `Principal Name` of Microsoft 365 user.\n"},"description":"A collection of Microsoft 365 user's ID.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The synchronization policy:   \nCan be either:   \n- `ALL`: All users will be synced.\n- `INCLUDE`: All users except selected users will be synced.\n- `EXCLUDE`: All selected users will be synced.\n"}}},"groups":{"type":"array","items":{"type":"string","description":"The groups to sync from Microsoft 365.\n"},"description":"A collection of Microsoft 365 groups to sync.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Reprovision tenant Microsoft 365 integration.

> Update tenant Microsoft 365 settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/ms365":{"post":{"tags":["Integration"],"operationId":"updateTenantMicrosoft365Provisioning","summary":"Reprovision tenant Microsoft 365 integration.","description":"Update tenant Microsoft 365 settings.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"national_cloud":{"type":"string","enum":["GLOBAL","CHINA"],"default":"GLOBAL","description":"The Microsoft cloud services are available in several separate national clouds.   \nThese national cloud versions are physical and logical network-isolated instances of Microsoft enterprise cloud services   \nthat are confined within the geographic borders of specific countries and operated by local personnel.\nCan be either:   \n- `GLOBAL`: Azure global service.\n- `CHINA`: Azure China service.\n"},"directory_id":{"type":"string","description":"The Directory ID (Tenant ID) of Microsoft identity platform.\n"},"application_id":{"type":"string","description":"The Application (client) ID of Azure AD.\n"},"sync_time":{"type":"string","description":"The crontab expression <https://en.wikipedia.org/wiki/Cron>\n"},"users":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Whether to enable Microsoft 365 users with extensions synchronization.\n"},"sync_guest_users":{"type":"boolean","default":false,"description":"Whether to enable gust user synchronization.\n"},"sync_photo":{"type":"boolean","default":false,"description":"Whether to synchronize user photo.\n"},"starting_extension_number":{"type":"string","minLength":3,"maxLength":13,"pattern":"[0-9]{3,13}","description":"The starting extension number for synchronized users.   \nLeft padding with zeros is not allowed.\n"},"selected_users":{"type":"array","items":{"type":"string","description":"The `Principal Name` of Microsoft 365 user.\n"},"description":"A collection of Microsoft 365 user's ID.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The synchronization policy:   \nCan be either:   \n- `ALL`: All users will be synced.\n- `INCLUDE`: All users except selected users will be synced.\n- `EXCLUDE`: All selected users will be synced.\n"}}},"sign_in_as_standard_user":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Whether to enable Microsoft 365 users with extensions synchronization.\n"},"selected_users":{"type":"array","items":{"type":"string","description":"The `Principal Name` of Microsoft 365 user.\n"},"description":"A collection of Microsoft 365 user's ID.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The synchronization policy:   \nCan be either:   \n- `ALL`: All users will be synced.\n- `INCLUDE`: All users except selected users will be synced.\n- `EXCLUDE`: All selected users will be synced.\n"}}},"personal_contacts":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Whether to enable user personal contacts synchronization.\n"},"selected_users":{"type":"array","items":{"type":"string","description":"The `Principal Name` of Microsoft 365 user.\n"},"description":"A collection of Microsoft 365 user's ID.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The synchronization policy:   \nCan be either:   \n- `ALL`: All users will be synced.\n- `INCLUDE`: All users except selected users will be synced.\n- `EXCLUDE`: All selected users will be synced.\n"}}},"shared_mailbox":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Whether to enable Microsoft 365 users with extensions synchronization.\n"},"selected_users":{"type":"array","items":{"type":"string","description":"The `Principal Name` of Microsoft 365 user.\n"},"description":"A collection of Microsoft 365 user's ID.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The synchronization policy:   \nCan be either:   \n- `ALL`: All users will be synced.\n- `INCLUDE`: All users except selected users will be synced.\n- `EXCLUDE`: All selected users will be synced.\n"}}},"events":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Whether to enable Microsoft 365 users with extensions synchronization.\n"},"selected_users":{"type":"array","items":{"type":"string","description":"The `Principal Name` of Microsoft 365 user.\n"},"description":"A collection of Microsoft 365 user's ID.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The synchronization policy:   \nCan be either:   \n- `ALL`: All users will be synced.\n- `INCLUDE`: All users except selected users will be synced.\n- `EXCLUDE`: All selected users will be synced.\n"}}},"groups":{"type":"array","items":{"type":"string","description":"The groups to sync from Microsoft 365.\n"},"description":"A collection of Microsoft 365 groups to sync.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Download Microsoft 365 certificate

> Download Microsoft 365 certificate.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/ms365/certificate":{"get":{"tags":["Integration"],"operationId":"downloadMicrosoft365Certificate","summary":"Download Microsoft 365 certificate","description":"Download Microsoft 365 certificate.\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"}}}}}}
```

## Generate new Microsoft 365 certificate

> Generate new Microsoft 365 certificate.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/ms365/certificate":{"post":{"tags":["Integration"],"operationId":"generateMicrosoft365Certificate","summary":"Generate new Microsoft 365 certificate","description":"Generate new Microsoft 365 certificate.\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"}}}}}}
```

## Retrieve a collection of Microsoft 365 users

> Retrieve a collection of Microsoft 365 users.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/ms365/users":{"get":{"tags":["Integration"],"operationId":"listMicrosoft365Users","summary":"Retrieve a collection of Microsoft 365 users","description":"Retrieve a collection of Microsoft 365 users.\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":{"type":"string","description":"The `OID` of Microsoft 365 user.\n"},"name":{"type":"string","description":"The name of Microsoft 365 user.\n"},"email":{"allOf":[{"type":"string","maxLength":128,"description":"The email address.\n"}],"description":"The email address of Microsoft 365 user.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## List Microsoft 365 users by type

> List users from Microsoft 365 by user type.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/ms365/users/{type}":{"get":{"tags":["Integration"],"operationId":"listMicrosoft365UsersByType","summary":"List Microsoft 365 users by type","description":"List users from Microsoft 365 by user type.\n","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["USER","PRIVATE","SHARED"]}},{"name":"top","in":"query","description":"The maximum number of items to return","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"search","in":"query","description":"Search for users by name, email, or other fields","schema":{"type":"string"}},{"name":"skiptoken","in":"query","description":"Token for pagination","schema":{"type":"string"}},{"name":"group","in":"query","description":"Group ID to filter users by group membership","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The `OID` of Microsoft 365 user.\n"},"name":{"type":"string","description":"The name of Microsoft 365 user.\n"},"email":{"allOf":[{"type":"string","maxLength":128,"description":"The email address.\n"}],"description":"The email address of Microsoft 365 user.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get Microsoft 365 user details

> Get detailed information about a specific Microsoft 365 user.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/ms365/users/details/{id}":{"get":{"tags":["Integration"],"operationId":"getMicrosoft365UserDetails","summary":"Get Microsoft 365 user details","description":"Get detailed information about a specific Microsoft 365 user.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The ID of the Microsoft 365 user.\n"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"principal_name":{"type":"string"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## List MS365 groups

> List all MS365 groups

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/ms365/groups":{"get":{"tags":["Integration"],"summary":"List MS365 groups","description":"List all MS365 groups","operationId":"listMS365Groups","parameters":[{"name":"$top","in":"query","description":"Number of items to return per page","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}},{"name":"skiptoken","in":"query","description":"Skip token for pagination","schema":{"type":"string"}},{"name":"search","in":"query","description":"Search for groups by displayName or mail","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"link":{"description":"Link header for pagination","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"mail":{"type":"string"}}}}}}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}}}}}}
```

## Bulk get MS365 groups

> Bulk get MS365 groups by IDs

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/ms365/groups/get_many":{"post":{"tags":["Integration"],"summary":"Bulk get MS365 groups","description":"Bulk get MS365 groups by IDs","operationId":"bulkGetMS365Groups","requestBody":{"description":"Group IDs","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":0}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"mail":{"type":"string"}}}}}}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"500":{"description":"Internal server error"}}}}}}
```

## List MS365 group members

> List members of a specific MS365 group

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/ms365/groups/{id}/{type}":{"get":{"tags":["Integration"],"summary":"List MS365 group members","description":"List members of a specific MS365 group","operationId":"listMS365GroupMembers","parameters":[{"name":"id","in":"path","description":"The unique ID of the MS365 group","required":true,"schema":{"type":"string"}},{"name":"type","in":"path","description":"Type of members to list","required":true,"schema":{"type":"string","enum":["USER","PRIVATE","SHARED"]}},{"name":"$top","in":"query","description":"Number of items to return per page","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}},{"name":"skiptoken","in":"query","description":"Skip token for pagination","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"link":{"description":"Link header for pagination","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"mail":{"type":"string"}}}}}}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Group not found"},"500":{"description":"Internal server error"}}}}}}
```

## Delete MS365 integration

> Delete a certain MS365 integration.

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/ms365/destroy":{"post":{"tags":["Integration"],"operationId":"deleteMS365","summary":"Delete MS365 integration","description":"Delete a certain MS365 integration.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve tenant Google integrations

> Retrieve details of tenant Google integrations settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/google":{"get":{"tags":["Integration"],"operationId":"getTenantGoogleIntegrations","summary":"Retrieve tenant Google integrations","description":"Retrieve details of tenant Google integrations settings.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","description":"The client ID of Google Cloud project.\n"},"client_secret":{"type":"string","description":"The client secret of Google Cloud project.\n"},"redirect_uri":{"type":"string","readOnly":true,"description":"Redirect URI. The URIs we will accept as destinations when returning authentication responses (tokens) after successfully authenticating or signing out users.   \nThe redirect URI you send in the request to the login server should match one listed here. Also referred to as reply URLs.\n"},"sbc_redirect_uri":{"type":"string","readOnly":true,"description":"Same as the `redirect_uri`, but via the sbc network topology.\n"},"auth_consent_uri":{"type":"string","readOnly":true,"description":"The Google OAuth2 consent uri.\n"},"sync_time":{"type":"string","description":"The time at which the synchronization should be performed, using cron syntax.\nDefaults to '0 0 * * *' (midnight every day).\n"},"users":{"type":"object","description":"User synchronization settings.\n","properties":{"enabled":{"type":"boolean","description":"Whether user synchronization is enabled.\n"},"sync_photo":{"type":"boolean","description":"Whether to synchronize user photos.\n"},"starting_extension_number":{"type":"string","description":"The starting extension number for synchronized users.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"description":"The synchronization type: 'ALL' for all users, 'INCLUDE' for specific users, or 'EXCLUDE' for all except specific users.\n"},"selected_users":{"type":"array","items":{"type":"string"},"description":"The list of selected users for synchronization (depending on sync_type).\n"}}},"sign_in_as_standard_user":{"type":"object","description":"Standard user SSO settings.\n","properties":{"enabled":{"type":"boolean","description":"Whether standard user SSO is enabled.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"description":"The SSO type: 'all' for all users, 'include' for specific users, or 'exclude' for all except specific users.\n"},"selected_users":{"type":"array","items":{"type":"string"},"description":"The list of selected users for SSO (depending on sync_type).\n"}}},"directory_contacts":{"type":"object","description":"Directory contact synchronization settings.\n","properties":{"enabled":{"type":"boolean","description":"Whether directory contact synchronization is enabled.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"description":"The synchronization type: 'ALL' for all contacts, 'INCLUDE' for specific contacts, or 'EXCLUDE' for all except specific contacts.\n"},"selected_contacts":{"type":"array","items":{"type":"string"},"description":"The list of selected contacts for synchronization (depending on sync_type).\n"}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update tenant Google integration.

> Update tenant Google integration settings.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/google":{"post":{"tags":["Integration"],"operationId":"updateTenantGoogleIntegrations","summary":"Update tenant Google integration.","description":"Update tenant Google integration settings.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","description":"The client ID of Google Cloud project.\n"},"client_secret":{"type":"string","description":"The client secret of Google Cloud project.\n"},"sync_time":{"type":"string","description":"The time at which the synchronization should be performed, using cron syntax.\nDefaults to '0 0 * * *' (midnight every day).\n"},"users":{"type":"object","description":"User synchronization settings.\n","properties":{"enabled":{"type":"boolean","description":"Whether user synchronization is enabled.\n"},"sync_photo":{"type":"boolean","description":"Whether to synchronize user photos.\n"},"starting_extension_number":{"type":"string","description":"The starting extension number for synchronized users.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"description":"The synchronization type: 'ALL' for all users, 'INCLUDE' for specific users, or 'EXCLUDE' for all except specific users.\n"},"selected_users":{"type":"array","items":{"type":"string"},"description":"The list of selected users for synchronization (depending on sync_type).\n"}}},"sign_in_as_standard_user":{"type":"object","description":"Standard user SSO settings.\n","properties":{"enabled":{"type":"boolean","description":"Whether standard user SSO is enabled.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"description":"The SSO type: 'all' for all users, 'include' for specific users, or 'exclude' for all except specific users.\n"},"selected_users":{"type":"array","items":{"type":"string"},"description":"The list of selected users for SSO (depending on sync_type).\n"}}},"directory_contacts":{"type":"object","description":"Directory contact synchronization settings.\n","properties":{"enabled":{"type":"boolean","description":"Whether directory contact synchronization is enabled.\n"},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"description":"The synchronization type: 'ALL' for all contacts, 'INCLUDE' for specific contacts, or 'EXCLUDE' for all except specific contacts.\n"},"selected_contacts":{"type":"array","items":{"type":"string"},"description":"The list of selected contacts for synchronization (depending on sync_type).\n"}}}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## List Google users

> List users from Google Workspace.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/google/users/{type}":{"get":{"tags":["Integration"],"operationId":"listGoogleUsers","summary":"List Google users","description":"List users from Google Workspace.\n","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string","enum":["USER"]}},{"name":"top","in":"query","description":"The maximum number of items to return","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"search","in":"query","description":"Search for users by name, email, or other fields","schema":{"type":"string"}},{"name":"skiptoken","in":"query","description":"Token for pagination","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"principal_name":{"type":"string"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get Google user details

> Get detailed information about a specific Google Workspace user.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/google/users/details/{id}":{"get":{"tags":["Integration"],"operationId":"getGoogleUserDetails","summary":"Get Google user details","description":"Get detailed information about a specific Google Workspace user.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The user ID of the Google account.\n"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"principal_name":{"type":"string"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Delete Google integration

> Delete a certain Google integration.

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/google/destroy":{"post":{"tags":["Integration"],"operationId":"deleteGoogle","summary":"Delete Google integration","description":"Delete a certain Google integration.","responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Generate Google authorization URL

> Generate Google authorization URL for tenant

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/google/authorization":{"post":{"tags":["Integration"],"summary":"Generate Google authorization URL","description":"Generate Google authorization URL for tenant","operationId":"googleAuthorization","requestBody":{"description":"Google authorization request","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","description":"Google client ID"},"client_secret":{"type":"string","description":"Google client secret"},"callback_url":{"type":"string","description":"Callback URL after authorization"}},"required":["client_id","client_secret"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"auth_consent_uri":{"type":"string","description":"Google authorization URL"}}}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"409":{"description":"Client ID already exists"},"500":{"description":"Internal server error"}}}}}}
```

## Retrieve tenant Generic IdP integration

> Retrieve the current tenant Generic IdP integration settings. Each tenant can have one Generic IdP integration.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/idp":{"get":{"tags":["Integration"],"operationId":"getTenantGenericIdPIntegration","summary":"Retrieve tenant Generic IdP integration","description":"Retrieve the current tenant Generic IdP integration settings. Each tenant can have one Generic IdP integration.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The tenant Generic IdP integration ID."},"auth_protocol":{"type":"string","enum":["oidc","saml"],"default":"oidc","description":"The SSO protocol used by the integration."},"auth_config":{"type":"object","description":"Protocol-specific SSO configuration. Shape depends on `auth_protocol`.\nUpdates submit the complete active protocol configuration. Secret properties may be omitted,\nnull, empty or masked to preserve their stored values; a non-empty unmasked secret replaces it.\n","oneOf":[{"type":"object","required":["issuer","client_id","auth_method"],"properties":{"issuer":{"type":"string","description":"Required for OIDC sign-in. PBX uses it for OIDC discovery."},"client_id":{"type":"string","description":"Required for OIDC sign-in."},"client_secret":{"type":["string","null"],"description":"Required for OIDC sign-in when `auth_method` is `client_secret_basic` or `client_secret_post`. GET returns a masked value, never the complete secret. Omitted, null, empty or masked values preserve the stored secret on update; a non-empty unmasked value replaces it."},"client_secret_configured":{"type":"boolean","readOnly":true},"auth_method":{"type":"string","enum":["client_secret_basic","client_secret_post","private_key_jwt"],"default":"client_secret_basic","description":"Required for OIDC sign-in. `client_secret_basic` sends credentials through HTTP Basic authentication; `client_secret_post` sends them as token request form parameters; `private_key_jwt` sends a signed client assertion. Defaults to `client_secret_basic` when omitted."},"private_key":{"type":["string","null"],"description":"Required for OIDC sign-in when `auth_method` is `private_key_jwt`. GET returns a masked value, never the complete private key. Omitted, null, empty or masked values preserve the stored key on update; a non-empty unmasked value replaces it."},"private_key_configured":{"type":"boolean","readOnly":true},"key_id":{"type":"string"},"use_pkce":{"type":"boolean","default":true,"description":"Enable PKCE (S256) for the OIDC Authorization Code Flow. Disable only when the identity provider does not support PKCE."}}},{"type":"object","required":["client_id","saml_metadata_source"],"allOf":[{"oneOf":[{"title":"Metadata URL","properties":{"saml_metadata_source":{"const":"metadata_url"},"saml_metadata_url":{"type":"string"}},"required":["saml_metadata_url"]},{"title":"Metadata XML","properties":{"saml_metadata_source":{"const":"metadata_xml"},"saml_metadata_xml":{"type":"string"}},"required":["saml_metadata_xml"]},{"title":"Manual SAML endpoints and certificate","properties":{"saml_metadata_source":{"const":"manual"},"issuer":{"type":"string"},"saml_sso_url":{"type":"string"},"saml_signing_certificate":{"type":"string"}},"required":["issuer","saml_sso_url","saml_signing_certificate"]}]}],"properties":{"issuer":{"type":"string","description":"The SAML IdP Entity ID. Required and used only when `saml_metadata_source` is `manual`; metadata supplies it in the other modes."},"client_id":{"type":"string","description":"Required for SAML sign-in. The PBX SAML service-provider (SP) Entity ID."},"saml_metadata_source":{"type":"string","enum":["metadata_url","metadata_xml","manual"],"default":"metadata_url","description":"Selects the only SAML configuration source used at runtime. `metadata_url` downloads IdP metadata,\n`metadata_xml` parses pasted IdP metadata, and `manual` uses `issuer`, `saml_sso_url`, and\n`saml_signing_certificate`. Values retained for inactive sources are ignored.\n"},"saml_sso_url":{"type":"string","description":"The IdP SSO endpoint URL. Required and used only when `saml_metadata_source` is `manual`."},"saml_metadata_url":{"type":"string","description":"Required and used only when `saml_metadata_source` is `metadata_url`. PBX downloads and parses the IdP metadata. Like every other outbound request of the Generic IdP integration (OIDC discovery/token/JWKS, SAML metadata, SCIM requests and their token endpoint), HTTPS requests skip TLS server certificate validation for private IdP compatibility, including chain, hostname and validity checks. This carries a man-in-the-middle risk; use only a trusted endpoint/network. SAML response signature validation remains enabled. The policy is limited to the Generic IdP integration and does not affect other outbound HTTPS connections such as Microsoft 365, Google, SMTP or S3."},"saml_metadata_xml":{"type":"string","description":"Required and used only when `saml_metadata_source` is `metadata_xml`. Paste the complete IdP metadata XML document."},"saml_signing_certificate":{"type":"string","description":"Required and used only when `saml_metadata_source` is `manual`. Accepts one PEM-encoded X.509 certificate or its Base64 DER content. PBX validates and normalizes it to Base64 DER. This is public certificate material and is returned by GET."},"saml_name_id_format":{"type":"string","default":"urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified","description":"SAML AuthnRequest NameID format. Defaults to `urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified` when omitted. Standard or IdP-specific URI values are accepted for compatibility."}}}]},"sync_protocol":{"type":"string","enum":["scim"],"default":"scim","readOnly":true,"description":"Generic IdP uses SCIM 2.0 as its directory protocol. The protocol is fixed in this release."},"redirect_uri":{"type":"string","readOnly":true,"description":"The PBX OIDC callback URL or SAML Assertion Consumer Service URL that must be registered in the external identity provider."},"sbc_redirect_uri":{"type":"string","readOnly":true,"description":"Same as the `redirect_uri`, but via the SBC network topology."},"users":{"type":"object","description":"User synchronization settings for the Generic IdP SCIM 2.0 directory.\n`auth_method` explicitly selects the only authentication settings used at runtime. `bearer_token` sends the configured long-lived static token as-is; `oauth2_client_credentials` obtains short-lived access tokens from the configured token endpoint. Credentials retained for the inactive method are ignored.\nWhen `users.enabled` is true, `scim_base_url` and `starting_extension_number` are required and cannot be empty or whitespace-only. A configured SCIM directory also requires the fields for its selected authentication method. Disabled, completely unconfigured synchronization remains optional.\nUpdates submit the complete non-secret synchronization settings. GET returns masked `scim_token` and `token_client_secret` values. Omitted, null, empty or masked credential values preserve stored credentials; a non-empty unmasked value replaces a credential. Empty strings do not clear credentials.\n","properties":{"enabled":{"type":"boolean","default":false},"sync_time":{"type":"string","default":"0 0 * * *","description":"Optional cron expression. Defaults to `0 0 * * *`."},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The selection policy."},"selected":{"type":"array","items":{"type":"string"}},"starting_extension_number":{"type":"string","description":"Required for automatic synchronization. Must contain 3-13 ASCII digits. Empty or whitespace-only values are rejected when synchronization is enabled.","minLength":3,"maxLength":13,"pattern":"^[0-9]{3,13}$"},"scim_base_url":{"type":"string","description":"Required when user synchronization is enabled, and also required before SCIM users can be listed or manually bound. Explicit empty or whitespace-only values are rejected on save even when automatic synchronization is disabled. Omit this property when synchronization is disabled and the SCIM directory is not being configured."},"auth_method":{"type":"string","enum":["bearer_token","oauth2_client_credentials"],"default":"oauth2_client_credentials","description":"Required when a SCIM directory is configured. Selects the only SCIM authentication method used at runtime. Inactive credentials can remain stored but are ignored."},"scim_token":{"type":["string","null"],"description":"Required when `auth_method` is `bearer_token`. PBX sends this long-lived static token as-is and does not renew it. GET returns a masked value, never the complete token. Omitted, null, empty or masked values preserve the stored token; a non-empty unmasked value replaces it."},"scim_token_configured":{"type":"boolean","readOnly":true},"token_url":{"type":"string","description":"Required when `auth_method` is `oauth2_client_credentials`. PBX obtains short-lived SCIM access tokens from this OAuth2 token endpoint."},"token_client_id":{"type":"string","description":"Required when `auth_method` is `oauth2_client_credentials`. OAuth2 client ID used at the token endpoint."},"token_client_secret":{"type":["string","null"],"description":"Required when `auth_method` is `oauth2_client_credentials`. OAuth2 client secret sent to the token endpoint. GET returns a masked value, never the complete secret. Omitted, null, empty or masked values preserve the stored secret; a non-empty unmasked value replaces it."},"token_client_secret_configured":{"type":"boolean","readOnly":true}}},"sign_in_as_standard_user":{"type":"object","description":"Standard user SSO settings. The selected user list contains local PBX user IDs; PBX converts them to IdP account IDs when validating sign-in.\nWhen `enabled` is true, the selected `auth_protocol` must have a valid `auth_config`.\n","properties":{"enabled":{"type":"boolean","default":false},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The selection policy."},"selected_users":{"type":"array","items":{"type":"string"}}}},"mapping_config":{"type":"object","description":"Stable external user-key mapping. The configured OIDC or SAML key must identify the same remote user as the SCIM key.\nA configured OIDC claim or SAML attribute is strict: sign-in fails when that value is absent and does not fall back to `sub` or `NameID`.\nNon-empty mapped SCIM identifiers must be unique within the remote directory; duplicate identifiers reject directory lookup and synchronization.\n","properties":{"external_user_key":{"type":"object","description":"Stable remote key used by PBX user bindings. Configure the OIDC or SAML value to equal the SCIM value for the same person.","properties":{"oidc_claim":{"type":"string","default":"sub","description":"OIDC claim used as the stable external user key."},"saml_attribute":{"type":"string","default":"NameID","description":"SAML NameID or assertion attribute used as the stable external user key."},"scim_attribute":{"type":"string","default":"id","description":"SCIM user attribute used as the stable external user key for automatic sync and manual binding."}}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update tenant Generic IdP integration

> Update the current tenant Generic IdP integration settings. A valid OIDC or SAML configuration enables the integration. Deleting the integration disables it.\
> \
> Required fields depend on the submitted protocol configuration and enabled capability. Saving \`auth\_config\`, creating the integration or changing \`auth\_protocol\` validates the complete resulting basic configuration even when SSO is disabled. Existing configuration can be partially updated by omitting unchanged properties. Explicitly submitting an empty, whitespace-only or null required non-secret field is rejected, not treated as an instruction to retain the old value. Secret fields retain the separate masked-update behavior described below.\
> \
> \- For OIDC basic configuration or enabled OIDC SSO: \`auth\_config.issuer\` and \`auth\_config.client\_id\` must be non-empty. \`auth\_config.auth\_method\` defaults to \`client\_secret\_basic\` when omitted, but explicit empty values are rejected. A stored or newly supplied \`auth\_config.client\_secret\` is required for \`client\_secret\_basic\` or \`client\_secret\_post\`; \`auth\_config.private\_key\` is required for \`private\_key\_jwt\`. An empty or masked Secret does not satisfy a first-time configuration without an existing stored credential.\
> \- For SAML basic configuration or enabled SAML SSO: \`auth\_config.client\_id\` and \`auth\_config.saml\_metadata\_source\` are required. Source \`metadata\_url\` requires \`saml\_metadata\_url\`; source \`metadata\_xml\` requires \`saml\_metadata\_xml\`; source \`manual\` requires \`issuer\`, \`saml\_sso\_url\`, and \`saml\_signing\_certificate\`. Only the selected source is used; retained values for the other sources are ignored.\
> \- Generic IdP uses SCIM 2.0 for remote user lookup and user synchronization. \`users.scim\_base\_url\` is required before users can be listed, manually bound, or automatically synchronized. Explicit empty or whitespace-only \`users.scim\_base\_url\` values are rejected even in manual mode. Omit the property when synchronization is disabled and no SCIM directory is being configured.\
> \- \`users.auth\_method\` selects the SCIM authentication settings used at runtime. \`bearer\_token\` requires \`users.scim\_token\`. \`oauth2\_client\_credentials\` requires \`users.token\_url\`, \`users.token\_client\_id\`, and \`users.token\_client\_secret\`. Credentials retained for the inactive method are ignored.\
> \- Enabling automatic synchronization additionally requires \`users.starting\_extension\_number\` (3-13 ASCII digits). Disabled, completely unconfigured synchronization remains optional.\
> \- Attribute Mapping identifiers use their documented defaults when omitted. Explicit empty, whitespace-only or null \`mapping\_config.external\_user\_key.oidc\_claim\`, \`saml\_attribute\` or \`scim\_attribute\` values are rejected.\
> \- GET returns masked values for \`auth\_config.client\_secret\`, \`auth\_config.private\_key\`, \`users.scim\_token\` and \`users.token\_client\_secret\`, never complete credentials. On POST, omitted, null, empty or masked values preserve stored credentials; a non-empty unmasked value replaces a credential. Empty strings do not clear credentials. Omitted non-secret properties also preserve their stored values.\
> \- \`redirect\_uri\` and \`sbc\_redirect\_uri\` are read-only values returned by GET and must not be submitted in this request.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/idp":{"post":{"tags":["Integration"],"operationId":"updateTenantGenericIdPIntegration","summary":"Update tenant Generic IdP integration","description":"Update the current tenant Generic IdP integration settings. A valid OIDC or SAML configuration enables the integration. Deleting the integration disables it.\n\nRequired fields depend on the submitted protocol configuration and enabled capability. Saving `auth_config`, creating the integration or changing `auth_protocol` validates the complete resulting basic configuration even when SSO is disabled. Existing configuration can be partially updated by omitting unchanged properties. Explicitly submitting an empty, whitespace-only or null required non-secret field is rejected, not treated as an instruction to retain the old value. Secret fields retain the separate masked-update behavior described below.\n\n- For OIDC basic configuration or enabled OIDC SSO: `auth_config.issuer` and `auth_config.client_id` must be non-empty. `auth_config.auth_method` defaults to `client_secret_basic` when omitted, but explicit empty values are rejected. A stored or newly supplied `auth_config.client_secret` is required for `client_secret_basic` or `client_secret_post`; `auth_config.private_key` is required for `private_key_jwt`. An empty or masked Secret does not satisfy a first-time configuration without an existing stored credential.\n- For SAML basic configuration or enabled SAML SSO: `auth_config.client_id` and `auth_config.saml_metadata_source` are required. Source `metadata_url` requires `saml_metadata_url`; source `metadata_xml` requires `saml_metadata_xml`; source `manual` requires `issuer`, `saml_sso_url`, and `saml_signing_certificate`. Only the selected source is used; retained values for the other sources are ignored.\n- Generic IdP uses SCIM 2.0 for remote user lookup and user synchronization. `users.scim_base_url` is required before users can be listed, manually bound, or automatically synchronized. Explicit empty or whitespace-only `users.scim_base_url` values are rejected even in manual mode. Omit the property when synchronization is disabled and no SCIM directory is being configured.\n- `users.auth_method` selects the SCIM authentication settings used at runtime. `bearer_token` requires `users.scim_token`. `oauth2_client_credentials` requires `users.token_url`, `users.token_client_id`, and `users.token_client_secret`. Credentials retained for the inactive method are ignored.\n- Enabling automatic synchronization additionally requires `users.starting_extension_number` (3-13 ASCII digits). Disabled, completely unconfigured synchronization remains optional.\n- Attribute Mapping identifiers use their documented defaults when omitted. Explicit empty, whitespace-only or null `mapping_config.external_user_key.oidc_claim`, `saml_attribute` or `scim_attribute` values are rejected.\n- GET returns masked values for `auth_config.client_secret`, `auth_config.private_key`, `users.scim_token` and `users.token_client_secret`, never complete credentials. On POST, omitted, null, empty or masked values preserve stored credentials; a non-empty unmasked value replaces a credential. Empty strings do not clear credentials. Omitted non-secret properties also preserve their stored values.\n- `redirect_uri` and `sbc_redirect_uri` are read-only values returned by GET and must not be submitted in this request.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"auth_protocol":{"type":"string","enum":["oidc","saml"],"default":"oidc","description":"The SSO protocol used by the integration."},"auth_config":{"type":"object","description":"Protocol-specific SSO configuration. Shape depends on `auth_protocol`.\nUpdates submit the complete active protocol configuration. Secret properties may be omitted,\nnull, empty or masked to preserve their stored values; a non-empty unmasked secret replaces it.\n","oneOf":[{"type":"object","required":["issuer","client_id","auth_method"],"properties":{"issuer":{"type":"string","description":"Required for OIDC sign-in. PBX uses it for OIDC discovery."},"client_id":{"type":"string","description":"Required for OIDC sign-in."},"client_secret":{"type":["string","null"],"description":"Required for OIDC sign-in when `auth_method` is `client_secret_basic` or `client_secret_post`. GET returns a masked value, never the complete secret. Omitted, null, empty or masked values preserve the stored secret on update; a non-empty unmasked value replaces it."},"client_secret_configured":{"type":"boolean","readOnly":true},"auth_method":{"type":"string","enum":["client_secret_basic","client_secret_post","private_key_jwt"],"default":"client_secret_basic","description":"Required for OIDC sign-in. `client_secret_basic` sends credentials through HTTP Basic authentication; `client_secret_post` sends them as token request form parameters; `private_key_jwt` sends a signed client assertion. Defaults to `client_secret_basic` when omitted."},"private_key":{"type":["string","null"],"description":"Required for OIDC sign-in when `auth_method` is `private_key_jwt`. GET returns a masked value, never the complete private key. Omitted, null, empty or masked values preserve the stored key on update; a non-empty unmasked value replaces it."},"private_key_configured":{"type":"boolean","readOnly":true},"key_id":{"type":"string"},"use_pkce":{"type":"boolean","default":true,"description":"Enable PKCE (S256) for the OIDC Authorization Code Flow. Disable only when the identity provider does not support PKCE."}}},{"type":"object","required":["client_id","saml_metadata_source"],"allOf":[{"oneOf":[{"title":"Metadata URL","properties":{"saml_metadata_source":{"const":"metadata_url"},"saml_metadata_url":{"type":"string"}},"required":["saml_metadata_url"]},{"title":"Metadata XML","properties":{"saml_metadata_source":{"const":"metadata_xml"},"saml_metadata_xml":{"type":"string"}},"required":["saml_metadata_xml"]},{"title":"Manual SAML endpoints and certificate","properties":{"saml_metadata_source":{"const":"manual"},"issuer":{"type":"string"},"saml_sso_url":{"type":"string"},"saml_signing_certificate":{"type":"string"}},"required":["issuer","saml_sso_url","saml_signing_certificate"]}]}],"properties":{"issuer":{"type":"string","description":"The SAML IdP Entity ID. Required and used only when `saml_metadata_source` is `manual`; metadata supplies it in the other modes."},"client_id":{"type":"string","description":"Required for SAML sign-in. The PBX SAML service-provider (SP) Entity ID."},"saml_metadata_source":{"type":"string","enum":["metadata_url","metadata_xml","manual"],"default":"metadata_url","description":"Selects the only SAML configuration source used at runtime. `metadata_url` downloads IdP metadata,\n`metadata_xml` parses pasted IdP metadata, and `manual` uses `issuer`, `saml_sso_url`, and\n`saml_signing_certificate`. Values retained for inactive sources are ignored.\n"},"saml_sso_url":{"type":"string","description":"The IdP SSO endpoint URL. Required and used only when `saml_metadata_source` is `manual`."},"saml_metadata_url":{"type":"string","description":"Required and used only when `saml_metadata_source` is `metadata_url`. PBX downloads and parses the IdP metadata. Like every other outbound request of the Generic IdP integration (OIDC discovery/token/JWKS, SAML metadata, SCIM requests and their token endpoint), HTTPS requests skip TLS server certificate validation for private IdP compatibility, including chain, hostname and validity checks. This carries a man-in-the-middle risk; use only a trusted endpoint/network. SAML response signature validation remains enabled. The policy is limited to the Generic IdP integration and does not affect other outbound HTTPS connections such as Microsoft 365, Google, SMTP or S3."},"saml_metadata_xml":{"type":"string","description":"Required and used only when `saml_metadata_source` is `metadata_xml`. Paste the complete IdP metadata XML document."},"saml_signing_certificate":{"type":"string","description":"Required and used only when `saml_metadata_source` is `manual`. Accepts one PEM-encoded X.509 certificate or its Base64 DER content. PBX validates and normalizes it to Base64 DER. This is public certificate material and is returned by GET."},"saml_name_id_format":{"type":"string","default":"urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified","description":"SAML AuthnRequest NameID format. Defaults to `urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified` when omitted. Standard or IdP-specific URI values are accepted for compatibility."}}}]},"users":{"type":"object","description":"User synchronization settings for the Generic IdP SCIM 2.0 directory.\n`auth_method` explicitly selects the only authentication settings used at runtime. `bearer_token` sends the configured long-lived static token as-is; `oauth2_client_credentials` obtains short-lived access tokens from the configured token endpoint. Credentials retained for the inactive method are ignored.\nWhen `users.enabled` is true, `scim_base_url` and `starting_extension_number` are required and cannot be empty or whitespace-only. A configured SCIM directory also requires the fields for its selected authentication method. Disabled, completely unconfigured synchronization remains optional.\nUpdates submit the complete non-secret synchronization settings. GET returns masked `scim_token` and `token_client_secret` values. Omitted, null, empty or masked credential values preserve stored credentials; a non-empty unmasked value replaces a credential. Empty strings do not clear credentials.\n","properties":{"enabled":{"type":"boolean","default":false},"sync_time":{"type":"string","default":"0 0 * * *","description":"Optional cron expression. Defaults to `0 0 * * *`."},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The selection policy."},"selected":{"type":"array","items":{"type":"string"}},"starting_extension_number":{"type":"string","description":"Required for automatic synchronization. Must contain 3-13 ASCII digits. Empty or whitespace-only values are rejected when synchronization is enabled.","minLength":3,"maxLength":13,"pattern":"^[0-9]{3,13}$"},"scim_base_url":{"type":"string","description":"Required when user synchronization is enabled, and also required before SCIM users can be listed or manually bound. Explicit empty or whitespace-only values are rejected on save even when automatic synchronization is disabled. Omit this property when synchronization is disabled and the SCIM directory is not being configured."},"auth_method":{"type":"string","enum":["bearer_token","oauth2_client_credentials"],"default":"oauth2_client_credentials","description":"Required when a SCIM directory is configured. Selects the only SCIM authentication method used at runtime. Inactive credentials can remain stored but are ignored."},"scim_token":{"type":["string","null"],"description":"Required when `auth_method` is `bearer_token`. PBX sends this long-lived static token as-is and does not renew it. GET returns a masked value, never the complete token. Omitted, null, empty or masked values preserve the stored token; a non-empty unmasked value replaces it."},"scim_token_configured":{"type":"boolean","readOnly":true},"token_url":{"type":"string","description":"Required when `auth_method` is `oauth2_client_credentials`. PBX obtains short-lived SCIM access tokens from this OAuth2 token endpoint."},"token_client_id":{"type":"string","description":"Required when `auth_method` is `oauth2_client_credentials`. OAuth2 client ID used at the token endpoint."},"token_client_secret":{"type":["string","null"],"description":"Required when `auth_method` is `oauth2_client_credentials`. OAuth2 client secret sent to the token endpoint. GET returns a masked value, never the complete secret. Omitted, null, empty or masked values preserve the stored secret; a non-empty unmasked value replaces it."},"token_client_secret_configured":{"type":"boolean","readOnly":true}}},"sign_in_as_standard_user":{"type":"object","description":"Standard user SSO settings. The selected user list contains local PBX user IDs; PBX converts them to IdP account IDs when validating sign-in.\nWhen `enabled` is true, the selected `auth_protocol` must have a valid `auth_config`.\n","properties":{"enabled":{"type":"boolean","default":false},"sync_type":{"type":"string","enum":["ALL","INCLUDE","EXCLUDE"],"default":"ALL","description":"The selection policy."},"selected_users":{"type":"array","items":{"type":"string"}}}},"mapping_config":{"type":"object","description":"Stable external user-key mapping. The configured OIDC or SAML key must identify the same remote user as the SCIM key.\nA configured OIDC claim or SAML attribute is strict: sign-in fails when that value is absent and does not fall back to `sub` or `NameID`.\nNon-empty mapped SCIM identifiers must be unique within the remote directory; duplicate identifiers reject directory lookup and synchronization.\n","properties":{"external_user_key":{"type":"object","description":"Stable remote key used by PBX user bindings. Configure the OIDC or SAML value to equal the SCIM value for the same person.","properties":{"oidc_claim":{"type":"string","default":"sub","description":"OIDC claim used as the stable external user key."},"saml_attribute":{"type":"string","default":"NameID","description":"SAML NameID or assertion attribute used as the stable external user key."},"scim_attribute":{"type":"string","default":"id","description":"SCIM user attribute used as the stable external user key for automatic sync and manual binding."}}}}}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Retrieve Generic IdP users

> Retrieve the remote user directory of the configured Generic IdP. Each item's \`id\` is the IdP user identifier used for manual binding and for selecting the automatic sync scope.\
> Response items contain only remote directory data; they do not report local PBX binding status.\
> The request fails when multiple remote users produce the same non-empty mapped identifier.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/idp/users":{"get":{"tags":["Integration"],"operationId":"listGenericIdPUsers","summary":"Retrieve Generic IdP users","description":"Retrieve the remote user directory of the configured Generic IdP. Each item's `id` is the IdP user identifier used for manual binding and for selecting the automatic sync scope.\nResponse items contain only remote directory data; they do not report local PBX binding status.\nThe request fails when multiple remote users produce the same non-empty mapped identifier.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64"},"items":{"type":"array","items":{"type":"object","description":"A remote user returned by the Generic IdP integration.\nUsers whose identifier cannot be derived from `mapping_config` are not returned.\nIf two remote users produce the same non-empty mapped identifier, the directory request fails instead of choosing either user.\n","properties":{"id":{"type":"string","description":"The user's unique identifier in this Generic IdP integration, derived from `mapping_config.external_user_key`\n(it equals the OIDC/SAML sign-in subject and the `provider_id` of a bound account; it is not the SCIM resource ID).\nUse it as `provider_id` when manually binding a PBX user, as the sync scope value, and when requesting user details.\n"},"name":{"type":"string"},"email":{"type":"string"},"user_name":{"type":"string"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get Generic IdP user details

> Get detailed information about a specific Generic IdP user, addressed by the \`id\` returned by \`GET /idp/users\`.\
> The response contains only remote directory data; it does not report local PBX binding status.\
> The request fails when the remote directory contains duplicate non-empty mapped identifiers.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/idp/users/details/{id}":{"get":{"tags":["Integration"],"operationId":"getGenericIdPUserDetails","summary":"Get Generic IdP user details","description":"Get detailed information about a specific Generic IdP user, addressed by the `id` returned by `GET /idp/users`.\nThe response contains only remote directory data; it does not report local PBX binding status.\nThe request fails when the remote directory contains duplicate non-empty mapped identifiers.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The Generic IdP user identifier (`id` returned by `GET /idp/users`).\n"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"A remote user returned by the Generic IdP integration.\nUsers whose identifier cannot be derived from `mapping_config` are not returned.\nIf two remote users produce the same non-empty mapped identifier, the directory request fails instead of choosing either user.\n","properties":{"id":{"type":"string","description":"The user's unique identifier in this Generic IdP integration, derived from `mapping_config.external_user_key`\n(it equals the OIDC/SAML sign-in subject and the `provider_id` of a bound account; it is not the SCIM resource ID).\nUse it as `provider_id` when manually binding a PBX user, as the sync scope value, and when requesting user details.\n"},"name":{"type":"string"},"email":{"type":"string"},"user_name":{"type":"string"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Bulk get Generic IdP users

> Bulk get Generic IdP user details by the user identifiers (\`id\` returned by \`GET /idp/users\`).\
> Identifiers that do not match a remote user are omitted from the response.\
> The request fails when the remote directory contains duplicate non-empty mapped identifiers.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/idp/users/get_many":{"post":{"tags":["Integration"],"operationId":"bulkGetGenericIdPUsers","summary":"Bulk get Generic IdP users","description":"Bulk get Generic IdP user details by the user identifiers (`id` returned by `GET /idp/users`).\nIdentifiers that do not match a remote user are omitted from the response.\nThe request fails when the remote directory contains duplicate non-empty mapped identifiers.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":0,"description":"The Generic IdP user identifiers (`id` returned by `GET /idp/users`).\n"}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64"},"items":{"type":"array","items":{"type":"object","description":"A remote user returned by the Generic IdP integration.\nUsers whose identifier cannot be derived from `mapping_config` are not returned.\nIf two remote users produce the same non-empty mapped identifier, the directory request fails instead of choosing either user.\n","properties":{"id":{"type":"string","description":"The user's unique identifier in this Generic IdP integration, derived from `mapping_config.external_user_key`\n(it equals the OIDC/SAML sign-in subject and the `provider_id` of a bound account; it is not the SCIM resource ID).\nUse it as `provider_id` when manually binding a PBX user, as the sync scope value, and when requesting user details.\n"},"name":{"type":"string"},"email":{"type":"string"},"user_name":{"type":"string"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Delete tenant Generic IdP integration

> Delete the current tenant Generic IdP integration settings. After deletion, Generic IdP SSO and user synchronization are disabled for this tenant, and users imported by synchronization are converted back to local accounts.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/idp/destroy":{"post":{"tags":["Integration"],"operationId":"deleteTenantGenericIdPIntegration","summary":"Delete tenant Generic IdP integration","description":"Delete the current tenant Generic IdP integration settings. After deletion, Generic IdP SSO and user synchronization are disabled for this tenant, and users imported by synchronization are converted back to local accounts.\n","responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Get CRM integration

> Retrieve details of tenant CRM integration configurations.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm":{"get":{"tags":["Integration"],"operationId":"getCRMIntegration","summary":"Get CRM integration","description":"Retrieve details of tenant CRM integration configurations.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","description":"The CRM provider.   \nSuch as zoho, hubspot.\n"},"opts":{"oneOf":[{"type":"object","title":"Zoho application","properties":{"client_id":{"type":"string","description":"The client ID of integrated Zoho application.\n"},"client_secret":{"type":"string","description":"The client secret of integrated Zoho application.\n"},"region":{"type":"string","description":"The data centers of Zoho.   \nCan be either:   \n - `United States`\n - `Europe`\n - `India`\n - `Australia`\n - `Japan`\n - `Canada`\n - `Saudi Arabia`\n"},"enable_create_contact":{"type":"boolean","default":true,"description":"When enabled, users can create new contacts into CRM from client.\n"},"contact_created_as":{"type":"string","enum":["Contact","Lead"],"default":"Contact","description":"The type of new created contacts.   \nCan be either:\n - `Contact`\n - `Lead`\n"},"contact_lookup_order":{"type":"array","items":{"type":"string","enum":["Contacts","Leads","Accounts"]},"default":["Contacts","Leads","Accounts"],"description":"The lookup order expressed as an array.   \nThe array elements must be `Contacts`, `Leads`, `Accounts`, Duplicates are not allowed.\n"},"contact_lookup_condition":{"type":"string","enum":["Always","NotFoundLocally"],"default":"Always","description":"The lookup condition.   \nCan be either:   \n- `Always`: Always query from CRM.\n- `NotFoundLocally`: Query PBX contacts first, then CRM when not found.\n"},"enable_call_logging":{"type":"boolean","default":false,"description":"When enabled, a Zoho call activity will automatically be created for each call.\n"},"enable_call_recording_logging":{"type":"boolean","default":false,"description":"When enabled, a link to the user's call recording would be posted to the Zoho activity.\n"},"secure_call_recording_logging":{"type":"boolean","default":false,"description":"When enabled, a secure url instead of public access url to the user's call recording would be posted to the Zoho activity.\n"},"redirect_url":{"type":"string","readOnly":true,"description":"The callback URL (also known as redirect URI) In OAuth 2.0.   \nIt is the URL in your application where the authorization server redirects the user after they have granted or denied access to their data.   \nIt's crucial for security and must be pre-registered with the authorization server.\n"},"sbc_redirect_url":{"type":"string","readOnly":true,"description":"The callback URL like `redirect_url` but under SBC network topology.\n"},"auth_url":{"type":"string","readOnly":true,"description":"The authorization URL of Zoho authorization server.\n"},"refresh_token":{"type":"string","readOnly":true,"description":"The refresh token from Zoho authorization server.\n"}}},{"type":"object","title":"HubSpot application","properties":{"client_id":{"type":"string","description":"The client ID of integrated HubSpot application.\n"},"client_secret":{"type":"string","description":"The client secret of integrated HubSpot application.\n"},"enable_create_contact":{"type":"boolean","default":true,"description":"When enabled, users can create new contacts into CRM from client.\n"},"contact_lookup_order":{"type":"array","items":{"type":"string","enum":["Contacts","Companies"]},"default":["Contacts","Companies"],"description":"The lookup order expressed as an array.   \nThe array elements must be `Contacts`, `Companies`. Duplicates are not allowed.\n"},"contact_lookup_condition":{"type":"string","enum":["Always","NotFoundLocally"],"default":"Always","description":"The lookup condition.   \nCan be either:   \n- `Always`: Always query from CRM.\n- `NotFoundLocally`: Query PBX contacts first, then CRM when not found.\n"},"enable_call_logging":{"type":"boolean","default":false,"description":"Whether to automatically create HubSpot call activity for calls.\n"},"enable_call_recording_logging":{"type":"boolean","default":false,"description":"Whether to automatically create HubSpot call recording activity for calls.\n"},"secure_call_recording_logging":{"type":"boolean","default":true,"description":"When enabled, a secure url instead of public access url to the user's call recording would be posted to the HubSpot call recording activity.\n"},"redirect_url":{"type":"string","readOnly":true,"description":"The callback URL (also known as redirect URI) In OAuth 2.0.   \nIt is the URL in your application where the authorization server redirects the user after they have granted or denied access to their data.   \nIt's crucial for security and must be pre-registered with the authorization server.\n"},"sbc_redirect_url":{"type":"string","readOnly":true,"description":"The callback URL like `redirect_url` but under SBC network topology.\n"}}},{"type":"object","title":"Odoo application","properties":{"base_url":{"type":"string","description":"The domain name of the database where Odoo is installed.\n"},"database":{"type":"string","description":"The database name of the database where Odoo CRM is installed.\n"},"username":{"type":"string","description":"The login email address of the Odoo administrator account.\n"},"api_key":{"type":"string","description":"The API key of integrated Odoo application.\n"},"enable_create_contact":{"type":"boolean","default":true,"description":"When enabled, users can create new contacts into CRM from client.\n"},"contact_created_as":{"type":"string","enum":["Individual","Lead"],"default":"Individual","description":"The type of new created contacts.   \nCan be either:\n - `Individual`\n - `Lead`\n"},"contact_lookup_order":{"type":"array","items":{"type":"string","enum":["Individuals","Leads","Companies"]},"default":["Individuals","Leads","Companies"],"description":"The lookup order expressed as an array.   \nThe array elements must be `Individuals`, `Leads`, `Companies`, Duplicates are not allowed.\n"},"contact_lookup_condition":{"type":"string","enum":["Always","NotFoundLocally"],"default":"Always","description":"The lookup condition.   \nCan be either:   \n- `Always`: Always query from CRM.\n- `NotFoundLocally`: Query PBX contacts first, then CRM when not found.\n"},"enable_call_logging":{"type":"boolean","default":false,"description":"When enabled, a Odoo call activity will automatically be created for each call.\n"},"enable_call_recording_logging":{"type":"boolean","default":false,"description":"When enabled, a link to the user's call recording would be posted to the Odoo activity.\n"},"secure_call_recording_logging":{"type":"boolean","default":false,"description":"When enabled, a secure url instead of public access url to the user's call recording would be posted to the Odoo activity.\n"}}}],"type":"object"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update CRM integration

> Update tenant CRM integration configurations.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm":{"post":{"tags":["Integration"],"operationId":"updateCRMIntegration","summary":"Update CRM integration","description":"Update tenant CRM integration configurations.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","description":"The CRM provider.   \nSuch as zoho, hubspot.\n"},"opts":{"oneOf":[{"type":"object","title":"Zoho application","properties":{"client_id":{"type":"string","description":"The client ID of integrated Zoho application.\n"},"client_secret":{"type":"string","description":"The client secret of integrated Zoho application.\n"},"region":{"type":"string","description":"The data centers of Zoho.   \nCan be either:   \n - `United States`\n - `Europe`\n - `India`\n - `Australia`\n - `Japan`\n - `Canada`\n - `Saudi Arabia`\n"},"enable_create_contact":{"type":"boolean","default":true,"description":"When enabled, users can create new contacts into CRM from client.\n"},"contact_created_as":{"type":"string","enum":["Contact","Lead"],"default":"Contact","description":"The type of new created contacts.   \nCan be either:\n - `Contact`\n - `Lead`\n"},"contact_lookup_order":{"type":"array","items":{"type":"string","enum":["Contacts","Leads","Accounts"]},"default":["Contacts","Leads","Accounts"],"description":"The lookup order expressed as an array.   \nThe array elements must be `Contacts`, `Leads`, `Accounts`, Duplicates are not allowed.\n"},"contact_lookup_condition":{"type":"string","enum":["Always","NotFoundLocally"],"default":"Always","description":"The lookup condition.   \nCan be either:   \n- `Always`: Always query from CRM.\n- `NotFoundLocally`: Query PBX contacts first, then CRM when not found.\n"},"enable_call_logging":{"type":"boolean","default":false,"description":"When enabled, a Zoho call activity will automatically be created for each call.\n"},"enable_call_recording_logging":{"type":"boolean","default":false,"description":"When enabled, a link to the user's call recording would be posted to the Zoho activity.\n"},"secure_call_recording_logging":{"type":"boolean","default":false,"description":"When enabled, a secure url instead of public access url to the user's call recording would be posted to the Zoho activity.\n"},"redirect_url":{"type":"string","readOnly":true,"description":"The callback URL (also known as redirect URI) In OAuth 2.0.   \nIt is the URL in your application where the authorization server redirects the user after they have granted or denied access to their data.   \nIt's crucial for security and must be pre-registered with the authorization server.\n"},"sbc_redirect_url":{"type":"string","readOnly":true,"description":"The callback URL like `redirect_url` but under SBC network topology.\n"},"auth_url":{"type":"string","readOnly":true,"description":"The authorization URL of Zoho authorization server.\n"},"refresh_token":{"type":"string","readOnly":true,"description":"The refresh token from Zoho authorization server.\n"}}},{"type":"object","title":"HubSpot application","properties":{"client_id":{"type":"string","description":"The client ID of integrated HubSpot application.\n"},"client_secret":{"type":"string","description":"The client secret of integrated HubSpot application.\n"},"enable_create_contact":{"type":"boolean","default":true,"description":"When enabled, users can create new contacts into CRM from client.\n"},"contact_lookup_order":{"type":"array","items":{"type":"string","enum":["Contacts","Companies"]},"default":["Contacts","Companies"],"description":"The lookup order expressed as an array.   \nThe array elements must be `Contacts`, `Companies`. Duplicates are not allowed.\n"},"contact_lookup_condition":{"type":"string","enum":["Always","NotFoundLocally"],"default":"Always","description":"The lookup condition.   \nCan be either:   \n- `Always`: Always query from CRM.\n- `NotFoundLocally`: Query PBX contacts first, then CRM when not found.\n"},"enable_call_logging":{"type":"boolean","default":false,"description":"Whether to automatically create HubSpot call activity for calls.\n"},"enable_call_recording_logging":{"type":"boolean","default":false,"description":"Whether to automatically create HubSpot call recording activity for calls.\n"},"secure_call_recording_logging":{"type":"boolean","default":true,"description":"When enabled, a secure url instead of public access url to the user's call recording would be posted to the HubSpot call recording activity.\n"},"redirect_url":{"type":"string","readOnly":true,"description":"The callback URL (also known as redirect URI) In OAuth 2.0.   \nIt is the URL in your application where the authorization server redirects the user after they have granted or denied access to their data.   \nIt's crucial for security and must be pre-registered with the authorization server.\n"},"sbc_redirect_url":{"type":"string","readOnly":true,"description":"The callback URL like `redirect_url` but under SBC network topology.\n"}}},{"type":"object","title":"Odoo application","properties":{"base_url":{"type":"string","description":"The domain name of the database where Odoo is installed.\n"},"database":{"type":"string","description":"The database name of the database where Odoo CRM is installed.\n"},"username":{"type":"string","description":"The login email address of the Odoo administrator account.\n"},"api_key":{"type":"string","description":"The API key of integrated Odoo application.\n"},"enable_create_contact":{"type":"boolean","default":true,"description":"When enabled, users can create new contacts into CRM from client.\n"},"contact_created_as":{"type":"string","enum":["Individual","Lead"],"default":"Individual","description":"The type of new created contacts.   \nCan be either:\n - `Individual`\n - `Lead`\n"},"contact_lookup_order":{"type":"array","items":{"type":"string","enum":["Individuals","Leads","Companies"]},"default":["Individuals","Leads","Companies"],"description":"The lookup order expressed as an array.   \nThe array elements must be `Individuals`, `Leads`, `Companies`, Duplicates are not allowed.\n"},"contact_lookup_condition":{"type":"string","enum":["Always","NotFoundLocally"],"default":"Always","description":"The lookup condition.   \nCan be either:   \n- `Always`: Always query from CRM.\n- `NotFoundLocally`: Query PBX contacts first, then CRM when not found.\n"},"enable_call_logging":{"type":"boolean","default":false,"description":"When enabled, a Odoo call activity will automatically be created for each call.\n"},"enable_call_recording_logging":{"type":"boolean","default":false,"description":"When enabled, a link to the user's call recording would be posted to the Odoo activity.\n"},"secure_call_recording_logging":{"type":"boolean","default":false,"description":"When enabled, a secure url instead of public access url to the user's call recording would be posted to the Odoo activity.\n"}}}],"type":"object"}},"required":["provider","opts"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## List available providers

> Retrieve all of available providers.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/providers":{"get":{"tags":["Integration"],"operationId":"listCrmIntegrationAvailableProviders","summary":"List available providers","description":"Retrieve all of available providers.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","description":"The CRM provider.   \nSuch as zoho, hubspot.\n"},"redirect_url":{"type":"string","readOnly":true,"description":"The callback URL (also known as redirect URI) In OAuth 2.0.   \nIt is the URL in your application where the authorization server redirects the user after they have granted or denied access to their data.   \nIt's crucial for security and must be pre-registered with the authorization server.\n"},"sbc_redirect_url":{"type":"string","readOnly":true,"description":"The callback URL like `redirect_url` but under SBC network topology.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get CRM provider information.

> Retrieve CRM provider information by name.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/providers/{provider}":{"get":{"tags":["Integration"],"operationId":"getCrmIntegrationAvailableProvider","summary":"Get CRM provider information.","description":"Retrieve CRM provider information by name.\n","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","description":"The CRM provider.   \nSuch as zoho, hubspot.\n"},"description":"The provider name of the CRM provider."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string"}}}},"4XX":{"description":"Error"}}}}}}
```

## Test integration

> Try to search contacts in CRM integration.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/test":{"post":{"tags":["Integration"],"operationId":"testCRMIntegration","summary":"Test integration","description":"Try to search contacts in CRM integration.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"}},"required":["number"]}}}},"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 contact.\n"},"first_name":{"type":"string","minLength":1,"maxLength":64,"description":"The first name of contact.\n"},"last_name":{"type":"string","minLength":1,"maxLength":64,"description":"The last name of contact.\n"},"email":{"type":"string","maxLength":128,"description":"The email of contact.\n"},"company":{"type":"string","maxLength":128,"description":"The company name of contact.\n"},"title":{"type":"string","maxLength":128,"description":"The title of contact.\n"},"did_number":{"type":"string","description":"The DID/DDI number.\n"},"business":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"},"business2":{"type":"string","maxLength":128,"description":"The secondary business phone number of contact.\n"},"mobile_phone":{"type":"string","maxLength":128,"description":"The mobile phone number of contact.\n"},"mobile_phone2":{"type":"string","maxLength":128,"description":"The secondary mobile phone number of contact.\n"},"home_phone":{"type":"string","maxLength":128,"description":"The home phone number of contact.\n"},"home_phone2":{"type":"string","maxLength":128,"description":"The secondary home phone number of contact.\n"},"other":{"type":"string","maxLength":128,"description":"The other phone number of contact.\n"},"business_fax":{"type":"string","maxLength":128,"description":"The business fax of contact.\n"},"home_fax":{"type":"string","maxLength":128,"description":"The home fax of contact.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"notes":{"type":"string","maxLength":1024,"description":"The notes of contact.\n"},"type":{"type":"string","description":"The type of contact.\n"},"url":{"type":"string","description":"The access URL of contact.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## List contacts

> Retrieve a collection of CRM contacts.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts":{"get":{"tags":["Integration"],"operationId":"listCRMContacts","summary":"List contacts","description":"Retrieve a collection of CRM contacts.\n","parameters":[{"name":"filter","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `filter` query parameter to retrieve just a subset of a collection.\n"},{"name":"search","in":"query","required":false,"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","required":false,"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","required":false,"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","required":false,"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 contact.\n"},"first_name":{"type":"string","minLength":1,"maxLength":64,"description":"The first name of contact.\n"},"last_name":{"type":"string","minLength":1,"maxLength":64,"description":"The last name of contact.\n"},"email":{"type":"string","maxLength":128,"description":"The email of contact.\n"},"company":{"type":"string","maxLength":128,"description":"The company name of contact.\n"},"title":{"type":"string","maxLength":128,"description":"The title of contact.\n"},"business":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"},"business2":{"type":"string","maxLength":128,"description":"The secondary business phone number of contact.\n"},"mobile_phone":{"type":"string","maxLength":128,"description":"The mobile phone number of contact.\n"},"mobile_phone2":{"type":"string","maxLength":128,"description":"The secondary mobile phone number of contact.\n"},"home_phone":{"type":"string","maxLength":128,"description":"The home phone number of contact.\n"},"home_phone2":{"type":"string","maxLength":128,"description":"The secondary home phone number of contact.\n"},"other":{"type":"string","maxLength":128,"description":"The other phone number of contact.\n"},"business_fax":{"type":"string","maxLength":128,"description":"The business fax of contact.\n"},"home_fax":{"type":"string","maxLength":128,"description":"The home fax of contact.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"notes":{"type":"string","maxLength":1024,"description":"The notes of contact.\n"},"did_number":{"type":"string","description":"The DID/DDI number.\n"},"type":{"type":"string","description":"The type of contact.\n"},"url":{"type":"string","description":"The access URL of contact.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Create a contact

> Create a contact into specified CRM integration.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts":{"post":{"tags":["Integration"],"operationId":"createCRMContact","summary":"Create a contact","description":"Create a contact into specified CRM integration.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string","minLength":1,"maxLength":64,"description":"The first name of contact.\n"},"last_name":{"type":"string","minLength":1,"maxLength":64,"description":"The last name of contact.\n"},"email":{"type":"string","maxLength":128,"description":"The email of contact.\n"},"company":{"type":"string","maxLength":128,"description":"The company name of contact.\n"},"title":{"type":"string","maxLength":128,"description":"The title of contact.\n"},"business":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"},"business2":{"type":"string","maxLength":128,"description":"The secondary business phone number of contact.\n"},"mobile_phone":{"type":"string","maxLength":128,"description":"The mobile phone number of contact.\n"},"mobile_phone2":{"type":"string","maxLength":128,"description":"The secondary mobile phone number of contact.\n"},"home_phone":{"type":"string","maxLength":128,"description":"The home phone number of contact.\n"},"home_phone2":{"type":"string","maxLength":128,"description":"The secondary home phone number of contact.\n"},"other":{"type":"string","maxLength":128,"description":"The other phone number of contact.\n"},"business_fax":{"type":"string","maxLength":128,"description":"The business fax of contact.\n"},"home_fax":{"type":"string","maxLength":128,"description":"The home fax of contact.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"notes":{"type":"string","maxLength":1024,"description":"The notes of contact.\n"},"did_number":{"type":"string","description":"The DID/DDI number.\n"}},"required":["last_name","did_number"]}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string"}],"description":"The unique ID of contact.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Search contacts

> Search CRM contacts with specified conditions in CRM integration.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/search":{"post":{"tags":["Integration"],"operationId":"searchCRMContacts","summary":"Search contacts","description":"Search CRM contacts with specified conditions in CRM integration.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"}},"required":["number"]}}}},"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 contact.\n"},"first_name":{"type":"string","minLength":1,"maxLength":64,"description":"The first name of contact.\n"},"last_name":{"type":"string","minLength":1,"maxLength":64,"description":"The last name of contact.\n"},"email":{"type":"string","maxLength":128,"description":"The email of contact.\n"},"company":{"type":"string","maxLength":128,"description":"The company name of contact.\n"},"title":{"type":"string","maxLength":128,"description":"The title of contact.\n"},"did_number":{"type":"string","description":"The DID/DDI number.\n"},"business":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"},"business2":{"type":"string","maxLength":128,"description":"The secondary business phone number of contact.\n"},"mobile_phone":{"type":"string","maxLength":128,"description":"The mobile phone number of contact.\n"},"mobile_phone2":{"type":"string","maxLength":128,"description":"The secondary mobile phone number of contact.\n"},"home_phone":{"type":"string","maxLength":128,"description":"The home phone number of contact.\n"},"home_phone2":{"type":"string","maxLength":128,"description":"The secondary home phone number of contact.\n"},"other":{"type":"string","maxLength":128,"description":"The other phone number of contact.\n"},"business_fax":{"type":"string","maxLength":128,"description":"The business fax of contact.\n"},"home_fax":{"type":"string","maxLength":128,"description":"The home fax of contact.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"notes":{"type":"string","maxLength":1024,"description":"The notes of contact.\n"},"type":{"type":"string","description":"The type of contact.\n"},"url":{"type":"string","description":"The access URL of contact.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get a CRM contact

> Retrieve CRM contact details by it's ID.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/{id}":{"get":{"tags":["Integration"],"operationId":"getCRMContact","summary":"Get a CRM contact","description":"Retrieve CRM contact details by it's ID.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of contact.\n"},"description":"The unique ID of the contact."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string"}],"description":"The unique ID of contact.\n"},"first_name":{"type":"string","minLength":1,"maxLength":64,"description":"The first name of contact.\n"},"last_name":{"type":"string","minLength":1,"maxLength":64,"description":"The last name of contact.\n"},"email":{"type":"string","maxLength":128,"description":"The email of contact.\n"},"company":{"type":"string","maxLength":128,"description":"The company name of contact.\n"},"title":{"type":"string","maxLength":128,"description":"The title of contact.\n"},"did_number":{"type":"string","description":"The DID/DDI number.\n"},"business":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"},"business2":{"type":"string","maxLength":128,"description":"The secondary business phone number of contact.\n"},"mobile_phone":{"type":"string","maxLength":128,"description":"The mobile phone number of contact.\n"},"mobile_phone2":{"type":"string","maxLength":128,"description":"The secondary mobile phone number of contact.\n"},"home_phone":{"type":"string","maxLength":128,"description":"The home phone number of contact.\n"},"home_phone2":{"type":"string","maxLength":128,"description":"The secondary home phone number of contact.\n"},"other":{"type":"string","maxLength":128,"description":"The other phone number of contact.\n"},"business_fax":{"type":"string","maxLength":128,"description":"The business fax of contact.\n"},"home_fax":{"type":"string","maxLength":128,"description":"The home fax of contact.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"notes":{"type":"string","maxLength":1024,"description":"The notes of contact.\n"},"type":{"type":"string","description":"The type of contact.\n"},"url":{"type":"string","description":"The access URL of contact.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update a CRM contact

> Update a CRM contact.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/{id}":{"post":{"tags":["Integration"],"operationId":"updateCRMContact","summary":"Update a CRM contact","description":"Update a CRM contact.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of contact.\n"},"description":"The unique ID of the contact."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string","minLength":1,"maxLength":64,"description":"The first name of contact.\n"},"last_name":{"type":"string","minLength":1,"maxLength":64,"description":"The last name of contact.\n"},"email":{"type":"string","maxLength":128,"description":"The email of contact.\n"},"company":{"type":"string","maxLength":128,"description":"The company name of contact.\n"},"title":{"type":"string","maxLength":128,"description":"The title of contact.\n"},"did_number":{"type":"string","description":"The DID/DDI number.\n"},"business":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"},"business2":{"type":"string","maxLength":128,"description":"The secondary business phone number of contact.\n"},"mobile_phone":{"type":"string","maxLength":128,"description":"The mobile phone number of contact.\n"},"mobile_phone2":{"type":"string","maxLength":128,"description":"The secondary mobile phone number of contact.\n"},"home_phone":{"type":"string","maxLength":128,"description":"The home phone number of contact.\n"},"home_phone2":{"type":"string","maxLength":128,"description":"The secondary home phone number of contact.\n"},"other":{"type":"string","maxLength":128,"description":"The other phone number of contact.\n"},"business_fax":{"type":"string","maxLength":128,"description":"The business fax of contact.\n"},"home_fax":{"type":"string","maxLength":128,"description":"The home fax of contact.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"notes":{"type":"string","maxLength":1024,"description":"The notes of contact.\n"}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Delete a CRM contact

> Remove CRM contact by it's ID.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/{id}/destroy":{"post":{"tags":["Integration"],"operationId":"deleteCRMContact","summary":"Delete a CRM contact","description":"Remove CRM contact by it's ID.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of contact.\n"},"description":"The unique ID of the contact."}],"responses":{"202":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```

## List contact notes

> List a collection of CRM contact notes.

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/{id}/notes":{"get":{"tags":["Integration"],"operationId":"listContactNotes","summary":"List contact notes","description":"List a collection of CRM contact notes.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The unique ID of the CRM contact."}],"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":{"type":"string"},"title":{"type":"string","description":"The title of CRM record note.\n"},"content":{"type":"string","description":"The content of CRM record note.\n"},"created_at":{"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"},"updated_at":{"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"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Create CRM contact note

> Create CRM contact note.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/{id}/notes":{"post":{"tags":["Integration"],"operationId":"createCRMContactNote","summary":"Create CRM contact note","description":"Create CRM contact note.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of contact.\n"},"description":"The unique ID of the contact."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"The title of CRM record note.\n"},"content":{"type":"string","description":"The content of CRM record note.\n"}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get contact note

> Get CRM contact note.

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/{id}/notes/{note_id}":{"get":{"tags":["Integration"],"operationId":"getContactNote","summary":"Get contact note","description":"Get CRM contact note.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The unique ID of the CRM contact."},{"name":"note_id","in":"path","required":true,"schema":{"type":"string"},"description":"The unique ID of the CRM note."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","description":"The title of CRM record note.\n"},"content":{"type":"string","description":"The content of CRM record note.\n"},"created_at":{"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"},"updated_at":{"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"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update CRM contact note

> Update CRM contact note.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/{id}/notes/{note_id}":{"post":{"tags":["Integration"],"operationId":"updateCRMContactNote","summary":"Update CRM contact note","description":"Update CRM contact note.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The unique ID of the contact."},{"name":"note_id","in":"path","required":true,"schema":{"type":"string"},"description":"The unique ID of the CRM note."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"The title of CRM record note.\n"},"content":{"type":"string","description":"The content of CRM record note.\n"}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Delete CRM contact note

> Delete CRM contact note.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/{id}/notes/{note_id}/destroy":{"post":{"tags":["Integration"],"operationId":"deleteCRMContactNote","summary":"Delete CRM contact note","description":"Delete CRM contact note.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The unique ID of the contact."},{"name":"note_id","in":"path","required":true,"schema":{"type":"string"},"description":"The unique ID of the CRM note."}],"responses":{"204":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## List calls

> List calls from CRM integration.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/{id}/calls":{"get":{"tags":["Integration"],"operationId":"listCRMCalls","summary":"List calls","description":"List calls from CRM integration.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of contact.\n"},"description":"The unique ID of the contact."},{"name":"filter","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `filter` query parameter to retrieve just a subset of a collection.\n"},{"name":"search","in":"query","required":false,"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","required":false,"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","required":false,"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","required":false,"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"},{"name":"count","in":"query","required":false,"schema":{"type":"boolean","default":false},"description":"Use the $count=true query option to include a count of entities that match the filter criteria.\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":{"properties":{"id":{"allOf":[{"type":"string"}],"description":"The unique ID of CRM call.\n"},"caller":{"type":"string","maxLength":256,"description":"The caller number of the call.\n"},"caller_display_name":{"type":"string","maxLength":1024,"description":"The caller display name of the call.\n"},"callee":{"type":"string","maxLength":256,"description":"The callee number of the call.\n"},"callee_display_name":{"type":"string","maxLength":1024,"description":"The callee display name of the call.\n"},"started_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 start time of the call.\n"},"rang_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 ringing time of the call.\n"},"answered_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 answer time of the call.\n"},"ended_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 end time of the call.\n"},"direction":{"type":"string","enum":["INBOUND_CALL","OUTBOUND_CALL"],"description":"The direction of CDR:\n- `INBOUND_CALL`:\n- `OUTBOUND_CALL`:\n"},"duration":{"type":"integer","format":"int32","description":"The total talk time for a session (in seconds).\n"},"summary":{"type":"string","description":"The summary of CRM call.\n"},"transcription":{"type":"string","description":"The transcription of CRM call.\n"},"recording":{"type":"string","description":"The recording of CRM call.\n"}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Get call

> Get call from CRM integration.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/{id}/calls/{call_id}":{"get":{"tags":["Integration"],"operationId":"getCRMCall","summary":"Get call","description":"Get call from CRM integration.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of contact.\n"},"description":"The unique ID of the contact."},{"name":"call_id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of CRM call.\n"},"description":"The unique ID of the CRM call."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string"}],"description":"The unique ID of CRM call.\n"},"caller":{"type":"string","maxLength":256,"description":"The caller number of the call.\n"},"caller_display_name":{"type":"string","maxLength":1024,"description":"The caller display name of the call.\n"},"callee":{"type":"string","maxLength":256,"description":"The callee number of the call.\n"},"callee_display_name":{"type":"string","maxLength":1024,"description":"The callee display name of the call.\n"},"started_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 start time of the call.\n"},"rang_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 ringing time of the call.\n"},"answered_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 answer time of the call.\n"},"ended_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 end time of the call.\n"},"direction":{"type":"string","enum":["INBOUND_CALL","OUTBOUND_CALL"],"description":"The direction of CDR:\n- `INBOUND_CALL`:\n- `OUTBOUND_CALL`:\n"},"duration":{"type":"integer","format":"int32","description":"The total talk time for a session (in seconds).\n"},"summary":{"type":"string","description":"The summary of CRM call.\n"},"transcription":{"type":"string","description":"The transcription of CRM call.\n"},"recording":{"type":"string","description":"The recording of CRM call.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update call

> Update CRM call summary.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[{"name":"Integration","description":"Manage integrations.\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":{"/crm/contacts/{id}/calls/{call_id}":{"post":{"tags":["Integration"],"operationId":"updateCRMCall","summary":"Update call","description":"Update CRM call summary.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of contact.\n"},"description":"The unique ID of the contact."},{"name":"call_id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of CRM call.\n"},"description":"The unique ID of the CRM call."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"string","description":"The summary of CRM call.\n"}},"required":["summary"]}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```
