Guide · 5 steps

Setting up Webhook Notifications

In this guide, you'll register a webhook endpoint, authenticate deliveries, and handle real-time events from LifeLoop.

Prerequisites
  • LifeLoop API service token
  • A publicly accessible HTTPS endpoint
  • Webhook signing secret (provided after registration)
1Step 1

Register your webhook endpoint

Contact LifeLoop support to register your webhook URL and receive your signing secret. You'll subscribe to specific event types like resident.updated, message.created, photo.uploaded.

No request for this step
2Step 2

Receive a webhook event

When an event occurs, LifeLoop sends a POST request to your endpoint with this envelope:

Webhook payload
{
  "eventId": "evt_1a2b3c4d",
  "eventType": "message.created",
  "tenant": "sunrise-001",
  "occurredAt": "2026-06-22T15:30:00Z",
  "resourceId": "msg-042"
}
3Step 3

Check the X-API-KEY header

Every delivery carries your integration's configured key in the X-API-KEY header. Check it before trusting the request, using a constant-time comparison.

Delivery authentication
# Simulate a delivery to your endpoint
curl -X POST https://your-app.example.com/lifeloop/webhook \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: YOUR_WEBHOOK_KEY" \
  -d '{"eventId":"evt_1a2b3c4d","eventType":"message.created","aggregateType":"message","tenant":"sunrise-001","occurredAt":"2026-06-22T15:30:00Z","resourceId":"msg-042"}'
4Step 4

Fetch the full resource

Webhook payloads are intentionally lightweight — fetch the full resource using resourceId.

Request
curl https://api.lifeloop.com/api/v1/sunrise-001/messages/msg-042 \
  -H "Authorization: Bearer YOUR_SERVICE_TOKEN" \
  -H "X-Acting-User-Id: ACTING_USER_ID" \
  -H "X-Acting-User-Tenant: sunrise-001"
Response · 200 OK
{
  "id": "msg-042",
  "residentId": "res-001",
  "subject": "Had a wonderful day!",
  "body": "Aileen participated in art class today.",
  "createdAt": "2026-06-22T15:30:00Z"
}
5Step 5

Return a 200 response

Respond with any 2xx quickly — LifeLoop waits up to 5 seconds to connect and 10 seconds for a response. No response, 5xx, 408 or 429 is retried up to 4 times (~30s, 1m, 2m, 4m apart); other responses are final.

No request for this step

Next steps

More guides