Guide · 3 steps

Creating a Custom Activity Calendar

In this guide, you'll build a custom activity calendar that displays a resident's scheduled activities and allows you to create new ones programmatically.

Prerequisites
  • LifeLoop API service token
  • Tenant: sunrise-001
  • Resident ID: res-001
1Step 1

List upcoming activities

Query the resident's personal activities for the week to populate the calendar grid. See List Personal Activities in the API Reference.

Request
curl https://api.lifeloop.com/api/v1/sunrise-001/personal-activities?residentId=res-001&startDate=2026-06-22&endDate=2026-06-28 \
  -H "Authorization: Bearer YOUR_SERVICE_TOKEN"
Response · 200 OK
{
  "data": [
    {
      "id": "pa-001",
      "residentId": "res-001",
      "title": "Music Therapy",
      "startTime": "2026-06-23T14:00:00Z",
      "endTime": "2026-06-23T15:00:00Z",
      "location": "Activity Room A"
    },
    {
      "id": "pa-002",
      "residentId": "res-001",
      "title": "Bingo",
      "startTime": "2026-06-24T10:00:00Z",
      "endTime": "2026-06-24T11:00:00Z",
      "location": "Main Hall"
    }
  ]
}
2Step 2

Create a new activity

POST a new personal activity onto the calendar for this resident.

Request
curl -X POST https://api.lifeloop.com/api/v1/sunrise-001/personal-activities \
  -H "Authorization: Bearer YOUR_SERVICE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "residentId": "res-001",
  "title": "Family Video Call",
  "startTime": "2026-06-25T16:00:00Z",
  "endTime": "2026-06-25T16:30:00Z",
  "location": "Private Room"
}'
Response · 201 Created
{
  "id": "pa-003",
  "residentId": "res-001",
  "title": "Family Video Call",
  "startTime": "2026-06-25T16:00:00Z",
  "endTime": "2026-06-25T16:30:00Z",
  "location": "Private Room",
  "createdAt": "2026-06-22T12:54:00Z"
}
3Step 3

Register for an existing group activity

If the activity is a facility-wide event, create a registration instead of a personal activity.

Request
curl -X POST https://api.lifeloop.com/api/v1/sunrise-001/registrations \
  -H "Authorization: Bearer YOUR_SERVICE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "residentId": "res-001",
  "activityId": "ga-005"
}'
Response · 201 Created
{
  "id": "reg-001",
  "residentId": "res-001",
  "activityId": "ga-005",
  "status": "registered",
  "createdAt": "2026-06-22T12:55:00Z"
}

Next steps

More guides