Skip to main content
POST
Bulk create sessions

Bulk Create Sessions

Create a batch of up to 100 non-recurring sessions (appointments) in a single request, in the organization that owns the API key. The batch is all-or-nothing. Every element is validated with the exact same rules as Create Session. If any element fails validation, nothing is created and the response lists every failing session by its index in the sessions array. Only when all elements are valid are they created together inside one transaction.

Headers

Request

Wrap the sessions in a sessions array. Each item has the same shape and rules as the single create request (billable vs non-billable, time fields, field requirements). See Create Session for the per-session contract.
  • sessions — array, 1 to 100 items. Fewer than 1 or more than 100 is rejected with a schema validation error.

Success Response (201)

The created sessions are returned in request order, with a convenience count.

Error Responses

400 - Bad Request

Two distinct shapes are returned under 400: Domain validation failure — one or more sessions failed the same rules as single create (missing required fields for the chosen mode, endTime not after startTime, duration over 8 hours, invalid calendar date, place of service not allowed by a service line, a technicianId whose role cannot deliver a session, a clientId that is not a patient, a clinicianId that is not a clinical role, a technician on a non-technician service line, or a reference to an entity that does not exist in the organization). Nothing is created. Each failure is indexed:
Schema validation failure — the request body itself is malformed (missing sessions, empty array, more than 100 items, or a field with the wrong type):
Each entry’s path is an array of segments; for a bad field inside a specific session it points at the item, for example ["sessions", 0, "technicianId"].

401 - Unauthorized

403 - Forbidden

Examples

cURL

JavaScript Example

Authorizations

Authorization
string
header
required

API key authentication. Include your API key in the Authorization header as 'Bearer '

Body

application/json

Payload for atomically creating a batch of non-recurring sessions. The batch is all-or-nothing: every element is validated with the exact same rules as a single create, and if any element fails, nothing is written and every failure is returned by index.

sessions
object[]
required

The sessions to create, 1 to 100 items. Each item has the same shape and rules as the single create request.

Required array length: 1 - 100 elements

Response

All sessions created

Result of a successful bulk create: the created sessions in request order plus the total count.

sessions
object[]
required

A scheduled session (appointment). The shape depends on isBillable: billable sessions expose isTelehealth, clinicianId and services; non-billable sessions expose nonBillableCode instead.

count
integer
required

Number of sessions created.

Example:

2