API reference

A workspace's own Entra app

Run a workspace's tenant through an Entra app registered in that tenant, tested against Microsoft before it is saved.

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.

GET/v1/workspaces/:workspace_id/entra/byo-appAPI key + M2M token
workspace_idstringrequired
Workspace UUID or slug.
Requestbash
curl 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"
Response 200json
{  "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" }    ]  }}
FieldMeaning
modebyo 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_typeThe saved app and how it proves itself: secret or federated. client_secret_set says whether a secret is stored. The secret is never returned.
federationThe issuer, subject and audience to enter as a federated credential on the app. available is false until the deployment has a signing key.
granted_permissionsThe application permissions Microsoft reported at the last test.
warningsWhat 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.
fallbackThe app the workspace uses without its own one.
requirements.permissionsEach 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.

POST/v1/workspaces/:workspace_id/entra/byo-app/testAPI key + M2M token
workspace_idstringrequired
Workspace UUID or slug.
tenant_idstringrequired
The Directory (tenant) ID the app is registered in.
client_idstringrequired
The app's Application (client) ID.
client_secretstring
The client secret. Leave it out with credential_type: "federated".
credential_typestring
secret (default) or federated. With federated, the app needs the federated credential from federation.
Requestbash
curl -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" }'
Response 200json
{  "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.

PUT/v1/workspaces/:workspace_id/entra/byo-appAPI key + M2M token
workspace_idstringrequired
Workspace UUID or slug.
tenant_idstringrequired
The Directory (tenant) ID.
client_idstringrequired
The Application (client) ID.
client_secretstring
Required unless credential_type is federated.
credential_typestring
secret (default) or federated.
Requestbash
curl -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.

Statuserror_codeWhen
422handshake_failedMicrosoft refused the values. The body is the test result. Nothing changes.
409tenant_mismatchThe workspace is connected to another tenant than the one the app signed in to.
409tenant_already_connectedAnother Scute workspace holds that tenant.
409gdap_linkedThe 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.

DELETE/v1/workspaces/:workspace_id/entra/byo-appAPI key + M2M token
workspace_idstringrequired
Workspace UUID or slug.
Requestbash
curl -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).

Statuserror_codeWhen
404not_byoThe workspace is not using its own app.