Create
Either patient_id or patient object is required. In order to create an appointment for an existing patient, patient_id can be utilized. During appointment creation, patient object can be used to create a new patient.
POST
/:tenantId/appointmentsBody
json
{
"user_id": 1,
"patient_id": 1,
"start_date": "2024-03-30 12:15",
"end_date": "2024-03-30 12:45",
"note": "",
"notify": 1,
"status": 1,
"appointment_type_id":"1",
"visit_type": 0,
"conflict_strategy": "strict",
"is_walk_in_visit": false,
"patient": {
"first_name": "john",
"last_name": "doe",
"mobile": "+33 7 67 43 74 55",
"external_id": "mdb-patient-123"
},
"source": "medibulut",
"external_id": "mdb-appointment-123",
"recurrence_rule": {
"frequency": 2,
"interval": 1,
"days_of_week": [1, 3],
"ends_at": "2026-12-31"
}
}| Key | Type | Required | Description |
|---|---|---|---|
| user_id | integer | yes | ID of the user associated with the appointment. |
| patient_id | integer | yes | ID of the patient associated with the appointment. |
| start_date | datetime | yes | The starting date and time of the appointment. Format YYYY-MM-DD HH:mm |
| end_date | datetime | yes | The ending date and time of the appointment. Format YYYY-MM-DD HH:mm |
| note | string | no | Additional notes for the appointment |
| notify | integer | no | Indicates if notifications are enabled. Sends notification SMS and emails to patients when enabled. 0: Disabled (default) 1: Enabled |
| status | integer | no | Status of the appointment. See appointment statuses 1: NO SHOW 2: ATTENDED 3: CANCELLED 4: WAITING 5: CONFIRMED |
| appointment_type_id | integer | yes | ID indicating the type of appointment. |
| patient.first_name | string | yes | First name of the patient. |
| patient.last_name | string | yes | Last name of the patient. |
| patient.mobile | string | no | Mobile number of the patient. |
| patient.external_id | string | no | External identifier for the patient. |
| source | string | no | The source of the record. |
| external_id | string | no | External identifier of the record. |
| visit_type | integer | no | Visit type: 0 in-person, 1 online. Online appointments require a patient and an eligible package. |
| conflict_strategy | string | no | strict applies schedule checks; force_create skips conflict and working-hour checks. |
| resource_id | integer | no | Active resource assigned to the appointment. |
| recurrence_rule | object | no | Recurrence definition. Use frequency (1 day, 2 week, 3 month, 4 year) and exactly one of ends_at or count. |
| recurrence_rule.interval | integer | no | Recurrence interval, minimum 1. |
| recurrence_rule.days_of_week | integer[] | no | Weekday values from 0 to 6. |
| is_walk_in_visit | boolean | no | Marks the appointment as a walk-in visit. |
Response
HTTP 201 Created
json
{
"data": {
"id": 1,
"start_date": "2024-03-30T12:15:00.000000Z",
"end_date": "2024-03-30T12:45:00.000000Z",
"note": null,
"user": {
"id": 1,
"name": "John Doe",
"photo": null,
"color": "#abcdef"
},
"patient": {
"id": 1,
"is_deleted": false,
"mobile": "+1234567890",
"name": "Jane Doe",
"sms_consent": 2,
"photo": null
},
"appointment_type_id": 1,
"status": 1,
"notify": 1,
"resource_id": null,
"kind": 0,
"visit_type": 0,
"online_meeting": null,
"source": "medibulut",
"parent_id": null,
"has_children_recurrences": true,
"is_walk_in_visit": false
}
}HTTP 422 Unprocessable Content
json
{
"message": "Must specify a valid user (and 1 more error)",
"errors": {
"user_id": [
"Must specify a valid user"
],
"patient_id": [
"The selected patient id is invalid."
]
}
}