Skip to main content
Version: Insiders

Update Owner Permissions

Professional

The EasyLife 365 Identity Insiders API lets you change what the technical owners and business owners of an application are allowed to do. These are the same permissions an application owner sets on the application's Settings page.

Name only the permissions you want to change, each set to true or false. A permission you leave out keeps its current value.

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.Ownership.ReadWrite.All, https://api.insiders.easylife365.cloud/admin/Identity.Manage.ReadWrite.All
warning

Identity.Ownership.Read.All does not grant access to this endpoint, because it only reads. Use Identity.Ownership.ReadWrite.All, the same permission that synchronizes owners, or Identity.Manage.ReadWrite.All when the integration also manages policies.

note

Application permissions always require admin consent. See Create Application Registration for the app-only setup. A delegated caller must be an owner of the application in Entra, or an administrator. A technical owner cannot change these permissions, even with Change app settings.

HTTP Request​

PATCH https://api.insiders.easylife365.cloud/admin/identity/v1/apps/{id}/ownership/permissions
Content-Type: application/json
ParameterDescription
idThe Entra Object ID of the application registration or enterprise application. Not its Application (client) ID.

HTTP request headers​

HeaderValue
Authorization****** (Required)
Content-Typeapplication/json

Request Body​

PropertyTypeDescription
appTypeString or numberappRegistration or enterpriseApplication, or 0 or 1 as Get Owner Permissions returns it. Required.
technicalOwnersObjectOptional. Technical owner permissions to change, each true or false.
businessOwnersObjectOptional. Business owner permissions to change, each true or false.

Send at least one of technicalOwners and businessOwners. The permission names are listed under Get Owner Permissions → Permission names. Names are case-sensitive.

info

The whole request is refused when any name is unknown or does not apply to the application type, for example extendActivity on an app registration. Nothing is changed in that case, not even the valid names in the same request. The error message names every rejected permission and lists the accepted ones.

Response​

A successful request returns 200 OK, also when nothing needed to change.

PropertyTypeDescription
changedBooleantrue when permissions were changed, false when the application already had the requested values.
changesArrayWhat changed. Each entry has bucket (technicalOwners or businessOwners), permission, previous and next.
permissionsObjectThe owner permissions the request leaves, in the same shape as Get Owner Permissions, including warnings.

Errors​

Errors are application/problem+json. Read code. See Errors for the format.

StatuscodeWhen
400 Bad RequestInvalidPayloadappType is missing, neither bucket is sent, a permission name is unknown or does not apply to the application type, a value is null, or a bucket names more than 32 permissions. The body's detail explains what to fix. Nothing was changed.
400 Bad Request with errorsInvalidPayloadThe body could not be read: it is empty or not valid JSON, a value is not a JSON true or false (for example the string "true"), or appType is a string that is neither of the two names. A number other than 0 or 1 is not refused here: the application is not found, and the answer is 404. Each entry in errors names the property that could not be read. Nothing was changed.
401 UnauthorizedAuthenticationRequiredThe token is missing, expired or for another API.
403 ForbiddenNotAllowedThe token does not carry one of the permissions above, or a delegated caller is not an owner or administrator. Nothing was changed.
403 ForbiddenIdentity.LicenseRequiredThe tenant does not have a Professional or Trial license. Nothing was changed.
404 Not FoundNotFoundNo application with this Object ID and type exists in your tenant.
409 ConflictIdentity.SettingsChangedConcurrentlyThe application's settings were changed by someone else several times while the request was applied. Nothing was changed. Read the permissions again and retry.
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 bulk operations.

A change someone else makes between your read and your write is not lost: the write is conditional on the settings the API read while applying your request, and the request is applied again on top of the newer settings. Only when that keeps happening does the API give up with 409.

warning

The other direction is not protected. Any save of an application's whole settings can put older permissions back if it started before your request and finishes after it, although your call answered changed: true. Among them are the ownership API, a CSV import, a save on the Settings page, owner changes and Extend app activity done by owners in the app, and the activity and policy scans that EasyLife runs. The scans run on EasyLife's schedule, which you cannot see, and can finish minutes later, so a read straight after your call can look right and the old permissions can still come back. Such a change is not recorded in the audit history.

Run owner synchronization and permission changes for the same application one after the other. Read the permissions again some time after a change that matters, for example a revocation. If you manage permissions from an automation, run it on a schedule: it is safe to repeat, and each run sets the values you want again.

Audit history​

When audit logging is turned on for the tenant, each change is recorded in the application's audit history, with the previous and new permissions. An application making the call is identified by its Application (client) ID, a person by their account. See Logging. A request that changes nothing records nothing.

Example 1: Change technical and business owner permissions​

This example lets technical owners change certificates and secrets, stops them extending app activity, and lets business owners change business owners. Every other permission stays as it is.

Request​

PATCH https://api.insiders.easylife365.cloud/admin/identity/v1/apps/8f3c2a71-5d4e-4b9a-a1c6-2e7f90d4b5a3/ownership/permissions
Content-Type: application/json
{
"appType": "enterpriseApplication",
"technicalOwners": { "editCredentials": true, "extendActivity": false },
"businessOwners": { "editBusinessOwners": true }
}

Response​

{
"changed": true,
"changes": [
{ "bucket": "technicalOwners", "permission": "editCredentials", "previous": false, "next": true },
{ "bucket": "technicalOwners", "permission": "extendActivity", "previous": true, "next": false },
{ "bucket": "businessOwners", "permission": "editBusinessOwners", "previous": false, "next": true }
],
"permissions": {
"app": {
"objectId": "8f3c2a71-5d4e-4b9a-a1c6-2e7f90d4b5a3",
"appId": "1b6f4b1a-8f2f-4e3b-9c8b-9a2f6e4d7c11",
"displayName": "Contoso Payroll",
"type": 1,
"isManaged": true
},
"appType": 1,
"technicalOwners": {
"editCredentials": true,
"editOwners": false,
"editTechnicalOwners": false,
"editSettings": true,
"editBusinessOwners": false,
"extendActivity": false,
"editProperties": false
},
"businessOwners": { "editBusinessOwners": true },
"warnings": []
}
}

Example 2: A misspelled permission​

Request​

PATCH https://api.insiders.easylife365.cloud/admin/identity/v1/apps/8f3c2a71-5d4e-4b9a-a1c6-2e7f90d4b5a3/ownership/permissions
Content-Type: application/json
{
"appType": "enterpriseApplication",
"technicalOwners": { "editCredentails": true }
}

Response​

400 Bad Request. Nothing was changed.

{
"type": "https://docs.easylife365.cloud/errors/invalid-payload",
"title": "EL0001",
"status": 400,
"code": "InvalidPayload",
"requestId": "2f8b6d93-1c40-4a7e-b5d8-9e03a7c41f26",
"detail": "'editCredentails' is not a permission of 'technicalOwners' for an enterpriseApplication. 'technicalOwners' accepts: editCredentials, editOwners, editTechnicalOwners, editSettings, editBusinessOwners, extendActivity, editProperties."
}

Example 3: Change permissions using PowerShell​

This example applies the change and shows what changed and any warnings. Before you run it, register an application with Identity.Ownership.ReadWrite.All and note its tenant ID, client ID and client secret.

$ErrorActionPreference = "Stop" # a refused or failed request must stop the script
$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

$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)"
"Content-Type" = "application/json"
}

$change = @{
appType = "enterpriseApplication"
technicalOwners = @{ editCredentials = $true }
}

# Apply the change.
$result = Invoke-RestMethod -Method PATCH -Uri $uri -Headers $headers -Body ($change | ConvertTo-Json -Depth 5)
$result.changes | Format-Table bucket, permission, previous, next

# A warning describes the permissions after the request, so it can come from a permission this request does not touch.
$result.permissions.warnings | ForEach-Object { Write-Warning "$($_.code): $($_.message)" }
Write-Information "Changed: $($result.changed)" -InformationAction Continue