API reference

Entra connection

Connect a workspace to its Microsoft tenant, choose the app that receives synced users and run a directory sync.

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:

Statuserror_codeWhen
401Missing or invalid key or token.
403workspace_access_deniedThe M2M token's app is not in this workspace.
403insufficient_scopeThe M2M token lacks the read (GET) or write scope.
404workspace_not_foundNo 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.

GET/v1/workspaces/:workspace_id/entraAPI key + M2M token
workspace_idstringrequired
Workspace UUID or slug.
includestring
Query. domains adds the tenant's verified domains (entra.domains). It is a Microsoft call, cached for 10 minutes, and only answered where helpdesk admin actions are on. When Microsoft fails, domains is null and domains_error says why.
Requestbash
curl https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra \  -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"
Response 200json
{  "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:

FieldMeaning
modeHow 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_idThe app chosen to receive synced users, or null.
resolved_target_app_public_idThe app that receives synced users. A workspace with one app uses it without a choice.
sync_statusrunning 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_statsprocessed, linked (matched by email), created, skipped (no usable email) and errors (one entry per failed user, with upn and error).
ms_authenticator_enabledWhether Authenticator push is on. Always true on client workspaces.
admin_actions_enabledThe 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.

PATCH/v1/workspaces/:workspace_id/entraAPI key + M2M token
workspace_idstringrequired
Workspace UUID or slug.
target_app_idstring
App id or public id (app_...) of an app in this workspace. An empty value clears the choice.
ms_authenticator_enabledboolean
Switches Microsoft Authenticator push.
admin_actions_enabledboolean
Switches the helpdesk admin actions for this workspace. With a member JWT, a body with only this field needs any member who is not read-only.
Requestbash
curl -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" }'
Response 200json
{  "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.

StatusWhen
404The workspace is not connected (errors: "Not connected").
422target_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.

POST/v1/workspaces/:workspace_id/entra/connectAPI key + M2M token
workspace_idstringrequired
The client workspace UUID or slug.
Requestbash
curl -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"
Response 200json
{  "consent_url": "https://login.microsoftonline.com/common/adminconsent?client_id=..."}
Statuserror_codeWhen
422entra_app_not_configuredNo Entra app resolves for this workspace or any workspace above it.
409gdap_linkedThe 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.

DELETE/v1/workspaces/:workspace_id/entraAPI key + M2M token
workspace_idstringrequired
Workspace UUID or slug.
Requestbash
curl -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"
Response 200json
{ "ok": true }
Statuserror_codeWhen
404No connection to remove (errors: "No Entra config to disconnect").
409gdap_linkedThe 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.

POST/v1/workspaces/:workspace_id/entra/syncAPI key + M2M token
workspace_idstringrequired
The client workspace UUID or slug.
Requestbash
curl -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"
Response 202json
{ "ok": true, "sync_status": "running" }
StatusWhen
404The workspace is not connected (errors: "Not connected").
409A sync is already running (errors: "Already syncing").
422The 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.