Skip to main content

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.

MethodPathAuthPermissionDescription
GET/JWTList all campuses for the church
GET/:idJWTGet a campus by ID
POST/JWTServices.EditCreate or update campuses
DELETE/:idJWTServices.EditDelete 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.

MethodPathAuthPermissionDescription
GET/JWTList all services (includes campus info)
GET/:idJWTGet a service by ID
GET/search?campusId=JWTSearch services by campus ID
POST/JWTServices.EditCreate or update services
DELETE/:idJWTServices.EditDelete 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.

MethodPathAuthPermissionDescription
GET/JWTList all service times. Filter by ?serviceId=. Add ?include=groups to append group data
GET/:idJWTGet a service time by ID
GET/search?campusId=&serviceId=JWTSearch service times by campus and service
POST/JWTServices.EditCreate or update service times
DELETE/:idJWTServices.EditDelete a service time

Group Service Times

Base path: /attendance/groupservicetimes

Links groups to specific service times.

MethodPathAuthPermissionDescription
GET/JWTList all group-service-time associations. Filter by ?groupId= to get associations with service names
GET/:idJWTGet a group-service-time association by ID
POST/JWTServices.EditCreate or update group-service-time associations
DELETE/:idJWTServices.EditDelete a group-service-time association

Attendance Records

Base path: /attendance/attendancerecords

Provides read-only aggregate views of attendance data for reporting and display.

MethodPathAuthPermissionDescription
GET/JWTAttendance.ViewLoad attendance records for a person. Requires ?personId=
GET/treeJWTLoad the full attendance tree (campuses, services, service times, groups)
GET/trend?campusId=&serviceId=&serviceTimeId=&groupId=JWTAttendance.View SummaryLoad attendance trend data with optional filters
GET/groups?serviceId=&week=JWTAttendance.ViewLoad group attendance for a service on a given week
GET/search?campusId=&serviceId=&serviceTimeId=&groupId=&startDate=&endDate=JWTAttendance.ViewSearch 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.

MethodPathAuthPermissionDescription
GET/JWTAttendance.View or Group LeaderList all sessions. Filter by ?groupId= (includes names). Group leaders can view sessions for their own groups
GET/:idJWTAttendance.ViewGet a session by ID
POST/JWTAttendance.Edit or Group LeaderCreate or update sessions. Group leaders can save sessions for their own groups
DELETE/:idJWTAttendance.EditDelete a session

Visits

Base path: /attendance/visits

Manages individual visit records (a person attending on a specific date) and provides the check-in workflow.

MethodPathAuthPermissionDescription
GET/JWTAttendance.ViewList all visits. Filter by ?personId=
GET/:idJWTAttendance.ViewGet a visit by ID
GET/checkin?serviceId=&peopleIds=JWTAttendance.View or Attendance.CheckinLoad check-in data for people at a service. Returns visits with visit sessions from the last logged date
POST/JWTAttendance.EditCreate or update visits
POST/checkin?serviceId=&peopleIds=JWTAttendance.Edit or Attendance.CheckinSubmit check-in data. Creates/updates visits and visit sessions, removes stale records
DELETE/:idJWTAttendance.EditDelete 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" }
}
]
}
]

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.

MethodPathAuthPermissionDescription
GET/JWTAttendance.View or Group LeaderList visit sessions. Filter by ?sessionId=. Group leaders can view visit sessions for their own groups
GET/:idJWTAttendance.ViewGet a visit session by ID
GET/download/:sessionIdJWTAttendance.ViewDownload attendance for a session (returns person names with present/absent status)
POST/JWTAttendance.EditCreate or update visit sessions
POST/logJWTAttendance.Edit or Group LeaderQuick-log a person's attendance to a session. Automatically creates visit if needed. Group leaders can log attendance for their own groups
DELETE/:idJWTAttendance.EditDelete a visit session by ID
DELETE/?personId=&sessionId=JWTAttendance.Edit or Group LeaderRemove 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"
}
]