Skip to main content

API Documentation

The HCSS Events Platform API uses OpenAPI 3.0 for API specification and Scalar UI for interactive documentation.

Accessing API Docs

Local Development

Once the backend is running (dotnet run from src/HCSS.EventsCore.WebApi):

InterfaceURLPurpose
Scalar UIhttp://localhost:5234/scalar/v1Interactive API explorer (recommended)
OpenAPI JSONhttp://localhost:5234/swagger/v1/swagger.jsonRaw spec for Postman/Insomnia import

Production

API documentation is only available in the Development environment for security reasons. For production API reference, use this documentation site.

Authentication

Most API endpoints require JWT Bearer authentication.

Getting a Token

POST /api/auth/login
Content-Type: application/json

{
"email": "your-email@example.com",
"password": "your-password"
}

The response includes a token field. Use it in subsequent requests:

Authorization: Bearer <your-token>

Using Authentication in Scalar UI

  1. Click the Authorize button in Scalar UI
  2. Enter Bearer <your-token> in the authorization field
  3. All subsequent requests will include the token

API Versioning

The API uses URL-based versioning:

/api/v1/events
/api/v1/caregivers

Current version: v1

Common Patterns

List Endpoints

List endpoints support pagination, filtering, and sorting:

GET /api/v1/events?page=1&pageSize=25&sortBy=name&sortDirection=asc

CRUD Operations

MethodStatus CodeDescription
GET /resources200List resources
GET /resources/{id}200Get single resource
POST /resources201Create resource
PUT /resources/{id}200Update resource
DELETE /resources/{id}204Delete resource

Error Responses

Errors follow RFC 7807 Problem Details format:

{
"type": "https://tools.ietf.org/html/rfc7807",
"title": "Validation Error",
"status": 400,
"detail": "One or more validation errors occurred.",
"errors": {
"Name": ["The Name field is required."]
}
}

Key API Modules

ModuleBase PathEndpoints
Authentication/api/authLogin, register, refresh, MFA
Events/api/v1/eventsCRUD, status management
Caregivers/api/v1/caregiversCRUD, import, export
Candidates/api/v1/events/{id}/candidatesPool management
Assignments/api/v1/assignmentsCRUD, bulk operations
Surveys/api/v1/surveysTemplates, campaigns, responses
Travel/api/v1/travelBooking, itineraries
Compliance/api/v1/complianceTemplates, packets, audit
Users/api/v1/usersUser management
Analytics/api/v1/analyticsReports, dashboards