Labosano API 1.0.0

Public REST API for Labosano. Authenticate with an API key created in the Labosano dashboard: send the base64-encoded key secret with HTTP Basic auth. Each key carries per-resource scopes like patients:read or appointments:write.

Base URL https://api.labosano.com
  • apiKey — HTTP Basic auth carrying only the API key secret: Authorization: Basic base64(<key secret>).
  • accessToken — Operator session token issued by the Labosano dashboard: Authorization: Token <access token>.

Download the OpenAPI specification

Appointments

GET/api/appointments

List appointments

Lists the appointments of your organization, every status included. A TO_SCHEDULE appointment has no times, so a startTime or endTime filter never returns one. Requires the appointments:read scope.

Authentication apiKey accessToken

Parameters

NameInTypeDescription
laboratoryId query string
patientId query string
startTime query string
endTime query string
fields query string Comma-separated projection of fields to return

Responses

StatusMeaning
200Array of appointments
401Missing or invalid credentials
403API key is missing the appointments:read scope
429API key rate limit exceeded
defaultError response

POST/api/appointments

Create an appointment

Requires the appointments:write scope. Fires the appointment.created webhook. An appointment created with status TO_SCHEDULE is a visit planned without a date: its startTime and endTime are removed, it may carry a planned duration, and it fires no webhook and does not count toward the monthly appointment limit until a later write gives it a date.

Authentication apiKey accessToken

Request body application/json

FieldTypeDescription
laboratoryId required string
patientId string
startTime string
endTime string
status string
duration integer Planned length in minutes of a TO_SCHEDULE appointment; null removes it.

Responses

StatusMeaning
200The created appointment
400An invalid body, such as a duration out of range
403API key is missing the appointments:write scope
defaultError response

GET/api/appointments/{appointmentId}

Get an appointment

Returns a single appointment by id. Appointments belonging to another organization respond 404. Requires the appointments:read scope.

Authentication apiKey accessToken

Parameters

NameInTypeDescription
appointmentId required path string

Responses

StatusMeaning
200The appointment
404Not found (or owned by another organization)
defaultError response

PUT/api/appointments/{appointmentId}

Update an appointment

Requires the appointments:write scope. Fires the appointment.updated webhook. Giving an appointment that has no date (TO_SCHEDULE, or canceled before it got one) any other status but CANCELED needs both startTime and endTime (otherwise 400); that first date counts the appointment toward the monthly limit and fires appointment.created instead. A write that leaves an appointment TO_SCHEDULE removes its times, and fires no webhook unless the appointment had a date before.

Authentication apiKey accessToken

Parameters

NameInTypeDescription
appointmentId required path string

Request body application/json

FieldTypeDescription
_id string
laboratoryId string
patientId string
startTime string
endTime string
status string REQUESTED | TO_SCHEDULE | SCHEDULED | PATIENT_ARRIVED | NO_SHOW | CANCELED TO_SCHEDULE is a visit planned without a date: it has no startTime or endTime, and becomes SCHEDULED when a write gives it both.
duration integer Planned length in minutes of an appointment still to schedule (TO_SCHEDULE).
bookingTime string When the appointment was booked: the moment one created without a date first got one, or the creation time of a dated one that moved back to TO_SCHEDULE. Set by the API, never by a client.
exams array
reminders array
lastEditTime string

Responses

StatusMeaning
200The updated appointment
404Not found (or owned by another organization)
defaultError response

DELETE/api/appointments/{appointmentId}

Delete an appointment

Requires the appointments:write scope. Fires the appointment.deleted webhook.

Authentication apiKey accessToken

Parameters

NameInTypeDescription
appointmentId required path string

Responses

StatusMeaning
200The deleted appointment
404Not found (or owned by another organization)
defaultError response

Invoices

GET/api/invoices

List invoices

Lists the invoices of your organization. Requires the invoices:read scope.

Authentication apiKey accessToken

Parameters

NameInTypeDescription
laboratoryId query string
patientId query string

Responses

StatusMeaning
200Array of invoices
403API key is missing the invoices:read scope
defaultError response

Laboratories

GET/api/laboratories

List laboratories

Lists the laboratories of your organization. Requires the laboratories:read scope.

Authentication apiKey accessToken

Responses

StatusMeaning
200Array of laboratories
403API key is missing the laboratories:read scope
defaultError response

Orders

GET/api/orders

List orders

Lists your organization's clinical order records. Requires the orders:read scope.

Authentication apiKey accessToken

Responses

StatusMeaning
200Array of orders
403API key is missing the orders:read scope
defaultError response

Patients

GET/api/patients

List patients

Lists the patients of your laboratory. Requires the patients:read scope.

Authentication apiKey accessToken

Parameters

NameInTypeDescription
laboratoryId query string
email query string
_ids query string Comma-separated list of patient ids
fields query string Comma-separated projection of fields to return
search query string Only live patients whose name holds every word of it, in any order, ignoring case and accents. limit and skip then page the matches.

Responses

StatusMeaning
200Array of patients
401Missing or invalid credentials
403API key is missing the patients:read scope
429API key rate limit exceeded
defaultError response

POST/api/patients

Create a patient

Creates a patient in your laboratory. Requires the patients:write scope. Fires the patient.created webhook.

Authentication apiKey accessToken

Request body application/json

FieldTypeDescription
laboratoryId required string
name string
email string
phone string

Responses

StatusMeaning
200The created patient
403API key is missing the patients:write scope
defaultError response

GET/api/patients/{patientId}

Get a patient

Returns a single patient by id. Patients belonging to another organization respond 404. Requires the patients:read scope.

Authentication apiKey accessToken

Parameters

NameInTypeDescription
patientId required path string

Responses

StatusMeaning
200The patient
404Not found (or owned by another organization)
defaultError response

PUT/api/patients/{patientId}

Update a patient

Requires the patients:write scope. Fires the patient.updated webhook.

Authentication apiKey accessToken

Parameters

NameInTypeDescription
patientId required path string

Request body application/json

FieldTypeDescription
_id string
laboratoryId string
name string
email string
phone string
language string
lastEditTime string

Responses

StatusMeaning
200The updated patient
404Not found (or owned by another organization)
defaultError response

DELETE/api/patients/{patientId}

Delete a patient

Requires the patients:write scope. Fires the patient.deleted webhook.

Authentication apiKey accessToken

Parameters

NameInTypeDescription
patientId required path string

Responses

StatusMeaning
200The deleted patient
404Not found (or owned by another organization)
defaultError response

Payments

GET/api/payments

List payments

Lists the payments of your organization. Requires the payments:read scope.

Authentication apiKey accessToken

Parameters

NameInTypeDescription
laboratoryId query string
patientId query string

Responses

StatusMeaning
200Array of payments
403API key is missing the payments:read scope
defaultError response

Webhook subscriptions

GET/api/webhooksubscriptions

List webhook subscriptions

Webhook subscriptions deliver patient.created, patient.updated, patient.deleted, appointment.created, appointment.updated, appointment.deleted, invoice.* and payment.* events to your server as signed POST requests (X-Labosano-Signature: t=<timestamp>,v1=<hex HMAC-SHA256 of "timestamp.body">). An endpoint failing 20 times in a row is disabled automatically. Subscriptions are managed with an operator access token; the secret is only returned once, on create.

Authentication accessToken

Responses

StatusMeaning
200Array of webhook subscriptions (without secrets)
defaultError response

POST/api/webhooksubscriptions

Create a webhook subscription

The response includes the signing secret exactly once — store it; it cannot be retrieved again.

Authentication accessToken

Request body application/json

FieldTypeDescription
laboratoryId required string
url required string
events array Empty array subscribes to all events

Responses

StatusMeaning
200The created subscription, including its secret
defaultError response

PUT/api/webhooksubscriptions/{webhookSubscriptionId}

Update a webhook subscription

url, events and active are editable; the secret and laboratory are immutable. Re-enabling an auto-disabled endpoint is done by setting active back to true.

Authentication accessToken

Parameters

NameInTypeDescription
webhookSubscriptionId required path string

Responses

StatusMeaning
200The updated subscription (without secret)
defaultError response

DELETE/api/webhooksubscriptions/{webhookSubscriptionId}

Delete a webhook subscription

Delete a webhook subscription

Authentication accessToken

Parameters

NameInTypeDescription
webhookSubscriptionId required path string

Responses

StatusMeaning
200Deleted
defaultError response