Skip to main content

Shifts

Overview

Shift endpoints handle scheduling, signups, and attendance tracking.

Endpoints

  • GET /api/v1/shifts — list shifts
  • POST /api/v1/shifts — create shift
  • GET /api/v1/shifts/{id} — shift details
  • POST /api/v1/shifts/{id}/signups — signup for a shift
  • POST /api/v1/shifts/{id}/checkin — check in
  • POST /api/v1/shifts/{id}/checkout — check out

Examples

# Signup for a shift
curl -X POST "{{baseUrl}}/api/v1/shifts/123/signups" \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"user_id":456}'

See also


GET /api/v1/shifts

Summary: List shifts across programs/orgs.

Responses

  • 200 — JSON object with items: Shift[]

Example

curl "{{baseUrl}}/api/v1/shifts"

POST /api/v1/shifts

Summary: Create a new shift.

Request

  • Body: CreateShiftRequest

Responses

  • 200CreateResponse with new shift id

Example

curl -X POST "{{baseUrl}}/api/v1/shifts" \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"program_id":123,"start_time":"2025-12-01T09:00:00Z","end_time":"2025-12-01T12:00:00Z"}'

GET /api/v1/shifts/{id}

Summary: Retrieve shift details by ID.

Responses

  • 200Shift object

Example

curl "{{baseUrl}}/api/v1/shifts/456"

POST /api/v1/shifts/{id}/signups

Summary: Signup a user for a shift.

Request: SignupRequest

Responses

  • 200SuccessResponse

Example

curl -X POST "{{baseUrl}}/api/v1/shifts/456/signups" \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"user_id":789}'

DELETE /api/v1/shifts/{id}/signups

Summary: Cancel the authenticated Volunteer's signup. The optional JSON body accepts a reason (up to 1,000 characters) and a self-service source; both are retained in the audit trail.

Responses: 204 — signup cancelled after capacity and waitlist reconciliation is evaluated.


POST /api/v1/shifts/{destinationId}/signups/change

Summary: Change the authenticated Volunteer's registration to another shift for the same Mission.

Request body: { current_shift_id: integer, role_id?: integer, role_key?: string }

Responses: 200 — original registration cancelled and destination active or pending approval; 409 — policy, availability, capacity, or schedule conflict prevents the change; 412 — required profile fields or Mission requirements are incomplete.


POST /api/v1/shifts/{id}/checkin

Summary: Record a user check-in for a shift.

Request body: { user_id: integer, metadata?: object }

Responses: 200SuccessResponse

Example

curl -X POST "{{baseUrl}}/api/v1/shifts/456/checkin" \
-H 'Content-Type: application/json' \
-d '{"user_id":789}'

POST /api/v1/shifts/{id}/checkout

Summary: Record user checkout.

Responses: 200SuccessResponse


GET /api/v1/shifts/{id}/attendance

Summary: Retrieve attendance records for the shift.

Responses

  • 200items: AttendanceRecord[]

Example

curl "{{baseUrl}}/api/v1/shifts/456/attendance"