Power Automate Integration Guide
Connect ALICE webhook events to Microsoft Power Automate flows. Trigger automated workflows when visitors check in, appointments are created, and more.
1. Create a Webhook Subscription
First, register a webhook subscription with the ALICE API. You will need a valid JWT token and the target URL where ALICE will send events. (You will get the target URL from Power Automate in step 2 below.)
Send a POST request to /api/webhooks with the event type and your endpoint URL:
curl -X POST https://your-api-url/api/webhooks \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"eventType": "appointment.checked_in",
"targetUrl": "https://prod-00.westus.logic.azure.com:443/workflows/...",
"description": "Notify on visitor check-in"
}'
A successful response (HTTP 201) includes the subscription details and a secret for signature verification:
{
"id": 1,
"eventType": "appointment.checked_in",
"targetUrl": "https://prod-00.westus.logic.azure.com:443/workflows/...",
"description": "Notify on visitor check-in",
"secret": "whsec_a1b2c3d4e5f6g7h8i9j0...",
"isActive": true
}
secret value is shown only once in this response. Copy and store it securely. You will need it if you want to verify webhook signatures.
2. Set Up a Power Automate Flow
Create a Power Automate flow that listens for incoming HTTP requests from ALICE webhooks.
-
Open Power Automate
Navigate to https://make.powerautomate.com and sign in with your Microsoft 365 account.
-
Create a new flow
Click Create in the left navigation, then select Automated cloud flow. Give your flow a name, such as "ALICE Visitor Check-In Notification".
-
Add the HTTP trigger
In the trigger search box, search for "When a HTTP request is received". Select this trigger from the results. This is a premium connector provided by Power Automate.
-
Set the HTTP method
In the trigger configuration, set the Method dropdown to
POST. ALICE sends all webhook events as POST requests. -
Add the JSON schema
Paste the ALICE payload schema into the Request Body JSON Schema field (covered in the next section). Then click Save.
-
Copy the generated URL
After saving, Power Automate generates an HTTP POST URL for the trigger. Copy this URL — you will use it as the
targetUrlwhen creating your ALICE webhook subscription (see step 1 above).
targetUrl.
3. Configure the Trigger Schema
Providing a JSON schema tells Power Automate the shape of the ALICE webhook payload, making fields available as dynamic content in subsequent flow actions.
Paste the following schema into the Request Body JSON Schema field of the "When a HTTP request is received" trigger:
{
"type": "object",
"properties": {
"event": { "type": "string" },
"version": { "type": "string" },
"timestamp": { "type": "string" },
"delivery_id": { "type": "string" },
"test": { "type": "boolean" },
"data": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"first_name": { "type": "string" },
"last_name": { "type": "string" },
"email": { "type": "string" },
"start_date": { "type": "string" },
"end_date": { "type": "string" },
"directory_id": { "type": "integer" },
"employee_id": { "type": "integer" }
}
}
}
}
Once the schema is saved, you can reference payload fields as dynamic content in your flow. For example:
| Dynamic Content Field | Source | Example Value |
|---|---|---|
event | Top-level event type | appointment.checked_in |
data.first_name | Visitor first name | Jane |
data.last_name | Visitor last name | Smith |
data.email | Visitor email address | jane.smith@example.com |
data.start_date | Appointment start time | 2026-03-12T09:00:00Z |
data.employee_id | Host employee ID | 100 |
test | Whether this is a test delivery | false |
After configuring the schema and saving the flow, copy the generated HTTP POST URL from the trigger. Use this URL as the targetUrl when creating your ALICE webhook subscription.
4. Test End-to-End
Use the ALICE webhook test endpoint to send a test event to your Power Automate flow and verify everything is connected correctly.
Send a test event
Send a POST request to the test endpoint using your subscription ID:
curl -X POST https://your-api-url/api/webhooks/1/test \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
What the test payload looks like
ALICE sends a test event with "test": true so your flow can distinguish test deliveries from real ones:
{
"event": "appointment.checked_in",
"version": "1.0",
"timestamp": "2026-03-12T14:30:00Z",
"delivery_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"test": true,
"data": {
"id": 42,
"first_name": "Jane",
"last_name": "Smith",
"email": "jane.smith@example.com",
"start_date": "2026-03-12T09:00:00Z",
"end_date": "2026-03-12T10:00:00Z",
"directory_id": 10,
"employee_id": 100
}
}
Verify in Power Automate
After sending the test event:
- Open your flow in Power Automate
- Navigate to the Run history tab (or click 28-day run history in the flow overview)
- You should see a new run with a Succeeded status
- Click the run to inspect the trigger inputs — confirm the payload fields match the test data above
test field in a Power Automate condition to skip actions during test deliveries. Add a Condition action that checks if test is equal to false before running your main workflow logic.
5. Troubleshooting
Common issues and how to resolve them.
Flow not triggering
If your Power Automate flow is not running when ALICE sends a webhook event:
- Confirm the flow is turned on in Power Automate (check the toggle in the flow details page)
- Verify the webhook subscription is active by calling
GET /api/webhooksand checking thatisActiveistrue - Confirm the
targetUrlin your ALICE subscription exactly matches the HTTP POST URL shown in the Power Automate trigger - Check that the Power Automate flow has not been moved or re-saved, which can change the trigger URL
Authentication errors
The Power Automate "When a HTTP request is received" trigger includes a SAS token in the URL for authentication. No additional authentication configuration is needed. However:
- If you see 401 or 403 errors in the ALICE delivery history, the Power Automate URL may have expired or been regenerated
- The Who Can Trigger setting (under flow Settings) should be set to "Anyone" so ALICE can call the endpoint without Microsoft authentication
- Re-copy the HTTP POST URL from the trigger and update your ALICE webhook subscription with the new
targetUrl
Signature verification
Every ALICE webhook delivery includes an X-Alice-Signature header for verifying payload authenticity. The signature is an HMAC-SHA256 hash of the raw request body using your subscription secret.
To verify the signature in a Power Automate flow, you can use an Azure Function or inline code action (JavaScript):
// 1. Get the signature from the request header
signature = headers["X-Alice-Signature"]
// e.g., "sha256=a1b2c3d4e5f6..."
// 2. Compute HMAC-SHA256 of the raw request body
expected = "sha256=" + HMAC_SHA256(secret, rawBody).toHex()
// 3. Compare using constant-time comparison
isValid = secureCompare(signature, expected)
Additional delivery headers you can inspect:
| Header | Description | Example |
|---|---|---|
X-Alice-Signature | HMAC-SHA256 signature of the request body | sha256=a1b2c3d4e5f6... |
X-Alice-Event | The event type that triggered this delivery | appointment.checked_in |
X-Alice-Delivery-Id | Unique identifier for this delivery | a1b2c3d4-e5f6-7890-abcd-ef1234567890 |
Delivery failures
If ALICE is unable to deliver a webhook event to your Power Automate endpoint, you can inspect the delivery log:
curl https://your-api-url/api/webhooks/1/deliveries \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
The delivery log shows the HTTP status code returned by your endpoint, the response body, and the timestamp. Common failure scenarios:
| Status Code | Cause | Resolution |
|---|---|---|
404 | Power Automate flow deleted or URL changed | Re-create the flow or update the subscription targetUrl |
401 / 403 | SAS token expired or access restricted | Re-copy the trigger URL and update the subscription |
429 | Power Automate throttling | Check your Power Automate plan limits; consider adding delay between events |
500 | Error in Power Automate flow actions | Check the flow run history for error details |
| Timeout | Flow took too long to respond | Ensure the trigger responds within 30 seconds; move long-running actions to async patterns |
