With GDAP (granular delegated admin privileges) an MSP connects its own Microsoft partner tenant once, instead of asking each client tenant for admin consent. Scute lists the client tenants the MSP has GDAP relationships with, places the Entra app in them and links each to a client workspace. After that, Authenticator push, approve/deny and the helpdesk actions use the same calls as for any other client.
These routes act on an MSP under a Master (or on the Master's own connection) from the Master. Authenticate with the workspace key of the path workspace in Authorization and an M2M token from an app in that workspace in X-Authorization. A member JWT also works, for an owner or admin of the path workspace (403 workspace_admin_required otherwise). :workspace_id is the Master or MSP, :msp is an MSP workspace id or slug under it. See Authentication.
The feature has to be on for the workspace's tree. While it is off, every route returns 404 entra_gdap_not_enabled.
Before you start#
The connection uses a federated credential on the app (never a client secret). The app is the MSP's own (app_source: "own") or the Master's (app_source: "master", one federated credential with subject workspace:<master id> covers every MSP under the Master). See Master app.
On the app registration, add the redirect URI https://api.scute.io/v1/auth/entra/gdap-callback and the permissions listed in requirements.permissions of Get the connection, including the Graph application permission DelegatedAdminRelationship.Read.All.
In the MSP's partner tenant the MSP needs:
- an admin who can grant application permissions, to consent the app;
- a dedicated service account (a member, not a guest, with MFA) in a security group that every client's GDAP relationship gives Directory Readers and Authentication Administrator.
Flow#
- Get a partner consent link and have the MSP admin approve the app in the partner tenant (Master's app only).
- Test and save the connection.
- Send the service account to authorize_url to sign in (Get a sign-in URL).
- Refresh and list the client tenants.
- Start a setup run to place the app in the tenants and link them to client workspaces.
Return URLs#
Sign-ins and consent links started through these routes can send the browser back to your own page with return_url. It must be an https URL whose origin is on the Master's list. An unlisted return_url returns 422 return_url_not_allowed. The browser lands on return_url with gdap= set to partner_consented, connected, consented, setup (with run=), or error with reason=. return_url is at most 2048 characters. Consent links and sign-in URLs carry a state that lasts 5 minutes, so create them right before use.
Get return origins#
/v1/workspaces/:workspace_id/entra/gdap/return-originsWorkspace key + M2M tokencurl https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/return-origins \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "origins": ["https://app.example.com"] }Set return origins#
Replaces the list.
/v1/workspaces/:workspace_id/entra/gdap/return-originsWorkspace key + M2M tokencurl -X PUT https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/return-origins \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "origins": ["https://app.example.com"] }'{ "origins": ["https://app.example.com"] }| Status | error_code | When |
|---|---|---|
| 403 | master_required | The path workspace is not a Master (GET and PUT). |
| 422 | invalid | origins is not a list of at most 20 entries. |
| 422 | invalid_origin | An entry is in another form. |
Connection#
Errors on every route under msps/:msp:
| Status | error_code | When |
|---|---|---|
| 403 | integrator_workspace_required | The path workspace is not a Master or MSP. |
| 403 | workspace_admin_required | A member JWT of someone who is not an owner or admin. |
| 404 | msp_not_found | :msp is not an MSP under the path workspace. |
| 404 | gdap_not_connected | No connection saved yet. Not returned by the state, save, test and partner consent link routes. |
| 422 | return_url_not_allowed | return_url is not on the Master's list. |
Get the connection#
Returns the connection, the federated credential values, what the app registration needs and counts of client tenants by state.
/v1/workspaces/:workspace_id/entra/gdap/msps/:mspWorkspace key + M2M tokencurl https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "available": true, "unavailable_reason": null, "connection": { "status": "active", "partner_tenant_id": "6f1c2a3b-4d5e-6f70-8192-a3b4c5d6e7f8", "partner_display_name": null, "client_id": "3c1d2e4f-0a9b-4c8d-9e7f-112233445566", "credential_type": "federated", "service_account": { "upn": "scute-service@northwind.example", "signed_in_at": "2026-11-18T09:12:00Z" }, "token": { "renewed_at": "2026-11-19T03:00:00Z", "error": null, "error_code": null, "error_at": null }, "discovery": { "status": "idle", "last_at": "2026-11-19T03:05:00Z", "error": null }, "can_discover": true, "settings": { "setup_actor": "session", "consent_strategy": "admin_consent_link", "auto_onboard_new": false }, "connected_at": "2026-11-18T09:12:00Z", "connected_by": null }, "federation": { "issuer": "https://api.scute.io/entra-federation", "subject": "workspace:0193f8aa-0000-7000-8000-000000000000", "audience": "api://AzureADTokenExchange", "available": true }, "requirements": { "account_type": "...", "redirect_uris": ["..."], "permissions": [], "roles": [] }, "summary": { "total": 12, "ready": 3, "needs_setup": 9, "attention": 0, "ended": 0, "ignored": 0, "unlinked": 9 }, "msp": { "id": "0193f8aa-1111-7222-8333-444444444444", "slug": "northwind", "name": "Northwind IT" }, "app_source": "master", "master_app": { "workspace_id": "0193f8aa-0000-7000-8000-000000000000", "workspace_slug": "acme-master", "client_id": "3c1d2e4f-0a9b-4c8d-9e7f-112233445566", "federation": { "issuer": "https://api.scute.io/entra-federation", "subject": "workspace:0193f8aa-0000-7000-8000-000000000000", "audience": "api://AzureADTokenExchange" } }, "partner_tenant_consent_url": "https://login.microsoftonline.com/6f1c2a3b-.../v2.0/adminconsent?..."}connection is null until the app is saved. available is false with unavailable_reason wrong_tier (not an MSP or Master) or federation_unavailable (no signing key on the deployment).
| connection.status | Meaning |
|---|---|
| pending | Saved, the service account has not signed in. |
| active | The service account is signed in. |
| reauth_required | Sign the service account in again. |
| disabled | The connection is disabled. |
connection.discovery.status is idle, running or error. The service account's refresh token is never returned.
Get a partner consent link#
Returns the admin consent URL that places the Master's app in the MSP's partner tenant. Needed before the first test passes on the Master's app. Nothing is stored; the test confirms the consent.
/v1/workspaces/:workspace_id/entra/gdap/msps/:msp/partner-consent-linkWorkspace key + M2M tokencurl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind/partner-consent-link \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tenant_id": "6f1c2a3b-4d5e-6f70-8192-a3b4c5d6e7f8" }'{ "url": "https://login.microsoftonline.com/6f1c2a3b-.../v2.0/adminconsent?client_id=...&state=...", "expires_in": 300}| Status | error_code | When |
|---|---|---|
| 422 | master_app_missing | No Master above the workspace has its own Entra app. |
| 422 | invalid | tenant_id is not a tenant GUID. |
Test the connection#
Asks Microsoft for a token at the partner tenant with the federated credential, then reads the GDAP relationships once. Nothing is saved. Answers 200 with ok: true or ok: false.
/v1/workspaces/:workspace_id/entra/gdap/msps/:msp/testWorkspace key + M2M tokencurl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind/test \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tenant_id": "6f1c2a3b-4d5e-6f70-8192-a3b4c5d6e7f8", "app_source": "master" }'{ "ok": true, "tenant_id": "6f1c2a3b-4d5e-6f70-8192-a3b4c5d6e7f8", "steps": [ { "id": "input", "ok": true }, { "id": "token", "ok": true, "message": "Microsoft accepted the federated credential." }, { "id": "relationships", "ok": true } ]}A failed test on the Master's app also returns partner_tenant_consent_url.
| Failed step | Code | Meaning |
|---|---|---|
| token | AADSTS700016 | The app is not consented in the partner tenant yet. |
| token | AADSTS70025 | The app has no federated credential. |
| token | AADSTS70021 | No federated credential matches. |
| token | AADSTS700211, AADSTS700212, AADSTS700213 | The issuer, audience or subject differs. |
| relationships | HTTP 403 from Graph | DelegatedAdminRelationship.Read.All is not consented in the partner tenant. |
| Status | error_code | When |
|---|---|---|
| 422 | master_app_missing | No Master above the MSP has its own app. |
| 422 | master_app_needs_msp | app_source: "master" on a workspace that is not an MSP. |
| 422 | invalid | app_source is not own or master. |
Save the connection#
Runs the test again and saves the app only when it passes. Answers the state from Get the connection plus authorize_url, the service account's sign-in.
/v1/workspaces/:workspace_id/entra/gdap/msps/:mspWorkspace key + M2M tokencurl -X PUT https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tenant_id": "6f1c2a3b-4d5e-6f70-8192-a3b4c5d6e7f8", "app_source": "master" }'| Status | error_code | When |
|---|---|---|
| 422 | handshake_failed | The test failed. The body is the test result. |
| 422 | master_app_missing, master_app_needs_msp, invalid | As for the test. invalid also when Microsoft returns no tenant ID. |
| 409 | gdap_connected | The connection is in use and the request points it at another tenant or app. Disconnect first. |
Get a sign-in URL#
Returns a fresh Microsoft sign-in URL. service_account signs the service account in, with MFA. setup is the sign-in a setup run waits for.
/v1/workspaces/:workspace_id/entra/gdap/msps/:msp/authorizeWorkspace key + M2M tokencurl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind/authorize \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "purpose": "service_account" }'{ "authorize_url": "https://login.microsoftonline.com/6f1c2a3b-.../oauth2/v2.0/authorize?client_id=...&acr_values=mfa&prompt=select_account" }After the sign-in the browser lands on return_url?gdap=connected, or on gdap=error with reason one of state_invalid, microsoft_refused, wrong_tenant, guest_account, mfa_required. The tenant list refreshes after a sign-in.
| Status | error_code | When |
|---|---|---|
| 422 | run_not_waiting | setup for a run that is not waiting for a sign-in. |
| 422 | invalid | Another purpose. |
Change connection settings#
/v1/workspaces/:workspace_id/entra/gdap/msps/:mspWorkspace key + M2M tokencurl -X PATCH https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "settings": { "consent_strategy": "admin_consent_link" } }'Answers the state.
| Status | error_code | When |
|---|---|---|
| 422 | invalid | No settings. |
| 422 | invalid_settings | A value is not allowed, or auto_onboard_new without setup_actor: "service_account". |
Disconnect#
Removes the connection and its tenant rows, and deletes the service account's token. Linked clients keep their config, switched off; reconnecting restores them. The app stays consented in the client tenants: a setup run with revoke: true removes it there first.
/v1/workspaces/:workspace_id/entra/gdap/msps/:mspWorkspace key + M2M tokencurl -X DELETE "https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind?force=true" \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "ok": true, "consents_left": 9, "clients_disabled": 3 }| Status | error_code | When |
|---|---|---|
| 409 | clients_linked | Clients are linked and force is not true. The body adds count. |
Client tenants#
Refresh the tenant list#
Reads the MSP's GDAP relationships again in the background.
/v1/workspaces/:workspace_id/entra/gdap/msps/:msp/discoverWorkspace key + M2M tokencurl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind/discover \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "discovery": { "status": "running" } }| Status | error_code | When |
|---|---|---|
| 409 | discovery_running | A refresh started in the last 15 minutes is still running. |
List client tenants#
/v1/workspaces/:workspace_id/entra/gdap/msps/:msp/tenantsWorkspace key + M2M tokencurl "https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind/tenants?state=needs_setup" \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "tenants": [ { "id": "0193f9b0-2222-7333-8444-555555555555", "customer_tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90", "display_name": "Contoso", "state": "needs_setup", "relationship": { "status": "active", "ends_at": "2027-05-01T00:00:00Z", "auto_extend": true, "count": 1, "expiring_soon": false }, "consent": { "status": "none", "at": null, "error": null }, "roles": { "held": ["Directory Readers", "Authentication Administrator"], "missing": [] }, "features": {}, "setup_possible": true, "check": { "at": null, "error": null, "microsoft_code": null }, "workspace": null, "suggested_workspace": { "id": "0193f8aa-5555-7666-8777-888888888888", "slug": "contoso", "name": "Contoso", "reason": "same_tenant", "mode": "scute_managed" }, "conflict": null } ], "summary": { "total": 12, "ready": 3, "needs_setup": 9, "attention": 0, "ended": 0, "ignored": 0, "unlinked": 9 }, "discovery": { "status": "idle", "last_at": "2026-11-19T03:05:00Z", "error": null }, "next_cursor": null}summary counts the whole list, whatever the filter. suggested_workspace is a likely client workspace: reason same_tenant (the client already connected to that tenant) or name (a client with no Entra config whose name matches). A setup run links only same_tenant suggestions on its own.
| Status | error_code | When |
|---|---|---|
| 422 | invalid | Another state. |
Link a tenant#
Links a tenant row to a client workspace, creates a client workspace and links it, unlinks it, or ignores it. Send one of the bodies below.
/v1/workspaces/:workspace_id/entra/gdap/msps/:msp/tenants/:idWorkspace key + M2M tokencurl -X PUT https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind/tenants/$TENANT_ROW_ID \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "workspace_id": "contoso", "replace_existing": true }'Answers { "tenant": { ... } } with the row as in the list.
| Status | error_code | When |
|---|---|---|
| 404 | tenant_not_found | No such row in this connection. |
| 404 | workspace_not_found | The client workspace does not exist. |
| 409 | client_already_connected | The client is connected another way and replace_existing is not true. The body adds current_mode. |
| 409 | connected_elsewhere, tenant_already_linked, workspace_already_linked, tenant_mismatch | The tenant or the workspace is already taken. |
| 422 | needs_setup | The app is not placed in the tenant yet. |
| 422 | create_needs_msp | create_workspace on a connection that is not an MSP's. |
| 422 | invalid | None of the fields above was sent. |
| 403 | feature_not_available | The workspace's plan does not include it. |
Check a tenant#
Probes the tenant now as the service account and answers the row.
/v1/workspaces/:workspace_id/entra/gdap/msps/:msp/tenants/:id/checkWorkspace key + M2M tokencurl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind/tenants/$TENANT_ROW_ID/check \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"Answers { "tenant": { ... } }.
Get a tenant consent link#
One client tenant's admin consent link, outside a setup run. Accepting it marks the tenant consented and lands on gdap=consented.
/v1/workspaces/:workspace_id/entra/gdap/msps/:msp/tenants/:id/consent-linkWorkspace key + M2M tokencurl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind/tenants/$TENANT_ROW_ID/consent-link \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "tenant_id": "0193f9b0-2222-7333-8444-555555555555", "customer_tenant_id": "c87af060-e83b-4ed4-bf27-1d6ac3584c90", "url": "https://login.microsoftonline.com/c87af060-.../v2.0/adminconsent?...", "expires_in": 300}Setup runs#
Start a setup run#
Places the app's delegated permissions in the selected client tenants, links them to client workspaces and, with approve_deny, creates their approve/deny secrets. Or, with revoke: true, takes the app out of them.
/v1/workspaces/:workspace_id/entra/gdap/msps/:msp/setup-runsWorkspace key + M2M tokencurl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind/setup-runs \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tenant_ids": ["0193f9b0-2222-7333-8444-555555555555"], "link": "suggested_only" }'{ "run": { "id": "0193fa10-aaaa-7bbb-8ccc-dddddddddddd", "status": "running", "total": 1 }, "consent_links": [ { "tenant_id": "0193f9b0-2222-7333-8444-555555555555", "display_name": "Contoso", "url": "https://login.microsoftonline.com/c87af060-.../v2.0/adminconsent?..." } ]}What moves the run on comes back with it: authorize_url when a person has to sign in for the run, consent_links on the admin_consent_link strategy, approve_deny_authorize_url when approve/deny needs the sign-in of someone with Cloud Application Administrator in the client tenants, or none of these when the service account does the work and the run has started.
| Status | error_code | When |
|---|---|---|
| 409 | gdap_not_active | The service account has not signed in. |
| 422 | no_tenants | No tenants to set up. |
| 422 | unknown_tenants | Some ids are not in this connection's list. |
| 422 | create_needs_msp | create_missing on a connection that is not an MSP's. |
| 422 | invalid | link or tenant_ids in another form. |
Get a setup run#
Runs are kept for 24 hours.
/v1/workspaces/:workspace_id/entra/gdap/msps/:msp/setup-runs/:idWorkspace key + M2M tokencurl https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/entra/gdap/msps/northwind/setup-runs/$RUN_ID \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"{ "run": { "id": "0193fa10-aaaa-7bbb-8ccc-dddddddddddd", "status": "running", "total": 2, "done": 1, "failed": 0, "results": [ { "tenant_id": "0193f9b0-2222-7333-8444-555555555555", "display_name": "Contoso", "status": "...", "steps": {} } ] }}run.status is awaiting_sign_in, running, finished or expired. A failed tenant carries step, error and microsoft_code in place of steps. The approve_deny step is running, ok, skipped, waiting_sign_in, needs_sign_in or failed.
| Status | error_code | When |
|---|---|---|
| 404 | run_not_found | Unknown, or older than 24 hours. |