By default a workspace reaches its tenant with the app the tree resolves to: a Master's app, else Scute's. A workspace can instead use an app registered in its own tenant. Scute tests the values against Microsoft and saves them only when the test passes. A Master's or MSP's own app is inherited by the workspaces under it.
All calls 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. With a member JWT instead, testing, saving and removing take an owner or admin (403 workspace_admin_required). The common errors are listed on Entra connection.
For a Master's own app, use Master app: it saves the app on the Master record that every workspace below reads.
Get the own-app state#
Returns the saved app, the values for a federated credential, what the workspace falls back to without its own app, and what the app registration needs.
/v1/workspaces/:workspace_id/entra/byo-appAPI key + M2M tokencurl https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/byo-app \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "available": true, "unavailable_reason": null, "mode": "byo", "tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90", "client_id": "3c1d2e4f-0a9b-4c8d-9e7f-112233445566", "credential_type": "federated", "client_secret_set": false, "federation": { "issuer": "https://api.scute.io/entra-federation", "subject": "workspace:0193f8aa-5555-7666-8777-888888888888", "audience": "api://AzureADTokenExchange", "available": true }, "verified_at": "2026-11-12T09:04:51Z", "granted_permissions": ["User.Read.All", "UserAuthenticationMethod.Read.All"], "warnings": [], "fallback": { "kind": "master", "workspace_slug": "acme-master", "client_id_last4": "9f1e" }, "requirements": { "account_type": "Accounts in this organizational directory only (single tenant). Choose multitenant only if people from other tenants sign in through it.", "redirect_uris": [ "https://api.scute.io/v1/auth/entra/auth-oidc", "https://api.scute.io/v1/auth/entra/admin-consent-callback" ], "permissions": [ { "name": "openid", "type": "delegated", "need": "required", "used_for": "Microsoft Authenticator push sign-in" } ] }}| Field | Meaning |
|---|---|
| mode | byo with an own app, scute_managed without one, gdap when the workspace runs through its MSP's partner connection, null when not connected. |
| client_id, credential_type | The saved app and how it proves itself: secret or federated. client_secret_set says whether a secret is stored. The secret is never returned. |
| federation | The issuer, subject and audience to enter as a federated credential on the app. available is false until the deployment has a signing key. |
| granted_permissions | The application permissions Microsoft reported at the last test. |
| warnings | What the app cannot do yet. Without User.Read.All there is a user_read_missing warning: people sync and people search stay off, everything else works. |
| fallback | The app the workspace uses without its own one. |
| requirements.permissions | Each Graph permission with type, need (required, recommended or optional) and what it is for. |
Test an app#
Asks Microsoft for a token with the values and reads the directory once. Nothing is saved. Answers 200 whether the test passes or not.
/v1/workspaces/:workspace_id/entra/byo-app/testAPI key + M2M tokencurl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/byo-app/test \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90", "client_id": "3c1d2e4f-0a9b-4c8d-9e7f-112233445566", "credential_type": "federated" }'{ "ok": true, "tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90", "steps": [ { "id": "input", "ok": true }, { "id": "token", "ok": true, "message": "Microsoft issued a token for the app." }, { "id": "graph_read", "ok": true, "message": "Read the tenant's directory through Microsoft Graph." } ], "granted_permissions": ["User.Read.All", "UserAuthenticationMethod.Read.All"], "missing_permissions": [], "warnings": []}The steps are input, token and graph_read. A failed step carries message, and the response adds error and microsoft_code (for example AADSTS70021: no federated credential on the app matches the issuer, subject and audience). A test that passes for a tenant this workspace cannot take answers ok: false with error_code tenant_mismatch or tenant_already_connected.
Save an app#
Runs the test again and saves the app only when it passes. Switching from a secret to a federated credential drops the stored secret.
/v1/workspaces/:workspace_id/entra/byo-appAPI key + M2M tokencurl -X PUT https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/byo-app \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90", "client_id": "3c1d2e4f-0a9b-4c8d-9e7f-112233445566", "client_secret": "..." }'The response is the state from Get the own-app state plus handshake, the test result.
| Status | error_code | When |
|---|---|---|
| 422 | handshake_failed | Microsoft refused the values. The body is the test result. Nothing changes. |
| 409 | tenant_mismatch | The workspace is connected to another tenant than the one the app signed in to. |
| 409 | tenant_already_connected | Another Scute workspace holds that tenant. |
| 409 | gdap_linked | The workspace runs through its MSP's partner connection. Unlink it there first. |
Remove the own app#
Switches the workspace back to the app the tree resolves to. The tenant stays connected. If the tenant never consented to that app, consent_url is its admin consent link.
/v1/workspaces/:workspace_id/entra/byo-appAPI key + M2M tokencurl -X DELETE https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/byo-app \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"The response is the state plus consent_url (or null when no app resolves).
| Status | error_code | When |
|---|---|---|
| 404 | not_byo | The workspace is not using its own app. |