---
title: "Common API Methods"
slug: "common-api-methods"
updated: 2026-04-02T16:25:52Z
published: 2026-04-02T16:25:52Z
canonical: "kb.connecttoteams.com/common-api-methods"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://kb.connecttoteams.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Common API Methods

## Configure Direct Routing

Doc: [/provisioning/provisionDirectRouting](/v1-api/apidocs/provisioningprovisiondirectrouting-1)

**API Endpoint**

Method: `POST`

Path: `/provisioning/provisionDirectRouting`

**Request Body (JSON) With Required Fields only**

```json
{
    "authenticationResult": {
        "authenticationResult": {
            "accessToken": "string",
            "accessTokenType": "string",
            "expiresAfter": 0,
            "expiresOn": 0,
            "expiresOnDate": "2025-03-07T12:46:35.173Z",
            "idToken": "string",
            "multipleResourceRefreshToken": true,
            "refreshToken": "string",
            "userInfo": {
                "displayableId": "string",
                "identityProvider": "string",
                "tenantId": "string"
            }
        }
    },
    "sbcGatewayId": 0
}
```

**Example cURL Command**

```json
curl --silent --location --request POST 'https://api.connecttoteams.com/provisioning/provisionDirectRouting' \
--header 'Authorization: Bearer eyJraWQiOiJlbbQo.....' \
--header 'Content-Type: application/json' \
--data-raw '{
    "authenticationResult": {
        "authenticationResult": {
            "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6Ikx6eFQyU.....",
        "accessTokenType": "login.microsoftonline.com",
        "expiresOn": 1743097299177667,
        "idToken": "eyJ0eXAiOiJKV1Q.....",
        "multipleResourceRefreshToken": false,
        "userInfo": {
            "displayableId": "<ent-admin-id>",
            "identityProvider": "user",
            "tenantId": "<tenant-id>"
            }
        }
    },
    "sbcGatewayId": 805
}'
```

**Response**

On success, the API returns

```json
200 OK
```

## Configure Unified App Settings for an Enterprise

The method described here pertains to the API method to configure the Unified app settings as depicted in this page from the Service Portal.

![](https://cdn.us.document360.io/312e5ae5-e3c1-465d-8e37-f253a7ba8eee/Images/Documentation/image-LVD0GH7P.png)

Doc: [/reseller/saveOrUpdateTeamsApplicationTemplate](/v1-api/apidocs/resellersaveorupdateteamsapplicationtemplate-1)

**API Endpoint**

Method: `POST`

Path: `/reseller/saveOrUpdateTeamsApplicationTemplate`

**Request Body (JSON)**

```json
{
  "enterpriseId": 12345,
  "resellerId": 67890,
  "name": "Sample Unified App",
  "bIconFileName": "branding_icon.png",
  "oIconFileName": "outline_icon.png",
  "portalURL": "https://portal.example.com",
  "ssoURL": "https://sso.example.com",
  "type": "UNIFIED",
  "callDialerTabName": "Dialer",
  "portalTabName": "PBX",
  "brandingImageInBytes": "Base64EncodedString",
  "outlineImageInBytes": "Base64EncodedString",
  "turnOffCard": false,
  "turnOffVMCard": true,
  "showCard": true,
  "showVMCard": false,
  "tenantID": "tenant-12345",
  "teamName": "Sample Team",
  "allowEnterpriseToOverride": true,
  "sendMessageNotificationOnZeroMessages": false,
  "tabOrder": [],
  "fcTabName": "Features",
  "accentColor": "#FF5733",
  "version": "1.0.0",
  "packageName": "com.example.app",
  "devName": "Example Devs",
  "privacyURL": "https://privacy.example.com",
  "termsURL": "https://terms.example.com",
  "shortName": "Example Comm",
  "fullName": "Example Communications App",
  "shortDesc": "A short description of the app",
  "fullDesc": "A detailed description of the app and its features",
  "showUtilityCard": true
}
```

## Configure PBX

This method is used to create or update a PBX Location of an Enterprise.

Doc: [/pbx/updatePBXSettingsForTenant](/v1-api/apidocs/pbxupdatepbxsettingsfortenant-1)

**API Endpoint**

Method: `POST` Path: `/pbx/updatePBXSettingsForTenant`

**Request Body (JSON)**

```json
{
    "codecs": [
        "G.711 A-law",
        "G.711 U-law"
    ],
    "dnsLookupType": "Host",
    "domainAliases": [],
    "pbxIdOrPBXLocationId": 7,
    "pbxLocationName": "broadworks",
    "pbxSIPDomain": "<pbx-sip-domain>",
    "pbxSIPDomainProxy": "",
    "pbxSIPDomainProxyPort": 5060,
    "presencePackageType": "call-info",
    "regExpiresValue": 600,
    "tenantID": "tenant-id",
    "transportType": "UDP",
    "update": false,
    "voicemailFeatureCode": "*62",
    "topologyHiding": false,
    "pbxCallPolicyInfo": {
        "callPolicyCNAM": "TRANSPARENT",
        "callPolicyName": "Global",
        "forwardedCallsCallerId": "USER_CALLER_ID"
    },
    "metaSwitchSubscriptionCompatibility": false,
    "sipWaitForAlegAck": true,
    "enforceCodecsOnInbound": false,
    "enableMWIEvents": false,
    "rejectMethod": "SIP 480",
    "rejectCalling": false,
    "rejectInterval": 0,
    "acceptsEncodedFeatureCode": false,
    "escapeRequestUri": false,
    "convertHistoryInfoToDiversion": false,
    "oldStyleHold": false
}
```

**Required Fields**

`tenantId`

`pbxSIPDomain`

`transportType`

`pbxSIPDomainProxy`

`voicemailFeatureCode`

`pbxLocationName`

`dnsLookupType`

`update`

`pbxIdOrPBXLocationId`

**Example cURL Command**

```json
curl --silent --location --request POST 'https://api.connecttoteams.com/pbx/updatePBXSettingsForTenant' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOiJlYTdiZm.....' \
--data-raw '{
    "codecs": [
        "G.711 A-law",
        "G.711 U-law"
    ],
    "dnsLookupType": "Host",
    "domainAliases": [],
    "pbxIdOrPBXLocationId": 7,
    "pbxLocationName": "broadworks",
    "pbxSIPDomain": "yahoo.com",
    "pbxSIPDomainProxy": "",
    "pbxSIPDomainProxyPort": 5060,
    "presencePackageType": "call-info",
    "regExpiresValue": 600,
    "tenantID": "5c0068f3-dfbb-4f4a",
    "transportType": "UDP",
    "update": false,
    "voicemailFeatureCode": "*62",
    "topologyHiding": false,
    "pbxCallPolicyInfo": {
        "callPolicyCNAM": "TRANSPARENT",
        "callPolicyName": "Global",
        "forwardedCallsCallerId": "USER_CALLER_ID"
    },
    "metaSwitchSubscriptionCompatibility": false,
    "sipWaitForAlegAck": true,
    "enforceCodecsOnInbound": false,
    "enableMWIEvents": false,
    "rejectMethod": "SIP 480",
    "rejectCalling": false,
    "rejectInterval": 0,
    "acceptsEncodedFeatureCode": false,
    "escapeRequestUri": false,
    "convertHistoryInfoToDiversion": false,
    "oldStyleHold": false
}'
```

**Response**

On success, the API returns

```plaintext
true
```

## Edit Enterprise

**API Endpoint**

Method: `PUT`

Path: `/reseller/editEnterprise`

**Request Body (JSON)**

```json
{
    "canAddExtensions": false,
    "canResellerManageEnterpriseProvisioning": false,
    "secureSMSEnabled": false,
    "enterpriseId": 701,
    "enterpriseName": "enterprise_name",
    "pbxId": [0],
    "pbxMOH": false,
    "registeredBy": "user@example.com",
    "resellerId": 999,
    "sbcGateways": [0],
    "services": [
        "PBX",
        "SMS",
        "CALLAPP",
        "CHAT"
    ],
    "userLimit": -1,
    "allowExternalNumbers": true,
    "userProvisioningEnabled": true,
    "restrictAdminAccess": true
}
```

**Required Fields**

`enterpriseName (String)` - The name of the enterprise to be created. This field is mandatory as it uniquely identifies the enterprise in the system.

`pbxId (Array of Integers)` - The ids of the PBX Types if using PBX service.

`sbcGateways (Array of Integers)` - The ids of the Session Border Controller (SBC) gateways if using either PBX and/or Trunk service.

`services (Array of Strings)` - Defines the services enabled for the enterprise. Expected values include `PBX`, `Trunk`, `SMS`, `CALLAPP`, `CallRecording`, and `CHAT`.

`registeredBy`

**Response**

On success, the API returns

```plaintext
true
```

## Get O365 User Info

Method: `POST`

Path: `/provisioning/getO365UserInfo`

**Request Body (JSON)**

```json
{
    "authenticationResult": {
        "accessToken": "accessToken",
        "accessTokenType": "login.microsoftonline.com",
        "expiresAfter": null,
        "expiresOn": 1752158590229555,
        "expiresOnDate": null,
        "idToken": "idToken",
        "multipleResourceRefreshToken": false,
        "refreshToken": null,
        "userInfo": {
            "displayableId": "globaladmin@example.com",
            "identityProvider": "user",
            "tenantId": "tenantId"
        }
    }
}
```

**Response**

On success, the API returns

```json
{
    "msalAuthenticationResult": {
        "authenticationResult": {
            "accessToken": "accessToken",
            "accessTokenType": "login.microsoftonline.com",
            "expiresAfter": null,
            "expiresOn": 1754832571389936,
            "expiresOnDate": null,
            "idToken": "idToken",
            "multipleResourceRefreshToken": false,
            "refreshToken": null,
            "userInfo": {
                "displayableId": "globaladmin@example.com",
                "identityProvider": "user",
                "tenantId": "tenantId"
            }
        },
        "resellerId": null,
        "tenantId": null
    },
    "organization": "MSFT",
    "officeUserType": "GLOBAL_ADMIN",
    "companyAdmin": true,
    "containsTeamsTenantAdminAPI": true
}
```

## Refresh Enterprise Admin Access Token

This endpoint refreshes an expired or near-expiring access token without requiring the user to re-authenticate. Note that the access token expires in 60 minutes, while the refresh token has a longer lifespan of 30 days.

The access token and refresh token are first generated when the enterprise registers. See [this link](/v1-api/apidocs/creating-enterprise-with-restricted-access#b-handle-the-data-posted-to-your-provided-redirecturl) for more details on the registration process.

**API Endpoint**

Method: `POST`

Path: `/restricted/refreshToken`

**Request Body (JSON)**

```json
{
    "refreshToken" : "entAdminRefreshToken",
    "tenantId": "tenantId"
}
```

**Required Field**

`refreshToken`

`tenantId`

**API Response**

On success, the API returns a refreshed access_token and updated expiry values.

```json
{
    "access_token": "access_token",
    "scope": "write",
    "token_type": "Bearer",
    "expires_in": 3539
}
```

**Notes**

- The refresh token itself has a longer lifespan than the access token but will also expire eventually, requiring full re-authentication.

## Sync Unified app

**API Endpoint**

Method: `POST`

Path: `/provisioning/provisionApplication`

**Request Body (JSON)**

```json
{
  "authenticationResult": {
    "authenticationResult": {
      "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6IjdKbXh..............",
      "accessTokenType": "login.microsoftonline.com",
      "expiresOn": 1743285790991831,
      "idToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1..............",
      "multipleResourceRefreshToken": false,
      "userInfo": {
        "displayableId": "user@example.com",
        "identityProvider": "user",
        "tenantId": "tenantId"
      }
    }
  }
  "templateType": "UNIFIED"
}
```

**Required Field**

`templateType = "UNIFIED"`

**API Response**

On success, the API returns

```json
200 OK
```

## Sync Teams Users

This task may be carried out using an Enterprise-level Token or, if `GET_SERVICE_PROVIDER_MANAGEMENT_CONSENT` has been granted, using the Reseller-level token. (to do: apply in all /provisioning endpoints)

**API Endpoint**

Method: `POST`

Path: `/provisioning/syncTeamsRegistrations`

**Request Body (JSON)**

```json
{
    "authenticationResult": {
        "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6I.......",
        "accessTokenType": "login.microsoftonline.com",
        "expiresOn": 1743105617860946,
        "idToken": "eyJ0eXAiOiJKV1QiLCJh........",
        "multipleResourceRefreshToken": false,
        "userInfo": {
            "displayableId": "admin@example.com",
            "identityProvider": "user",
            "tenantId": "5c0068f3-df..."
        }
    }
}
```

**API Response**

On success, the API returns

```json
200 OK
```

## Update App Consent List for an Enterprise

Method: `POST`

Path: `/provisioning/updateAppConsent/{type}`

**Request Body (JSON)**

```json
{
  "authenticationResult": {
    "authenticationResult": {
      "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6IjdKbXh..............",
      "accessTokenType": "login.microsoftonline.com",
      "expiresOn": 1743285790991831,
      "idToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1..............",
      "multipleResourceRefreshToken": false,
      "userInfo": {
        "displayableId": "user@example.com",
        "identityProvider": "user",
        "tenantId": "tenantId"
      }
    }
  }
}
```

**Required Fields**

`type` = possible values are `CDR, Presence, TeamsContactManagement, UserSync, EnterpriseManagement, Valet, SMS, Contacts, CallRecording`

**API Response**

On success, the API returns

```plaintext
200 OK
```

## Verify Tenant for Direct Routing

The operation to verify the readiness to set up Direct Routing for a Microsoft Office365 Organization.

**API Endpoint**

Method: `POST`

Path: `/provisioning/verifyTenantForDR`

**Request Body (JSON)**

```json
{
    "authenticationResult": {
        "accessToken": "eyJ0eXAiOiJKV1QiLCJub25jZSI6Ikx6.......",
        "accessTokenType": "login.microsoftonline.com",
        "expiresOn": 1743097299177667,
        "idToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSU.....",
        "multipleResourceRefreshToken": false,
        "userInfo": {
           "displayableId": "<ent admin id>",
            "identityProvider": "user",
            "tenantId": "<tenant Id>"
        }
    }
}
```

**Example cURL Command**

```json
curl --silent --location --request POST 'https://api.connecttoteams.com/provisioning/verifyTenantForDR' \
--header 'Authorization: Bearer eyJraWQiOiJlYTdi........' \
--header 'Content-Type: application/json' \
--data-raw '{
    "authenticationResult": {
        "accessToken": "eyJ0eXAiOiJKV1QiLCJ ......",
        "accessTokenType": "login.microsoftonline.com",
        "expiresOn": 1743093181665540,
        "idToken": "eyJ0eXAiOiJKV1QiLCJhbGciOi.....",
        "multipleResourceRefreshToken": false,
        "userInfo": {
            "displayableId": "<ent admin id>",
            "identityProvider": "user",
            "tenantId": "<tenant Id>"
        }
    }
}'
```

**Response**

On success, the API returns

```json
200 OK
```

##
