Skip to main content
Version: Insiders

Approvals

Approvals offer flexible integration options. You can choose to receive notifications when an approval stage changes or specify the approvers for each approval step before starting an approval process.

State changes

This webhook triggers whenever the state of an approval request changes, including:

  • Approval request creation
  • Approval request approval
  • Approval request rejection

HTTP Request

POST YourApiUrl
Content-Type: application/json

{
"requestId": "d12773f8-6ea1-42be-9be4-3cd58bac3b63",
"title": "Group sample",
"reason": "Is there no reason?",
"requestorId": "d3f0fe0f-ad34-4eb2-af61-953ea3a76031",
"participants": [
"d3f0fe0f-ad34-4eb2-af61-953ea3a76031"
],
"stage": 0,
"totalStages": 2,
"templateId": "8884dca2-6f58-4175-81a2-3504f6ee616d",
"tenantId": "1840b34e-6fe7-4a56-9ad3-0b7b58c49dc7"
}

Response

A status 200 OK is expected with no body.

Assign approvers to an approval stage

Approval workflows often require specific approvers. In such cases, approver webhooks prove invaluable. When an approval request is initiated, the webhook calls a designated endpoint. The returned user IDs are then verified as collaborators and assigned as the approvers for that particular approval stage. You can also auto-approve or auto-reject a request.

The payload content varies depending on the specific resource being requested. This ensures that the endpoint receives all necessary information to correctly determine the approvers for each case.

HTTP Request

POST YourApiUrl
Content-Type: application/json
{
"requestId": "c131c319-f0e4-4a02-ad68-c7bcff69ece9",
"title": "guest@toinvite.com",
"reason": "This is the reason again",
"requestorId": "d3f0fe0f-ad34-4eb2-af61-953ea3a76031",
"payload": "{\"userRequest\":{\"secondaryOwner\":{\"id\":\"788da9bf-0762-4dd6-a5db-346430ad7b1a\",\"userType\":\"Member\",\"userPrincipalName\":\"AlexW@sampledomain.com\",\"jobTitle\":\"Marketing Assistant\",\"givenName\":\"Alex\",\"displayName\":\"Alex Wilber\",\"department\":\"Marketing\",\"createdDateTime\":\"2019-09-23T10:20:49+00:00\",\"country\":\"United States\",\"city\":\"San Diego\",\"businessPhones\":[\"\\u002B1 858 555 0110\"],\"accountEnabled\":true,\"mail\":\"AlexW@sampledomain.com\",\"surname\":\"Wilber\",\"streetAddress\":\"9256 Towne Center Dr., Suite 400\",\"state\":\"CA\",\"preferredLanguage\":\"en-US\",\"postalCode\":\"92121\",\"officeLocation\":\"131/1104\",\"policyExtension\":{\"pId\":\"5a6d4c46-883a-4b08-b17e-1f5dea63049f\",\"arStCh\":\"2024-07-21T21:59:59+00:00\",\"arSt\":\"escalate\",\"arSta\":\"incompliant\",\"arCh\":\"2024-07-09T21:59:59+00:00\"},\"easylife365_user\":{\"policyId\":\"5a6d4c46-883a-4b08-b17e-1f5dea63049f\",\"resourceType\":\"OneDrive\",\"isCompliant\":false},\"onPremisesExtensionAttributes\":{}},\"mail\":\"guest@toinvite.com\",\"templateId\":\"f647cbc3-cd9e-47ed-b517-93fa29e7b292\",\"requestor\":{\"id\":\"d3f0fe0f-ad34-4eb2-af61-953ea3a76031\",\"userType\":\"Member\",\"userPrincipalName\":\"pbe@sampledomain.com\",\"givenName\":\"Patrick\",\"displayName\":\"Patrick Bertolla\",\"createdDateTime\":\"2021-06-14T04:53:35+00:00\",\"companyName\":\"EasyLife\",\"businessPhones\":[],\"accountEnabled\":true,\"mail\":\"pbe@sampledomain.com\",\"surname\":\"Bertolla\",\"preferredLanguage\":\"de-DE\",\"officeLocation\":\"Somewhere\",\"policyExtension\":{\"pId\":\"5a6d4c46-883a-4b08-b17e-1f5dea63049f\",\"arStCh\":\"2024-09-27T23:59:59+00:00\",\"arSt\":\"escalate\",\"arSta\":\"incompliant\",\"arCh\":\"2024-09-24T23:59:59+00:00\",\"arFeDa\":\"2024-09-24T09:00:45.6167403+00:00\"},\"easylife365_user\":{\"policyId\":\"5a6d4c46-883a-4b08-b17e-1f5dea63049f\",\"resourceType\":\"OneDrive\",\"isCompliant\":false},\"onPremisesExtensionAttributes\":{}},\"metadata\":{\"tId\":\"f647cbc3-cd9e-47ed-b517-93fa29e7b292\"},\"addToGroups\":[\"e808e4d6-c6e1-4686-a0d3-aa521b48b14d\"],\"reason\":\"This is the reason again\",\"sendInvitationMail\":true},\"requestId\":\"4ad8192d-0135-4ebc-8dbc-06478e321eba\",\"tenantId\":\"1840b34e-6fe7-4a56-9ad3-0b7b58c49dc7\",\"isInvitation\":false}",
"participants": [
"d3f0fe0f-ad34-4eb2-af61-953ea3a76031"
],
"stage": 0,
"totalStages": 1,
"templateId": "3531ed85-aa80-44a4-a5a9-41c713a76ffa",
"tenantId": "1840b34e-6fe7-4a56-9ad3-0b7b58c49dc7",
"productId": 0,
"IsTenantSelected": true,
"IsRequestSelected": true
}
info

The property payload is an escaped JSON string

Response

EasyLife expects an HTTP 200 OK response based on your scenario. The response can take one of three forms, depending on the action: listing approvers, approving a request, or rejecting a request.

[
"974d3b91-22dd-4851-9987-10ebbfb08737",
"bb87b3cf-9d8e-4dfc-b9e6-aba0f9b4acb7"
]

Listing approvers

  • The response should return an array of Entra IDs.
  • EasyLife will validate these IDs against your environment.
  • All valid Entra IDs will be designated as approvers for the specified workflow stage.

Approving a request

  • The response should include a JSON object with the state set to "Approved".
  • An optional "reason" field can be added to provide context for the approval.
  • Once approved, the workflow stage will proceed with the provided reason being returned to the requester.

Rejecting a request

  • The response should include a JSON object with the state set to "Rejected".
  • An optional "reason" field can be included to explain the rejection.
  • The rejection will be communicated back to the requester with the provided reason.
warning

All webhook actions are triggered simultaneously at the start of an approval request. This design ensures that each stage operates independently, avoiding any conditional dependencies between stages.