API reference
Entities
CRUD for the things FlexiScheduler schedules — participants, staff, vehicles, rooms. Includes bulk operations and relationship management.
Key points
- An entity is anything the engine schedules — people, resources, places
- Every entity has a typed entityType from your template, plus core and custom attributes
- Most write endpoints require x-template-id in addition to x-organization-id
- Deletes are soft (deactivate) by default; hard deletes happen via cascade rules
- Bulk operations process up to 100 entities per call, returning per-item status
About entities
Entities are typed records — staff, participant, vehicle, room, physician, etc. — defined by your template. Each entity has a stable id, an entityType that determines which constraints apply, and structured attributes that the engine evaluates against during scheduling.
Two attribute buckets:
coreAttributes— fields the template declares for this entity type (skills, certifications, mobility requirements, etc.). The engine reads these during constraint evaluation.customAttributes— organization- specific fields that don’t map to template constraints. Useful for storage but not evaluated by the engine.
See Core concepts for how entities relate to events, resources, and templates.
Create entity
/api/v1/entitiesCreate a single entity. Use the bulk endpoint for batches.
Headers
x-organization-idUUIDrequiredOrganization the entity belongs to
x-template-idstringrequiredTemplate ID — determines which entityTypes are valid
Request body
Required: entityType, displayName. Other fields optional but typically populated.
{
"entityType": "staff",
"displayName": "Jane Smith",
"coreAttributes": {
"skills": ["wound_care", "iv_therapy"],
"certifications": ["RN", "CPR"],
"languages": ["en", "es"]
},
"customAttributes": {
"employeeId": "EMP-001",
"department": "Home Care"
},
"email": "jane.smith@example.com",
"phone": "+1-555-123-4567",
"defaultAvailabilityPatternKey": "standard_weekday_9to5"
}Responses
201Entity created. Returns full EntityResponseDto.{
"id": "ent_a8f4c2d1-...",
"organizationId": "org-12345",
"templateId": "home_care_scheduling_v1",
"entityType": "staff",
"displayName": "Jane Smith",
"status": "active",
"email": "jane.smith@example.com",
"phone": "+1-555-123-4567",
"coreAttributes": {
"skills": ["wound_care", "iv_therapy"],
"certifications": ["RN", "CPR"]
},
"customAttributes": {
"employeeId": "EMP-001",
"department": "Home Care"
},
"createdAt": "2026-04-26T15:30:00.000Z",
"updatedAt": "2026-04-26T15:30:00.000Z"
}400Validation error — missing required field, unknown entityType, malformed attributes.409Duplicate detected — typically email or external ID collision.List entities
/api/v1/entitiesPaginated list of entities for the organization. Supports filtering by type, status, search, and template scope.
Headers
x-organization-idUUIDrequiredOrganization scope
x-template-idstringrequiredTemplate ID to scope the listing
Query parameters
entityTypestringFilter to a single entity type e.g. staff
statusenumFilter by status e.g. active | inactive | pending | suspended
searchstringFree-text search across displayName, email, and core attribute string fields
limitintegerMax results (default 20, max 100)
offsetintegerPagination offset (default 0)
orderBystringSort field — displayName, createdAt, or updatedAt
orderDirectionenumasc or desc
Responses
200Paginated entity list{
"items": [
{ "id": "ent_a8f4...", "displayName": "Jane Smith", "entityType": "staff", "status": "active", ... },
{ "id": "ent_b29f...", "displayName": "Mike Reyes", "entityType": "staff", "status": "active", ... }
],
"total": 47,
"limit": 20,
"offset": 0
}Get entity
/api/v1/entities/{entityId}Retrieve a single entity by ID.
Headers
x-organization-idUUIDrequiredOrganization scope
Path parameters
entityIdstringrequiredEntity ID returned from create or list
Responses
200Entity returned{
"id": "ent_a8f4c2d1-...",
"organizationId": "org-12345",
"templateId": "home_care_scheduling_v1",
"entityType": "staff",
"displayName": "Jane Smith",
"status": "active",
"email": "jane.smith@example.com",
"phone": "+1-555-123-4567",
"coreAttributes": {
"skills": ["wound_care", "iv_therapy"],
"certifications": ["RN", "CPR"]
},
"customAttributes": {
"employeeId": "EMP-001",
"department": "Home Care"
},
"createdAt": "2026-04-26T15:30:00.000Z",
"updatedAt": "2026-04-26T15:30:00.000Z"
}404Entity not found in this organization (or doesn’t exist)Update entity
/api/v1/entities/{entityId}Update entity attributes. Only fields present in the request body are updated; omitted fields are unchanged.
Headers
x-organization-idUUIDrequiredOrganization scope
x-user-idstringrequiredActing user ID for audit attribution
Path parameters
entityIdstringrequiredEntity to update
Request body
Partial update. Only displayName, coreAttributes, customAttributes, email, and phone are mutable.
{
"displayName": "Jane Smith (Senior)",
"coreAttributes": {
"skills": ["wound_care", "iv_therapy", "palliative_care"],
"certifications": ["RN", "CPR"]
}
}Responses
200Entity updated successfully{
"id": "ent_a8f4c2d1-...",
"organizationId": "org-12345",
"templateId": "home_care_scheduling_v1",
"entityType": "staff",
"displayName": "Jane Smith",
"status": "active",
"email": "jane.smith@example.com",
"phone": "+1-555-123-4567",
"coreAttributes": {
"skills": ["wound_care", "iv_therapy"],
"certifications": ["RN", "CPR"]
},
"customAttributes": {
"employeeId": "EMP-001",
"department": "Home Care"
},
"createdAt": "2026-04-26T15:30:00.000Z",
"updatedAt": "2026-04-26T15:30:00.000Z"
}404Entity not foundentityType is immutable
entityType, that type can’t be changed. If you need a different type, deactivate this entity and create a new one. This constraint exists because changing type would invalidate every constraint that runs against the entity.Deactivate entity
/api/v1/entities/{entityId}Soft-delete (deactivate) an entity. Status moves to inactive; existing events referencing the entity are not modified.
Headers
x-organization-idUUIDrequiredOrganization scope
x-user-idstringrequiredActing user ID for audit attribution
Path parameters
entityIdstringrequiredEntity to deactivate
Query parameters
reasonstringOptional human-readable reason captured in the audit log
Responses
204Deactivated; no response body404Entity not foundBulk operations
Three bulk endpoints handle batches of up to 100 entities per call. Each item processes independently — partial success is normal, and the response reports per-item status.
Bulk create
/api/v1/entities/bulkCreate up to 100 entities in a single request. Each item processes independently.
Headers
x-organization-idUUIDrequiredOrganization scope
x-template-idstringrequiredTemplate ID
x-user-idstringrequiredActing user ID for audit
Request body
Array of entity objects, max 100 per call.
{
"entities": [
{
"entityType": "staff",
"displayName": "Carla Mendez",
"coreAttributes": { "skills": ["wound_care"] },
"email": "carla.m@example.com"
},
{
"entityType": "staff",
"displayName": "Tom Kim",
"coreAttributes": { "skills": ["physical_therapy"] },
"email": "tom.k@example.com"
}
]
}Responses
200Bulk create completed; check per-item status{
"results": [
{ "index": 0, "status": "created", "entityId": "ent_a8f4..." },
{ "index": 1, "status": "failed", "error": { "code": "DUPLICATE_EMAIL", "message": "..." } }
],
"summary": { "total": 2, "succeeded": 1, "failed": 1 }
}400Request shape invalid (e.g. > 100 items, malformed envelope)Bulk update and deactivate
PUT /api/v1/entities/bulk and DELETE /api/v1/entities/bulk follow the same shape — array of items, per-item processing, per-item status in the response. The update body matches UpdateEntityDto per item; the deactivate body needs only entity IDs.
Bulk failures don’t roll back
Relationships
Entities can reference each other through typed relationships — a participant’s primary caregiver, a staff member’s supervisor, a vehicle’s assigned driver. Relationships are first-class API resources nested under the entity.
Create relationship
/api/v1/entities/{entityId}/relationshipsCreate a relationship from entityId to another entity.
Headers
x-organization-idUUIDrequiredOrganization scope
x-user-idstringrequiredActing user ID for audit
Path parameters
entityIdstringrequiredSource entity (the "from" side)
Request body
Specify the target entity, the relationship type, and any optional metadata.
{
"toEntityId": "ent_caregiver_882",
"type": "primary_caregiver",
"metadata": {
"since": "2025-11-01"
}
}Responses
201Relationship created400Invalid relationship type or missing toEntityIdList, get, update, delete
The other relationship endpoints follow standard CRUD conventions:
GET /api/v1/entities/{entityId}/relationships— list with filterstype,active, plus paginationGET /api/v1/entities/{entityId}/relationships/{relationshipId}— get single relationshipPUT /api/v1/entities/{entityId}/relationships/{relationshipId}— update metadataDELETE /api/v1/entities/{entityId}/relationships/{relationshipId}— hard-delete (relationships don’t soft-delete; they go away)