Skip to content

API reference

Waitlist

Manage waitlist entries. Add entities with priority and requirements; find matches; fulfill entries with events; notify when slots open.

Key points

  • Waitlist entries describe an unfulfilled scheduling request — entity, event type, time range, requirements
  • Higher priority entries get matched first when slots open
  • Auto-fulfillment is configured at the template level; manual fulfillment goes through POST /fulfill
  • Entries expire automatically; cancelled entries don’t auto-fulfill

About waitlist

The waitlist holds entries that couldn’t be scheduled immediately — usually because no slot matched the requirements at the time of request. When a matching slot opens (a cancellation, a new pattern, capacity changes), the engine can auto-fulfill or notify per template configuration.

Two fulfillment models:

  • Auto-fulfill — the engine watches for matching slots and books them automatically. Configured at the template level.
  • Manual fulfill — the engine notifies a dispatcher; the dispatcher reviews matches and fulfills explicitly via POST /fulfill.

Add to waitlist

POST/api/v1/waitlist

Add an entity to the waitlist for an event type with preferences and requirements.

Headers

  • x-organization-idUUIDrequired

    Organization scope

  • x-template-idstringrequired

    Template ID

Request body

Required: requestedEntityId, eventType, preferredDateRange, durationMinutes. Priority and requirements are optional.

{
  "requestedEntityId": "ent_participant_001",
  "eventType": "home_visit",
  "preferredDateRange": {
    "startDate": "2026-05-01",
    "endDate": "2026-05-31"
  },
  "durationMinutes": 60,
  "priority": 5,
  "requirements": {
    "preferredStaffId": "ent_staff_a8f4",
    "morningOnly": true
  },
  "notes": "Patient prefers morning appointments",
  "expiresAt": "2026-05-01T00:00:00Z"
}

Responses

201Entry added
{
  "id": "wait_a8f4c2d1-...",
  "requestedEntityId": "ent_participant_001",
  "eventType": "home_visit",
  "status": "pending",
  "priority": 5,
  "preferredDateRange": {
    "startDate": "2026-05-01",
    "endDate": "2026-05-31"
  },
  "durationMinutes": 60,
  "addedAt": "2026-04-26T15:30:00.000Z",
  "expiresAt": "2026-05-01T00:00:00Z",
  "lastNotifiedAt": null,
  "fulfilledEventId": null
}
400Invalid request payload

List waitlist

GET/api/v1/waitlist

Paginated list of waitlist entries. Filter by status, entity, or event type.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Query parameters

  • statusenum

    pending, notified, fulfilled, cancelled, expired

  • entityIdUUID

    Filter by entity

  • eventTypestring

    Filter by event type

  • limitinteger

    Default 20, max 100

  • offsetinteger

    Default 0

Responses

200Paginated waitlist entries

Find matches

GET/api/v1/waitlist/pending/match

Find available slots that satisfy a waitlist entry’s requirements. Use to surface candidate slots to dispatchers.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Query parameters

  • waitlistIdstringrequired

    Waitlist entry to match

Responses

200Matching slots ranked by suitability
{
  "matches": [
    {
      "startTime": "2026-05-08T10:00:00Z",
      "endTime": "2026-05-08T11:00:00Z",
      "score": 0.95,
      "satisfiesRequirements": true,
      "matchReason": "Preferred staff available, morning slot"
    }
  ]
}
404Waitlist entry not found

Get entry

GET/api/v1/waitlist/{waitlistId}

Retrieve a single waitlist entry.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Path parameters

  • waitlistIdstringrequired

    Entry ID

Responses

200Entry details
{
  "id": "wait_a8f4c2d1-...",
  "requestedEntityId": "ent_participant_001",
  "eventType": "home_visit",
  "status": "pending",
  "priority": 5,
  "preferredDateRange": {
    "startDate": "2026-05-01",
    "endDate": "2026-05-31"
  },
  "durationMinutes": 60,
  "addedAt": "2026-04-26T15:30:00.000Z",
  "expiresAt": "2026-05-01T00:00:00Z",
  "lastNotifiedAt": null,
  "fulfilledEventId": null
}
404Waitlist entry not found

Cancel entry

DELETE/api/v1/waitlist/{waitlistId}

Cancel a waitlist entry. Status flips to cancelled; auto-fulfillment stops considering this entry.

Headers

  • x-organization-idUUIDrequired

    Organization scope

  • x-user-idstringrequired

    Acting user for audit

Path parameters

  • waitlistIdstringrequired

    Entry to cancel

Responses

204Cancelled; no response body
404Waitlist entry not found

Fulfill entry

POST/api/v1/waitlist/{waitlistId}/fulfill

Fulfill a waitlist entry by linking it to an event that satisfies its requirements. Status flips to fulfilled.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Path parameters

  • waitlistIdstringrequired

    Entry to fulfill

Request body

Provide the event that fulfills this entry. notifyEntity controls whether the entity is notified about fulfillment.

{
  "eventId": "evt_b29f4e58-...",
  "notifyEntity": true
}

Responses

200Entry fulfilled successfully
400Waitlist entry is not in a fulfillable state
404Waitlist entry not found

Notify entry

POST/api/v1/waitlist/{waitlistId}/notify

Notify the waitlist entry about available slots. Marks the entry as notified; uses configured notification channels.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Path parameters

  • waitlistIdstringrequired

    Entry to notify

Responses

200Notification sent and entry marked as notified
404Waitlist entry not found

Notify is a workflow step, not a one-shot send

Calling notify marks the entry as notified and starts a response window. If the entity confirms within the configured response timeout, the entry can be auto-fulfilled. If they decline or time out, the next-priority entry is considered. Don’t call notify repeatedly — use the notification status as state.