Microsoft Teams Provisioning API (Preview)
This document is a draft. The API endpoints described in this article are expected in version VSXi-13.1.2.x not currently GA.
The Microsoft Teams Provisioning API is an extension to the VSXi REST API. This enhancement defines new API endpoints to enable management of Direct Routing tenant and user configuration using a draft-based workflow. Changes are staged in a draft, reviewed, and then committed to become active. You can also roll back previously committed changes if needed.
Key Concepts
Draft-Based Workflow
All changes are first staged in a draft session
Only one active draft is allowed at a time
Drafts can be:
Reviewed
Committed
Discarded
Committed Sessions
When a draft is committed, it becomes a committed session
Each session has a unique session key
Sessions can be listed and rolled back
Rollback
Roll back:
The most recent commit
Or to a specific session (removes that and newer sessions)
Provisioning Workflow
Initial Provisioning
Start draft : POST /teams/draft/start
Upload tenants : POST /teams/draft/update/tenants
Upload users : POST /teams/draft/update/users
Review changes : GET /teams/draft/status
Review diff : GET /teams/draft/diff
Commit changes : POST /teams/draft/commit
Verify :
GET /teams/tenants
GET /teams/users
GET /teams/smcFiles
API Endpoints
Draft Lifecycle
Start Draft
POST /teams/draft/start
Start a new draft session
Draft Status
GET /teams/draft/status
Returns summary of staged changes:
Tenants added/updated/deleted
Users added/updated/deleted
Draft Diff
GET /teams/draft/diff
Downloads a ZIP of generated configuration differences for review before commit.
Discard Draft
POST /teams/draft/discard
Deletes the current draft and all staged changes.
Commit Draft
POST /teams/draft/commit
Applies all staged changes and creates a committed session.
Tenant Management
Create / Update Tenants
POST /teams/draft/update/tenants
Upload tenant data via CSV.
tenantId,tenantName,microsoftFqdn,localIp,did,pbxId,spId 1001,Sansay_HQ,ms1.example.com,68.70.169.47,+18580001111,12345,1
Behavior
New tenantId → creates tenant
Existing tenantId → updates tenant
pbxId and spId cannot be changed after creation
Requirements
Tenant IDs must be unique
Tenant DIDs must be unique
PBX and Service Port must exist beforehand
Delete Tenants
DELETE /teams/draft/delete/tenants
tenantId 1001
Behavior
Deletes tenant
Also deletes all associated users
Get Tenants
GET /teams/tenants
Query Parameters
includeDraft=true → include draft changes
User Management
Create / Update Users
POST /teams/draft/update/users
tenantId,sipUser,sipPassword,did 1001,2000_T,password1001,+15551001000
Requirements
Tenant must exist
SIP users must be unique
User DIDs must be unique
Replace All Users
POST /teams/draft/replace/users
Behavior
Deletes all existing users
Replaces with uploaded CSV data
Use with caution (global operation)
Delete Users
DELETE /teams/draft/delete/users
sipUser 2000_T
Get Users
GET /teams/users
Query Parameters
includeDraft=true
tenantIds=1001,1002
Commit History & Rollback
List Commits
GET /teams/commits
Returns:
Session key
Timestamp
Change summary
Description
Rollback Latest
POST /teams/rollback
Reverts most recent committed session.
Rollback to Session
POST /teams/rollback/{session}
Reverts to a specific session:
Removes that session and all newer ones
Configuration Retrieval
Download Configuration
GET /teams/smcFiles
Query Parameters
includeDraft=true
Returns generated configuration package (ZIP).
Supported Actions
Tenants
Create
Update
Delete
Users
Create
Update
Delete
Replace (global)
Draft
Start
Status
Diff
Commit
Discard
History
List commits
Rollback (latest or specific)
Usage Notes
Tenants must be created before users
IDs and DIDs must be unique
Deleting a tenant removes all its users
Replace-users is a global destructive operation
Always review draft before committing
