POST

Appointments.Add

Create a doctor appointment for a customer from the staff CRM calendar (NEW APPOINTMENT). Respects Settings → Branches: when ON, branch+doctor required and create_doctor_appointment_by_api is used; when OFF, branch is not required (stored as 0) via api_add_appointment.

Permissions

  • User must be logged in with a valid bearer token.
  • The user must be from the same company domain as the request Host (call the API on that account subdomain or allowed custom domain). A token from another company returns success=0, error user_not_in_company.
  • Returned or changed records are limited by the user permissions, team access, folder access, and account settings.

Action

  • Creates a Appointments record or sends the requested data after validation.

Push Service

No push is sent because this function only reads data or returns helper information.

Automation

No automation is run for this function.

Special Instructions

  • On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
  • Staff/org Bearer token required. Customer portal booking stays on Customer.Appointments.Add.
  • Respects dashboard Settings → Branches (show_branches_status): ON requires branch + doctor_id.
  • branch_status optional: 0=Came to branch, 1=Enter, 2=Finished.

Required Parameters

NameTypeSampleExplanation
cust_id
post
int1443Customer id. Aliases: customer_id, client_id.
appointments_type_id
post
int699Appointment type / service. Alias: appointment_type_id.
date
post
date2026-10-13Appointment date Y-m-d. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part.
start_time
post
string09:00Start time HH:MM.
end_time
post
string09:30End time HH:MM.

Optional Parameters

NameTypeSampleWhat it gives
branch
post
int38Required when Branches module ON. Aliases: branch_id, appointment_branch_id.
doctor_id
post
int211Required when Branches module ON. Alias: team_member_id.
appointment_room_id
post
int7Room id (auto-picked when omitted if type/branch has rooms).
branch_status
post
int00=Came to branch, 1=Enter, 2=Finished.
patient_name
post
stringJohnPatient name.
notes
post
stringNotes.
insurance
post
int26Insurance company id.
lang
post
stringenLanguage for PHP messages.

Authentication

Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/Appointments.Add",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "cust_id": "1443",
        "branch": "38",
        "appointments_type_id": "699",
        "doctor_id": "211",
        "date": "2026-10-13",
        "start_time": "09:00",
        "end_time": "09:30",
        "branch_status": "0"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Appointments.Add",
    "url_domain": "https:\/\/{domain}\/app\/Appointments.Add"
}

Endpoint

POST /app/Appointments.Add
POST https://{user}.bull36.com/app/Appointments.Add
POST https://{domain}/app/Appointments.Add

Sample Output

{
    "success": 1,
    "message": "Success",
    "doctor_appointment_for_cust_id": 6550636
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('cust_id', '1443');
body.set('branch', '38');
body.set('appointments_type_id', '699');
body.set('doctor_id', '211');
body.set('date', '2026-10-13');
body.set('start_time', '09:00');
body.set('end_time', '09:30');
body.set('branch_status', '0');

const res = await fetch('/app/Appointments.Add', {
  method: 'POST',
  headers: { Authorization: `Bearer ${token}` },
  body
});
const data = await res.json();
console.log(data);

Error Example

{
    "success": 0,
    "message": "This doctor does not handle this type of appointment."
}