Attendance Endpoints
The Attendance module manages campus locations, services, service times, attendance sessions, visits, and visit sessions. It provides the infrastructure for tracking who attended which service or group meeting, supports check-in workflows, and offers attendance trend and summary reporting.
Base path: /attendance
Campuses
Base path: /attendance/campuses
Standard CRUD controller (extends GenericCrudController). Provides getById, getAll, post, and delete routes via the CRUD base class.
| Method | Path | Auth | Permission | Description |
|---|---|---|---|---|
| GET | / | JWT | — | List all campuses for the church |
| GET | /:id | JWT | — | Get a campus by ID |
| POST | / | JWT | Services.Edit | Create or update campuses |
| DELETE | /:id | JWT | Services.Edit | Delete a campus |
Services
Base path: /attendance/services
Extends GenericCrudController with CRUD routes getById, getAll, post, and delete. The getAll (GET /) and search endpoints are overridden with custom implementations.
| Method | Path | Auth | Permission | Description |
|---|---|---|---|---|
| GET | / | JWT | — | List all services (includes campus info) |
| GET | /:id | JWT | — | Get a service by ID |
| GET | /search?campusId= | JWT | — | Search services by campus ID |
| POST | / | JWT | Services.Edit | Create or update services |
| DELETE | /:id | JWT | Services.Edit | Delete a service |
Example: Search Services by Campus
GET /attendance/services/search?campusId=abc-123
Authorization: Bearer <token>
[
{
"id": "svc-001",
"churchId": "church-123",
"campusId": "abc-123",
"name": "Sunday Morning"
}
]
Service Times
Base path: /attendance/servicetimes
Extends GenericCrudController with CRUD routes getById, post, and delete. The getAll and search endpoints are custom implementations.
| Method | Path | Auth | Permission | Description |
|---|---|---|---|---|
| GET | / | JWT | — | List all service times. Filter by ?serviceId=. Add ?include=groups to append group data. Each row includes a computed checkinOpen boolean (false only when the service time has a check-in schedule whose window is closed right now). The window is measured in the time zone of the service's campus, then the church's time zone, then the first campus that has one, then America/New_York |
| GET | /:id | JWT | — | Get a service time by ID |
| GET | /search?campusId=&serviceId= | JWT | — | Search service times by campus and service |
| GET | /public/:churchId | Public | — | Get the campus → service → time tree for a church. Powers the website builder's serviceTimes element |
| POST | / | JWT | Services.Edit | Create or update service times. Optional schedule fields: dayOfWeek (0 = Sunday … 6), startTime / endTime (HH:mm), checkinOpenMinutes (before start), checkinCloseMinutes (after end). Check-in is only time-gated when both dayOfWeek and startTime are set |
| DELETE | /:id | JWT | Services.Edit | Delete a service time |
Group Service Times
Base path: /attendance/groupservicetimes
Links groups to specific service times.
| Method | Path | Auth | Permission | Description |
|---|---|---|---|---|
| GET | / | JWT | — | List all group-service-time associations. Filter by ?groupId= to get associations with service names |
| GET | /:id | JWT | — | Get a group-service-time association by ID |
| POST | / | JWT | Services.Edit | Create or update group-service-time associations |
| DELETE | /:id | JWT | Services.Edit | Delete a group-service-time association |
Attendance Records
Base path: /attendance/attendancerecords
Provides read-only aggregate views of attendance data for reporting and display.
| Method | Path | Auth | Permission | Description |
|---|---|---|---|---|
| GET | / | JWT | Attendance.View | Load attendance records for a person. Requires ?personId= |
| GET | /my | JWT | — | Self-scoped: the signed-in member's own attendance records from the last 12 months, newest first. Returns 401 if the user isn't linked to a person. Backs the My Attendance section of the B1 Me page |
| GET | /tree | JWT | — | Load the full attendance tree (campuses, services, service times, groups) |
| GET | /trend?campusId=&serviceId=&serviceTimeId=&groupId= | JWT | Attendance.View Summary | Load attendance trend data with optional filters |
| GET | /groups?serviceId=&week= | JWT | Attendance.View | Load group attendance for a service on a given week |
| GET | /sessionStatus?serviceTimeId=&date= | JWT | Attendance.View | For every group assigned to the service time, return { groupId, sessionId, attendanceCount } for that date (date is YYYY-MM-DD; sessionId is null when the group has no session). Backs B1Admin's Who Still Needs Attendance dialog |
| GET | /search?campusId=&serviceId=&serviceTimeId=&groupId=&startDate=&endDate= | JWT | Attendance.View | Search attendance records with filters (campus, service, service time, group, date range) |
Example: Attendance Trend
GET /attendance/attendancerecords/trend?serviceId=svc-001
Authorization: Bearer <token>
[
{ "week": "2025-01-05", "count": 142 },
{ "week": "2025-01-12", "count": 156 },
{ "week": "2025-01-19", "count": 138 }
]
Sessions
Base path: /attendance/sessions
Extends GenericCrudController with CRUD routes getById and delete. The getAll and save endpoints are custom implementations that also allow group leaders to manage sessions for their groups.
| Method | Path | Auth | Permission | Description |
|---|---|---|---|---|
| GET | / | JWT | Attendance.View or Group Leader | List all sessions. Filter by ?groupId= (includes names). Group leaders can view sessions for their own groups |
| GET | /:id | JWT | Attendance.View | Get a session by ID |
| POST | / | JWT | Attendance.Edit or Group Leader | Create or update sessions. Group leaders can save sessions for their own groups |
| DELETE | /:id | JWT | Attendance.Edit | Delete a session |
Visits
Base path: /attendance/visits
Manages individual visit records (a person attending on a specific date) and provides the check-in workflow.
| Method | Path | Auth | Permission | Description |
|---|---|---|---|---|
| GET | / | JWT | Attendance.View | List all visits. Filter by ?personId= |
| GET | /:id | JWT | Attendance.View | Get a visit by ID |
| GET | /checkin?serviceId=&peopleIds= | JWT | Attendance.View or Attendance.Checkin | Load check-in data for people at a service. Returns visits with visit sessions from the last logged date |
| POST | / | JWT | Attendance.Edit | Create or update visits |
| POST | /checkin?serviceId=&peopleIds= | JWT | Attendance.Edit or Attendance.Checkin | Submit check-in data. Creates/updates visits and visit sessions, removes stale records |
| DELETE | /:id | JWT | Attendance.Edit | Delete a visit |
Example: Check-in Flow
Step 1 -- Load existing check-in data:
GET /attendance/visits/checkin?serviceId=svc-001&peopleIds=person-1,person-2
Authorization: Bearer <token>
[
{
"id": "visit-001",
"personId": "person-1",
"visitDate": "2025-01-19T00:00:00.000Z",
"visitSessions": [
{
"id": "vs-001",
"sessionId": "sess-001",
"visitId": "visit-001",
"session": {
"id": "sess-001",
"groupId": "group-001",
"serviceTimeId": "st-001",
"sessionDate": "2025-01-19T00:00:00.000Z"
}
}
]
}
]
Step 2 -- Submit check-in:
POST /attendance/visits/checkin?serviceId=svc-001&peopleIds=person-1,person-2
Authorization: Bearer <token>
[
{
"personId": "person-1",
"visitSessions": [
{
"session": { "serviceTimeId": "st-001", "groupId": "group-001" }
}
]
}
]
If a targeted service time has a check-in schedule and its window is closed (measured in the same campus-first time zone order as checkinOpen), nothing is saved and the response is 409 { "error": "notOpen", "groups": [{ "groupId", "groupName", "reason": "notOpen" }] }. Capacity and volunteer-ratio violations also return 409 (error: "capacity" or "ratio"). Sessions a person already holds today (re-posted with each check-in) skip the window check, so a household can add an open service time after an earlier one's window has closed.
Visit Sessions
Base path: /attendance/visitsessions
Manages the association between visits and sessions (which specific session a person attended during a visit). Also provides a quick log endpoint and a download/export endpoint.
| Method | Path | Auth | Permission | Description |
|---|---|---|---|---|
| GET | / | JWT | Attendance.View or Group Leader | List visit sessions. Filter by ?sessionId=. Group leaders can view visit sessions for their own groups |
| GET | /:id | JWT | Attendance.View | Get a visit session by ID |
| GET | /download/:sessionId | JWT | Attendance.View | Download attendance for a session (returns person names with present/absent status) |
| POST | / | JWT | Attendance.Edit | Create or update visit sessions |
| POST | /log | JWT | Attendance.Edit or Group Leader | Quick-log a person's attendance to a session. Automatically creates visit if needed. Group leaders can log attendance for their own groups |
| DELETE | /:id | JWT | Attendance.Edit | Delete a visit session by ID |
| DELETE | /?personId=&sessionId= | JWT | Attendance.Edit or Group Leader | Remove a person from a session. Deletes the visit session and the parent visit if no sessions remain. Group leaders can remove attendance for their own groups |
Example: Quick-Log Attendance
POST /attendance/visitsessions/log
Authorization: Bearer <token>
{
"personId": "person-001",
"visitSessions": [
{ "sessionId": "sess-001" }
]
}
{}
Example: Download Session Attendance
GET /attendance/visitsessions/download/sess-001
Authorization: Bearer <token>
[
{
"id": "vs-001",
"personId": "person-001",
"visitId": "visit-001",
"sessionDate": "2025-01-19T00:00:00.000Z",
"personName": "John Smith",
"status": "present"
},
{
"id": "",
"personId": "person-002",
"visitId": "",
"sessionDate": "2025-01-19T00:00:00.000Z",
"personName": "Jane Doe",
"status": "absent"
}
]
Streaks
Base path: /attendance/streaks
Tracks attendance streaks for individuals -- consecutive weeks a person has attended. Useful for engagement metrics and gamification.
| Method | Path | Auth | Permission | Description |
|---|---|---|---|---|
| GET | /person/:personId | JWT | — | Load attendance streaks for a person |
Related Pages
- Membership Endpoints — People, groups, roles, and church management
- Authentication & Permissions — Login flow, JWT, permission model
- Module Structure — Code organization patterns