A workspace's Entra connection records the Microsoft tenant it is linked to, the app in the workspace that receives synced users, and the state of the last directory sync. Connect it on the client workspace. MSP workspaces are a grouping layer and hold no tenant of their own.
All calls on this page take an app key or workspace key in Authorization and an M2M token in X-Authorization. The M2M token's app has to be in the workspace in the path. :workspace_id is the workspace UUID or slug. See Authentication.
With a member JWT in place of the M2M token, connect, disconnect, sync and changes to target_app_id or ms_authenticator_enabled take an owner or admin and return 403 workspace_admin_required otherwise.
Errors that every call can return:
| Status | error_code | When |
|---|---|---|
| 401 | Missing or invalid key or token. | |
| 403 | workspace_access_denied | The M2M token's app is not in this workspace. |
| 403 | insufficient_scope | The M2M token lacks the read (GET) or write scope. |
| 404 | workspace_not_found | No workspace with that id or slug. |
Several errors below return a message in errors and no error_code. See Errors.
Get the connection#
Returns the tenant connection, the workspace's apps and which Entra app the workspace resolves to. The client secret is never returned.
/v1/workspaces/:workspace_id/entraAPI key + M2M tokencurl https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "entra": { "tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90", "mode": "scute_managed", "display_name": "Contoso", "consented_at": "2026-10-02T14:11:09.000Z", "consented_by_admin_email": "admin@contoso.com", "enabled": true, "target_app_id": null, "target_app_public_id": null, "resolved_target_app_public_id": "app_3mxZRrzWxhPZ08dXvqq6", "target_app_name": null, "last_synced_at": "2026-11-18T10:30:00.000Z", "sync_status": "idle", "sync_error": null, "last_sync_stats": { "processed": 240, "linked": 180, "created": 55, "skipped": 5, "errors": [] }, "ms_authenticator_enabled": true, "admin_actions_enabled": false, "admin_actions_effective": false }, "workspace_apps": [ { "id": "0193f8aa-5555-7666-8777-999999999999", "public_id": "app_3mxZRrzWxhPZ08dXvqq6", "name": "Contoso" } ], "is_master": false, "is_msp": false, "is_client": true, "credentials_set": false, "entra_client_id": null, "entra_credential_type": "secret", "federation": { "issuer": "https://api.scute.io/entra-federation", "subject": "workspace:0193f8aa-5555-7666-8777-888888888888", "audience": "api://AzureADTokenExchange", "available": true }, "credentials_source": { "kind": "master", "workspace_slug": "acme-master", "workspace_type": "master", "client_id_last4": "9f1e" }}entra is null until the workspace is connected. Fields of entra:
| Field | Meaning |
|---|---|
| mode | How the tenant is reached: scute_managed (the app the tree resolves to), byo (own app) or gdap (an MSP's partner connection). A gdap row also has partner with the MSP, the partner tenant, status, relationship_ends_at, features and missing_roles. |
| target_app_id | The app chosen to receive synced users, or null. |
| resolved_target_app_public_id | The app that receives synced users. A workspace with one app uses it without a choice. |
| sync_status | running while a sync runs, idle after a sync that finished, error after one that failed (sync_error says why). A sync with no progress for 30 minutes is marked error. |
| last_sync_stats | processed, linked (matched by email), created, skipped (no usable email) and errors (one entry per failed user, with upn and error). |
| ms_authenticator_enabled | Whether Authenticator push is on. Always true on client workspaces. |
| admin_actions_enabled | The stored switch for helpdesk admin actions. admin_actions_effective says whether they are on. |
credentials_source is the Entra app the workspace resolves to, or null when none resolves. kind is master (a Master's own app), byo (a workspace's own app), scute (Scute's app) or gdap (an MSP's partner connection). It also names the workspace the app is saved on and the last four characters of its client ID. credentials_set is true when an app is saved on this workspace itself.
Update the connection#
Chooses the app that receives synced users, and switches Authenticator push and the helpdesk admin actions.
/v1/workspaces/:workspace_id/entraAPI key + M2M tokencurl -X PATCH https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "target_app_id": "app_3mxZRrzWxhPZ08dXvqq6" }'{ "entra": { "tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90", "mode": "scute_managed", "enabled": true, "target_app_id": "0193f8aa-5555-7666-8777-999999999999", "target_app_public_id": "app_3mxZRrzWxhPZ08dXvqq6", "resolved_target_app_public_id": "app_3mxZRrzWxhPZ08dXvqq6", "target_app_name": "Contoso", "sync_status": "idle", "ms_authenticator_enabled": true, "admin_actions_enabled": false, "admin_actions_effective": false }}The example shows a subset of entra. It has the same fields as in Get the connection.
| Status | When |
|---|---|
| 404 | The workspace is not connected (errors: "Not connected"). |
| 422 | target_app_id is not an app in this workspace. |
Connect a tenant#
Returns a Microsoft admin consent URL for the app the workspace resolves to. An admin of the client's tenant opens it and approves. The approval lands on https://api.scute.io/v1/auth/entra/admin-consent-callback and records the tenant on the workspace. Consent is needed once per tenant.
/v1/workspaces/:workspace_id/entra/connectAPI key + M2M tokencurl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/connect \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "consent_url": "https://login.microsoftonline.com/common/adminconsent?client_id=..."}| Status | error_code | When |
|---|---|---|
| 422 | entra_app_not_configured | No Entra app resolves for this workspace or any workspace above it. |
| 409 | gdap_linked | The workspace runs through its MSP's partner connection. Unlink it on the MSP first. |
A workspace under a Master with its own app can also be connected without consent here: the first user synced with an Entra tid connects it.
Disconnect a tenant#
Removes the workspace's tenant connection.
/v1/workspaces/:workspace_id/entraAPI key + M2M tokencurl -X DELETE https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "ok": true }| Status | error_code | When |
|---|---|---|
| 404 | No connection to remove (errors: "No Entra config to disconnect"). | |
| 409 | gdap_linked | The workspace runs through its MSP's partner connection. Unlink it on the MSP. |
Start a directory sync#
Reads every enabled user (accountEnabled eq true) from the tenant through Microsoft Graph, matches each to a user in the target app by email, links the ones that exist and creates the rest. The sync runs in the background. Poll Get the connection until sync_status leaves running.
The Entra app needs the application permissions User.Read.All and UserAuthenticationMethod.Read.All, consented in the tenant. The sync also records whether each user has Microsoft Authenticator registered.
/v1/workspaces/:workspace_id/entra/syncAPI key + M2M tokencurl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/sync \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "ok": true, "sync_status": "running" }| Status | When |
|---|---|
| 404 | The workspace is not connected (errors: "Not connected"). |
| 409 | A sync is already running (errors: "Already syncing"). |
| 422 | The workspace has no app, or several apps and no target_app_id. |
A synced user is linked to their Entra identity (upn, oid, tid) and can receive an Authenticator push.