Skip to main content
Version: Insiders

Get Application Policy State

Professional

The EasyLife 365 Identity Insiders API lets you read the state of one application: its name, the policy assigned to it and whether it meets that policy. It is the same information the Security Center of an application shows, for a script or an integration that has no signed-in person.

To assign or clear a policy, use Change Application Policy.

Permissions​

Permission TypePermissions (Scope)
Delegated (work or school account)https://api.insiders.easylife365.cloud/admin/Config.ReadWrite.All
Applicationhttps://api.insiders.easylife365.cloud/admin/Identity.Manage.Read.All, https://api.insiders.easylife365.cloud/admin/Identity.Manage.ReadWrite.All
note

Any one of the listed application permissions grants access to this endpoint. Roles do not include one another: Identity.Ownership.Read.All and Identity.Ownership.ReadWrite.All do not open this endpoint. Application permissions always require admin consent. See Create Application Registration for the app-only setup.

HTTP Request​

GET https://api.insiders.easylife365.cloud/admin/identity/v1/manage/apps/{id}?type={app-type}
ParameterDescription
idThe Entra Object ID of the application registration or enterprise application. Not its Application (client) ID.
typeappRegistration or enterpriseApplication. Required: an app registration and its enterprise application are two objects with their own policy.

HTTP request headers​

HeaderValue
Authorization****** (Required)

Request Body​

This request does not require or support any data.

Response​

A successful request returns 200 OK with this body.

PropertyTypeDescription
idStringThe Entra Object ID of the application.
displayNameStringThe display name of the application in Entra.
isCompliantBooleanWhether the application meets the policy assigned to it, as the Security Center shows it. Left out when no policy is assigned, and when the inactivity rule is paused because the tenant's sign-in data is not current and no other rule fails. Right after a policy is assigned, true can mean that it has not been checked yet: read again later before you rely on it.
policyObjectThe policy data stored for the application. Left out when no policy is assigned.

Properties without a value are left out, never sent as null. Applications have a policy only, so the answer has no other stored members.

A missing policy means no policy is assigned to the application. The default policy of your tenant for this type of application can still apply, and it is not part of the answer.

The content of policy can change

policy is returned as EasyLife 365 Identity Insiders stores it. Its short keys, for example pId for the assigned policy and inSta for the state of the inactivity rule, and the state words in it can change without notice. Only id, displayName, isCompliant and the policy member itself are stable. Read isCompliant to decide, and do not build on the keys inside policy.

The answer does not name the person who last extended the activity of the application.

Errors​

Errors are application/problem+json. Read code: it names the error and does not change. See Errors for the format.

StatuscodeWhen
400 Bad RequestInvalidPayloadtype is missing or is not one of the two values. The detail explains which.
401 UnauthorizedAuthenticationRequiredThe token is missing, expired or for another API.
403 ForbiddenNotAllowedThe token carries none of the permissions above (for example only Identity.Ownership.Read.All), or the token was requested before admin consent.
403 ForbiddenIdentity.LicenseRequiredThe tenant does not have a Professional or Trial license.
404 Not FoundNotFoundNo application of this type has this Object ID in your tenant. Check the id and the type.
429 Too Many RequestsnoneToo many requests. The answer is a short text with a Retry-After header, not a JSON body. Wait and retry. This route uses the limit for read calls.
500 Internal Server ErrorInfrastructureErrorThe policy could not be read. Try again, and give support the requestId when it keeps failing.

Example 1: Read an application that meets its policy​

This example reads the app registration with Object ID 57523d68-2913-4fc0-8f91-af100f37562f.

Request​

GET https://api.insiders.easylife365.cloud/admin/identity/v1/manage/apps/57523d68-2913-4fc0-8f91-af100f37562f?type=appRegistration

Response​

The keys inside policy are shown for illustration only.

{
"id": "57523d68-2913-4fc0-8f91-af100f37562f",
"displayName": "Contoso Invoicing",
"isCompliant": true,
"policy": {
"pId": "3d2c8f4e-7a1b-4c59-9e0d-6b5a1f2c8d74",
"owSta": "compliant",
"toSta": "compliant",
"boSta": "compliant",
"inSta": "compliant",
"inCh": "2026-10-02T00:00:00Z",
"bcSta": "compliant"
}
}

Example 2: Read an application without a policy​

The answer has only id and displayName:

{
"id": "8f3c2a71-5d4e-4b9a-a1c6-2e7f90d4b5a3",
"displayName": "Contoso Payroll"
}

Example 3: The application does not exist​

404 Not Found:

{
"type": "https://docs.easylife365.cloud/errors/not-found",
"title": "EL0002",
"status": 404,
"detail": "No application of this type has this id. Check the id and the type.",
"code": "NotFound",
"requestId": "4b1e7c52-93d0-4f6a-8a3e-0c5d2f71b9e8"
}

Example 4: Read the state using curl and PowerShell​

Both examples request an application token first. In the bash example, set TENANT_ID, CLIENT_ID, CLIENT_SECRET and SCOPE (https://api.easylife365.cloud/admin/.default) first. Before you run them, register an application with Identity.Manage.Read.All and note its tenant ID, client ID and client secret.

TOKEN=$(curl -s -X POST "https://login.microsoftonline.com/$TENANT_ID/oauth2/v2.0/token" \
-d "client_id=$CLIENT_ID" -d "client_secret=$CLIENT_SECRET" \
-d "grant_type=client_credentials" -d "scope=$SCOPE" | jq -r .access_token)

curl -s "https://api.easylife365.cloud/admin/identity/v1/manage/apps/57523d68-2913-4fc0-8f91-af100f37562f?type=appRegistration" \
-H "Authorization: Bearer $TOKEN"
$ErrorActionPreference = "Stop" # stop on a refused or failed request
$tenantId = "[TENANT_ID]"
$clientId = "[CLIENT_ID]"
$clientSecret = "[CLIENT_SECRET]" # read it from your secret store, never hard-code it
$scope = "[SCOPE]" # the .default scope from Create Application Registration
$uri = "[URI]" # the request URL above, with your Object ID and type

$token = Invoke-RestMethod -Method POST `
-Uri "https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token" `
-ContentType "application/x-www-form-urlencoded" `
-Body @{ client_id = $clientId; client_secret = $clientSecret; grant_type = "client_credentials"; scope = $scope }

$headers = @{ "Authorization" = "Bearer $($token.access_token)" }

$state = Invoke-RestMethod -Method GET -Uri $uri -Headers $headers
"$($state.displayName): compliant = $($state.isCompliant)"