Nutrition
Back to site

Reference

Nutrition API

Every endpoint that powers the Nutrition app is available to call directly — whether you're building your own integration or connecting outside equipment (an imaging system, a lab scanner) straight into a patient's chart.

Getting started

Base URL

https://doctovaria.com.tr/api

Every request (aside from the auth endpoints themselves) must include an Authorization: Bearer <token> header. There are two ways to get a token:

  1. User login. Complete the two-step OTP flow (POST /auth/login then POST /auth/login/verify-otp) to get a token tied to a staff account's own session.
  2. API token (recommended for integrations). Log into the app once, open Settings → API Token, and create a named token. This is the right choice for a script or an outside machine that isn't a person logging in — it doesn't expire on its own and can be revoked independently at any time.

All responses share one envelope: {"{"}"message": string, "data": ...{"}"}. Validation errors return HTTP 422 with an additional errors object keyed by field name.

Example

curl https://doctovaria.com.tr/api/nutrition/clients \
  -H "Authorization: Bearer <your-api-token>" \
  -H "Accept: application/json"

Authentication

Every endpoint below except this group requires a Bearer token. Get one either by completing the two-step OTP login flow, or — for outside systems/integrations — by generating a long-lived token from Settings > API Token after logging into the app once.

POST /auth/login Public

Verifies mobile + password and issues an OTP login challenge (does not return a token yet).

Request

Field Type Notes
mobile string required
password string required
branch_code string optional

Response data

  • message string
  • otp_reference string
  • masked_mobile string
  • expires_at datetime
POST /auth/login/verify-otp Public

Confirms the OTP from login, creates a Sanctum token, and logs the user in.

Request

Field Type Notes
mobile string required
password string required
branch_code string optional
otp string required
otp_reference string optional

Response data

  • token string — Bearer token — send as Authorization: Bearer {token} on every subsequent request.
  • user User object
POST /auth/forgot-password Public

Issues an OTP to begin a password-reset flow.

Request

Field Type Notes
mobile string required

Response data

  • message string
  • otp_reference string
  • masked_mobile string
  • expires_at datetime
POST /auth/forgot-password/verify-otp Public

Marks the forgot-password OTP challenge as verified (must precede reset-password).

Request

Field Type Notes
mobile string required
otp string required
otp_reference string optional

Response data

  • message string
  • verified boolean
POST /auth/reset-password Public

Sets a new password once the forgot-password OTP has been verified.

Request

Field Type Notes
mobile string required
otp_reference string required
new_password string required — min 8, must include an uppercase letter, a lowercase letter, a number, and a symbol -- confirmed by a matching new_password_confirmation field

Response data

  • message string
POST /auth/logout Bearer token

Revokes the current access token.

GET /auth/me Bearer token

Returns the authenticated user's profile, roles, and permissions.

Response data

  • (User object) — see Users group below

Users

Staff accounts belonging to your company (doctors, receptionists, managers). Creating/deleting other users, or updating someone other than yourself, requires the acting user to be a system manager or project admin.

GET /doctors Bearer token

Lists active doctors.

Response data

  • [User object] array
GET /users Bearer token

Lists the company's users.

Response data

  • [User object] array
POST /users Bearer token · manager/admin only 201 Created

Creates a new staff/doctor user (enforced against the subscription seat limit).

Request

Field Type Notes
name string required
email string required — unique
phone string optional
password string required — min 8, must include an uppercase letter, a lowercase letter, a number, and a symbol
branch_name string optional
status enum optional — active, inactive, suspended — defaults active
is_doctor boolean optional
notes string optional
role_ids integer[] optional
permission_ids integer[] optional

Response data

  • (User object)
GET /users/{id} Bearer token

Fetches a user's profile.

Response data

  • (User object)
PUT /users/{id} Bearer token · self, or manager/admin for others

Updates a user's profile/roles/permissions.

Request

Field Type Notes
(all fields from POST /users) all optional/"sometimes"

Response data

  • (User object)
DELETE /users/{id} Bearer token · manager/admin only

Deletes a user.

User object fields

  • id, uuid
  • company_id, company_name
  • name, email, phone (mobile is an alias of phone)
  • branch_name
  • status (UserStatus)
  • is_project_admin, is_doctor
  • notes
  • last_login_at
  • roles: [{id, name, slug}]
  • permissions: [{id, name, slug}]

Activity Log

System manager/admin only. Every AuditLog row for your company across every audited model (patients, appointments, visits, payments, accounting, password changes, ...), newest first, 100 per page.

GET /activity-log Bearer token · system manager/admin only

Lists the company-wide activity log, filterable and paginated.

Request

Field Type Notes
user_id integer optional — one specific user
role enum optional — doctor|staff
client_id integer optional — actions related to one patient
date_from date optional
date_to date optional
category enum optional — patient|appointment|visit|payment|prescription|lab|xray|consent|accounting|user|clinical
action enum optional — created|updated|deleted|password_changed|exported|erasure_requested — 'viewed' rows are never included -- too high-volume to be useful here

Response data

  • [ActivityLog object] array — paginated: data/links/meta, 100 per page

ActivityLog object fields

  • id, created_at
  • action
  • category
  • user: {id, name, is_doctor, role} | null
  • client: {id, name} | null
  • subject_label (string|null -- e.g. vendor/party/employee name for non-patient entries)
  • changed_fields: string[] | null
  • ip_address

Companies & Pricing

Your clinic's profile, subscription history, and the price list used for services and odontogram procedures.

GET /companies/{id} Bearer token

Fetches company profile with subscription/user-count summary.

Response data

  • id, uuid, name, code, email, phone, address, status, notes
  • users_count, active_users_count integer
  • latest_active_subscription Subscription object | null
GET /companies/{id}/subscriptions Bearer token

Lists the company's subscription history.

Response data

  • id, company_id, plan_name
  • status enum (active, inactive)
  • starts_at, ends_at date
  • max_doctors, max_assistants, active_users, max_ai_tokens, ai_tokens_used, price number
  • is_currently_active boolean
GET /companies/{id}/treatment-products Bearer token

Lists every priced item: company-managed services and odontogram-widget procedures.

Response data

  • id, company_id, scope (company|odontogram), code
  • name, name_ar, name_en, name_tr string
  • price, unit_price number
  • status string (active|inactive)
POST /companies/{id}/treatment-products Bearer token 201 Created

Creates a new company-scoped treatment/service price entry.

Request

Field Type Notes
code string required
name_ar string required
name_en string required
name_tr string optional
price number required — min 0 (falls back to unit_price)
status string required — active|inactive

Response data

  • (product object, see index)
PUT /companies/{id}/treatment-products/{productId} Bearer token

Updates a product's price/name/status.

Request

Field Type Notes
(same fields as create)

Response data

  • (product object)
DELETE /companies/{id}/treatment-products/{productId} Bearer token

Deletes a treatment product (blocked if still referenced by a treatment record).

GET /companies/{id}/odontogram-treatment-prices Bearer token

A flat {code: price} map of every active odontogram-widget procedure price.

Response data

  • { "<code>": <price>, ... } object

Clients (Patients)

Patient records, shared by every specialty under its own URL prefix (e.g. /nutrition/clients, /gynecology/clients — dental's own is unprefixed). A doctor-acting user only ever sees/writes patients already claimed by them within their own specialty; see each specialty's own Clinical Profile / clinical-record group below for what's specific to it.

GET /nutrition/clients Bearer token

Lists/searches patients.

Request

Field Type Notes
name string (query) optional — partial match
phone string (query) optional — partial match
per_page integer (query) optional — 1–100. Omit for a flat array; include for {data, links, meta}.

Response data

  • id, uuid, client_code, name, phone, city
  • status enum (new, under_treatment, completed, inactive)
  • last_visit_at datetime | null
  • next_appointment Appointment object | null
POST /nutrition/clients Bearer token 201 Created

Registers a new patient.

Request

Field Type Notes
client_code string optional — auto-generated (CL-XXXXXXXX) if omitted, must be unique
name string required
email string optional
phone string required
gender enum required — male, female
age integer optional
date_of_birth date optional
city, address, medical_notes string optional
status enum optional — new, under_treatment, completed, inactive — defaults new

Response data

  • (Client object, see below)
GET /nutrition/clients/{id} Bearer token

Fetches a patient's full profile.

Response data

  • (Client object)
PUT /nutrition/clients/{id} Bearer token

Updates patient details.

Request

Field Type Notes
(same fields as create, all optional)

Response data

  • (Client object)
DELETE /nutrition/clients/{id} Bearer token

Deletes a patient record.

Client object fields

  • id, uuid, client_code, name, email, phone
  • gender (ClientGender), age, date_of_birth
  • city, address, medical_notes
  • status (ClientStatus)
  • last_visit_at
  • next_appointment: Appointment object | null
  • financial_summary: { total_services_amount, total_paid_amount, remaining_amount }

AI Assistant

Restricted to doctors (with ai_enabled) and system managers. A back-and-forth chat (not a one-shot description like dental) — the doctor converses freely, then asks the assistant to turn the conversation into a structured, multi-session plan, which is only persisted once confirmed. Every endpoint here shares the same shape across all 10 non-dental specialties — only the URL prefix changes.

GET /nutrition/clients/{id}/ai-conversation Bearer token · doctor/manager

Fetches the full chat history for this patient.

Response data

  • [AiConversationMessage object] array — {id, role (user|assistant), text, created_at}
POST /nutrition/clients/{id}/ai-conversation/messages Bearer token · doctor/manager · KVKK consent required

Sends one free-text chat message and gets the assistant's reply.

Request

Field Type Notes
text string required — max 4000

Response data

  • user_message, assistant_message AiConversationMessage object
POST /nutrition/clients/{id}/ai-treatment-plan/transcribe Bearer token · doctor/manager · KVKK consent required

Transcribes a voice recording to text (not counted against the AI token cap).

Request

Field Type Notes
audio file required

Response data

  • description string
POST /nutrition/clients/{id}/ai-treatment-plan/generate Bearer token · doctor/manager · KVKK consent required

Asks the assistant to turn the conversation so far into a draft multi-session plan (not yet persisted).

Request

Field Type Notes
text string optional — max 4000 — an optional last message to send before generating
doctor_id integer optional — required if the acting user is not a doctor

Response data

  • diagnosis_summary string
  • sessions array — up to 8, each: {date, start_time, duration_minutes, session_description, procedures}
  • diet_plan, exercise_plan string | null — nutrition only — free-text plan text
  • diet_plan_data, exercise_plan_data object | null — nutrition only — the same plan, table-shaped (see NutritionPlanStructure)
  • user_message, assistant_message AiConversationMessage object
POST /nutrition/clients/{id}/ai-treatment-plan/confirm Bearer token · doctor/manager 201 Created

Persists the (optionally edited) sessions as real, conflict-checked appointments.

Request

Field Type Notes
doctor_id integer optional
sessions array required — min 1, max 8, each: {date, start_time (H:i), duration_minutes (30|60|90), session_description, procedures[] ({procedure_code, notes}), charge_items[]}
diet_plan, exercise_plan string optional — nutrition only — max 20000
diet_plan_data, exercise_plan_data array optional — nutrition only — table-shaped plan, preferred over the free-text fields above when both are present

Response data

  • appointments, care_plan [Appointment object], CarePlan object | null

Doctor Schedule & Availability

Read a doctor's weekly working hours, or compute free/filled slots for a given day.

GET /doctors/{id}/schedule Bearer token

Fetches a doctor's weekly schedule (auto-created with 09:00–17:00/30-min defaults if none exists).

Response data

  • doctor_id, start_time (H:i), end_time (H:i), slot_minutes
  • working_days enum[] (monday, tuesday, wednesday, thursday, friday, saturday, sunday)
PUT /doctors/{id}/schedule Bearer token

Replaces a doctor's schedule.

Request

Field Type Notes
start_time, end_time string (H:i) required
slot_minutes integer required — 30|60|90
working_days enum[] required — monday, tuesday, wednesday, thursday, friday, saturday, sunday — min 1

Response data

  • (schedule object)
GET /doctors/{id}/availability Bearer token

Renders a full-day slot grid for a scheduling calendar.

Request

Field Type Notes
date date (query) required

Response data

  • doctor_id, date, slots — slots: [{time, status: free|filled, appointment}]
GET /doctors/{id}/available-start-times Bearer token

Lists valid start times for a new appointment.

Request

Field Type Notes
date date (query) required
duration_minutes integer (query) required — 30|60|90

Response data

  • start_times string[] (H:i)
GET /doctors/{id}/available-durations Bearer token

Given a start time, tells which durations would fit without conflict.

Request

Field Type Notes
date date (query) required
start_time string H:i (query) required

Response data

  • durations array — [{value: 30|60|90, available: boolean}]

Appointments

Booking, rescheduling, and cancelling — the same fields as dental, minus the check-in/no-show actions (no Visit step outside dental).

GET /nutrition/appointments Bearer token

Lists/filters appointments across the clinic.

Request

Field Type Notes
date_from, date_to date (query) optional
date date (query) optional — used only if date_from/date_to not both given
doctor_id, client_id integer (query) optional
status string (query) optional
per_page integer (query) optional — 1–100, default 20

Response data

  • [Appointment object] array
POST /nutrition/appointments Bearer token 201 Created

Books a new appointment, or blocks out doctor unavailability.

Request

Field Type Notes
client_id integer optional — required if type=booked
doctor_id integer required
type enum required — booked, unavailable
status enum optional — scheduled, completed, no_show, cancelled — defaults scheduled
date date required
start_time string (H:i) required
duration_minutes integer required — 30|60|90
notes, planned_summary string optional
charge_items array optional

Response data

  • (Appointment object)
GET /nutrition/appointments/{id} Bearer token

Fetches a single appointment.

Response data

  • (Appointment object)
PUT /nutrition/appointments/{id} Bearer token

Reschedules/edits an appointment.

Request

Field Type Notes
(same as create, all optional, plus planned_notes)

Response data

  • (Appointment object)
DELETE /nutrition/appointments/{id} Bearer token

Deletes an appointment and any charges tied to it.

Appointment object fields

  • id, uuid, client_id, client_name, doctor_id, doctor_name
  • type (AppointmentType), status (AppointmentStatus)
  • date, start_time (H:i), end_time (H:i), duration_minutes
  • notes, planned_summary, planned_notes
  • action_state: "locked" | "manage" (computed — never "checkin" here)
  • is_past, is_future, is_within_one_hour (booleans)

Dashboard

GET /nutrition/dashboard/stats Bearer token

Appointment and income stats over a date range, optionally filtered to one doctor/branch.

Request

Field Type Notes
date_from, date_to date (query) required
doctor_id integer (query) optional
branch_id integer (query) optional

Response data

  • appointments.total, appointments.by_status object
  • income.total, income.by_method, income.by_day object — always zero outside dental today — no specialty but dental can record a Payment yet

Clinical Profile

Nutrition's standing, one-per-patient clinical profile — not repeating records, see Body Metrics and Diet/Exercise Plans below for those.

GET /nutrition/clients/{id}/profile Bearer token

Fetches the client's nutrition profile (auto-created empty on first call).

Response data

  • (profile object, see PUT below)
PUT /nutrition/clients/{id}/profile Bearer token

Updates the profile.

Request

Field Type Notes
height_cm, target_weight_kg number optional — 0–999.9
body_type string optional — athlete, non_athlete
dietary_type string optional — omnivore, vegetarian, vegan, halal, kosher, other
allergies, chronic_conditions string[] optional — free-text items, each max 255
medications_affecting_diet, notes string optional
smoking_status, alcohol_status string optional — none, occasional, regular
activity_level string optional — sedentary, light, moderate, active, very_active
goal string optional — weight_loss, weight_gain, maintenance, muscle_gain, medical_diet, other

Response data

  • (profile object)

Body Metrics

Repeating body-composition measurements (weight, BMI, segmental muscle/fat, etc.) — the InBody/Tanita-style report a device prints. Three ways to get a measurement in: a doctor types it in by hand (POST below), a doctor uploads a photo/PDF of the printed report and the AI pre-fills the form for review before saving (the extract endpoint — nothing is persisted by that call itself), or a body-composition device/system pushes the values directly (the device endpoint, further below) without a human in the loop.

GET /nutrition/clients/{id}/body-metrics Bearer token

Lists a patient's measurements, newest first.

Response data

  • [BodyMetric object] array
POST /nutrition/clients/{id}/body-metrics Bearer token 201 Created

Records a new measurement by hand (source is always set to "manual").

Request

Field Type Notes
recorded_at date required
weight_kg, bmi, obesity_degree_percent, body_fat_percent, body_fat_mass_kg, fat_free_mass_kg, muscle_mass_kg, smi, visceral_fat_rating, water_percent, total_body_water_liters, protein_kg, mineral_mass_kg, waist_cm, hip_cm, waist_hip_ratio number optional
weight_control_kg, fat_control_kg, muscle_control_kg number optional — signed — negative means "recommended to lose"
inbody_score, basal_metabolic_rate, metabolic_age, daily_calorie_need integer optional
right_arm_muscle_kg, left_arm_muscle_kg, right_arm_muscle_percent, left_arm_muscle_percent, right_arm_fat_percent, left_arm_fat_percent, right_arm_fat_kg, left_arm_fat_kg, right_leg_muscle_kg, left_leg_muscle_kg, right_leg_muscle_percent, left_leg_muscle_percent, right_leg_fat_percent, left_leg_fat_percent, right_leg_fat_kg, left_leg_fat_kg, trunk_muscle_kg, trunk_muscle_percent, trunk_fat_percent, trunk_fat_kg number optional — segmental fields — the *_percent ones are evaluated against a per-segment reference range, not a 0-100 share, so a report can print well past 100
notes string optional
visit_id, appointment_id integer optional
report file optional — multipart, pdf/jpg/jpeg/png/webp, max 20MB — attaches the original report for later download

Response data

  • (BodyMetric object)
POST /nutrition/clients/{id}/body-metrics/extract Bearer token · doctor/manager · KVKK consent required

Reads a photo/PDF of a device's printed report via OpenAI vision and returns the extracted values for the frontend to pre-fill the manual-entry form with. Nothing is persisted — the doctor still reviews/edits and calls POST .../body-metrics (above) to actually save it.

Request

Field Type Notes
report file required — multipart, pdf/jpg/jpeg/png/webp, max 20MB

Response data

  • (a flat object with the same field names as POST .../body-metrics above, whichever ones the AI could read)
PUT /nutrition/body-metrics/{id} Bearer token

Edits a measurement (recomputes bmi if weight_kg changes and a profile height is on file).

Request

Field Type Notes
(same fields as create, all optional)

Response data

  • (BodyMetric object)
DELETE /nutrition/body-metrics/{id} Bearer token

Deletes a measurement and its attached report file, if any.

POST /nutrition/companies/{companyId}/body-metrics Bearer token (integration token — Settings > API Token) 201 Created

Raw-values device/system integration endpoint: a body-composition analyzer (InBody, Tanita, etc.) pushes one measurement directly, as plain JSON values — no photo/PDF, no human in the loop. The device's own config screen only accepts ONE fixed URL per company, so the company is identified by its UUID in the URL while the patient is identified by inbody_id in the request body — the device's OWN patient id (never our client UUID), matched against that patient's "InBody ID" field (set once from the patient's profile in the app). If no patient has that InBody ID yet, a minimal placeholder patient is created automatically and the measurement is attached to it, so a reading is never dropped — the doctor fills in the real name/phone/gender afterwards from the Patients list. source is always forced to "device_import", regardless of anything sent. The integration token must belong to the company named in the URL (403 otherwise), and — same as every other per-patient endpoint — a doctor-scoped token can only post into its own claimed patients.

Request

Field Type Notes
inbody_id string required — the device's own patient id — max 50 chars
(every field POST .../body-metrics above accepts, except report — this endpoint never takes a file)

Response data

  • (BodyMetric object)

BodyMetric object fields

  • uuid, client_id, recorded_at, source (manual|device_import)
  • (every numeric field listed in the POST request above)
  • notes, report_original_filename
  • report_url (signed, temporary — null if no report file was attached)

Diet & Exercise Plans

Manual add/edit of a diet or exercise plan — the same diet_plan/exercise_plan columns the AI assistant's confirm endpoint writes to (see the AI Assistant group above), so this is how a dietitian writes one by hand or corrects an AI-made one.

POST /nutrition/clients/{id}/diet-exercise-plans Bearer token 201 Created

Creates a new plan.

Request

Field Type Notes
kind string required — diet|exercise
title string optional — max 255 — defaults to today's date
body string optional — max 20000 — free-text plan; required if data is omitted
data object optional — table-shaped plan (see NutritionPlanStructure) — preferred over body when present; required if body is omitted

Response data

  • (CarePlan object)
PUT /nutrition/diet-exercise-plans/{id} Bearer token

Edits a plan.

Request

Field Type Notes
(same fields as create)

Response data

  • (CarePlan object)

CarePlan object fields

  • id, uuid, client_id, doctor_id, title, status
  • diet_plan, exercise_plan (readable text, either hand-written or rendered from the table-shaped data below)
  • diet_plan_data, exercise_plan_data (table-shaped, null if the plan was ever saved as free text only)

Accounting

Every endpoint in this group additionally requires the acting user to be a system manager, accountant, or project admin. Covers the company fund ledger, expenses, capital transactions, and payroll (including each doctor's revenue-share commission).

GET /fund/summary Bearer token · accounting access

Range summary of the fund ledger, broken down by source.

Request

Field Type Notes
from, to date (query) optional

Response data

  • balance, period_total_in, period_total_out, period_net number
  • by_source object — {payment, expense, capital, salary_advance, salary_payment}
GET /fund/transactions Bearer token · accounting access

Raw ledger of every fund-affecting event.

Request

Field Type Notes
source_type string (query) optional — payment|expense|capital|salary_advance|salary_payment
from, to, per_page (query) optional

Response data

  • id, uuid, source_type, source_id, amount (signed), description, occurred_on, created_by
GET /expenses Bearer token · accounting access

Lists company expenses.

Request

Field Type Notes
category, from, to, per_page (query) optional

Response data

  • [Expense object] array
POST /expenses Bearer token · accounting access 201 Created

Records a company expense (posts a negative fund transaction).

Request

Field Type Notes
category enum required — dental_supplies, lab_fees, rent, utilities, equipment, marketing, insurance, maintenance, taxes, other
vendor_name, invoice_number string optional
amount number required — min 0.01
expense_date date required
description string optional
attachment file optional — multipart, jpg/jpeg/png/pdf, max 10MB

Response data

  • (Expense object)
POST /expenses/{id} Bearer token · accounting access

Updates an expense (note: POST, not PUT — supports re-uploading the attachment).

Request

Field Type Notes
(same fields as create, all optional)

Response data

  • (Expense object)
DELETE /expenses/{id} Bearer token · accounting access

Deletes an expense and its fund transaction.

GET /capital-transactions Bearer token · accounting access

Lists owner capital injections/withdrawals.

Request

Field Type Notes
type, per_page (query) optional

Response data

  • [CapitalTransaction object] array
POST /capital-transactions Bearer token · accounting access 201 Created

Records a capital injection or withdrawal (posts a signed fund transaction).

Request

Field Type Notes
type enum required — injection, withdrawal
amount number required — min 0.01
party_name string optional
transaction_date date required
description string optional

Response data

  • (CapitalTransaction object)
PUT /capital-transactions/{id} Bearer token · accounting access

Edits a capital transaction.

Request

Field Type Notes
(same fields as create, all optional)

Response data

  • (CapitalTransaction object)
DELETE /capital-transactions/{id} Bearer token · accounting access

Deletes a capital transaction and its fund transaction. (No GET /capital-transactions/{id} — show is not exposed.)

GET /payroll/employees Bearer token · accounting access

Lists employees with their current salary/commission configuration.

Response data

  • id, uuid, name, role_name
  • is_doctor boolean
  • monthly_salary, commission_percentage number | null
PUT /payroll/employees/{userId}/salary Bearer token · accounting access

Sets an employee's base salary and (for doctors) commission rate.

Request

Field Type Notes
monthly_salary number required — min 0
commission_percentage number optional — 0–100, doctors only

Response data

  • (employee salary object)
GET /payroll/salary-advances Bearer token · accounting access

Lists salary advances given to employees.

Request

Field Type Notes
user_id, unsettled_only, per_page (query) optional

Response data

  • [SalaryAdvance object] array
POST /payroll/salary-advances Bearer token · accounting access 201 Created

Records an advance against future salary (posts a negative fund transaction).

Request

Field Type Notes
user_id integer required
amount number required — min 0.01
advance_date date required
note string optional

Response data

  • (SalaryAdvance object)
PUT /payroll/salary-advances/{id} Bearer token · accounting access

Edits an outstanding advance (blocked once settled by a salary payment).

Request

Field Type Notes
amount, advance_date, note optional

Response data

  • (SalaryAdvance object)
DELETE /payroll/salary-advances/{id} Bearer token · accounting access

Removes an outstanding advance (blocked once settled).

GET /payroll/salary-payments Bearer token · accounting access

Lists processed salary payments.

Request

Field Type Notes
user_id, period_year, period_month, per_page (query) optional

Response data

  • [SalaryPayment object] array
POST /payroll/salary-payments Bearer token · accounting access 201 Created

Processes a month's salary payment: nets base salary + doctor commission against unsettled advances, then posts the remainder to the fund.

Request

Field Type Notes
user_id integer required
period_year integer required — 2000–2100
period_month integer required — 1–12
paid_at date required

Response data

  • (SalaryPayment object) — employee must have monthly_salary set; the same employee/period cannot be paid twice
GET /payroll/salary-payments/{id} Bearer token · accounting access

Fetches a single payment's breakdown.

Response data

  • (SalaryPayment object)
PUT /payroll/salary-payments/{id} Bearer token · accounting access

Corrects the paid date — amounts are immutable (delete + recreate to correct those).

Request

Field Type Notes
paid_at date required

Response data

  • (SalaryPayment object)
DELETE /payroll/salary-payments/{id} Bearer token · accounting access

Reverses a payment: un-settles any advances it absorbed and removes its fund transaction.

SalaryPayment object fields

  • id, uuid, user_id, employee_name
  • period_year, period_month
  • base_salary, treatment_revenue, commission_percentage, commission_amount, advances_total, net_amount
  • paid_at, created_at

API Tokens (for integrations)

Manage the long-lived tokens created from Settings > API Token, used to authenticate outside systems (e.g. an X-ray imaging machine) instead of a login session.

GET /settings/api-tokens Bearer token

Lists the current user's own API tokens (never another user's).

Response data

  • id, name, created_at, last_used_at
  • — The plain-text token value is never returned again after creation.
POST /settings/api-tokens Bearer token

Creates a new token. Copy the plain-text value immediately — it is shown only this once.

Request

Field Type Notes
name string required — max 100 — a label to remember what it's for

Response data

  • token: {id, name, created_at, last_used_at} object
  • plain_text_token string — use this as the Bearer token — it has the same access as the account that created it
DELETE /settings/api-tokens/{id} Bearer token

Revokes a token immediately. Any system still using it loses access right away.

Enum reference

Exact valid string values for every enum-backed field referenced above.

Enum Valid values
AppointmentStatus scheduled, completed, no_show, cancelled
AppointmentType booked, unavailable
AttendanceStatus attended, no_show, walk_in
CapitalTransactionType injection, withdrawal
ClientGender male, female
ClientStatus new, under_treatment, completed, inactive
ExpenseCategory dental_supplies, lab_fees, rent, utilities, equipment, marketing, insurance, maintenance, taxes, other
LabCaseStatus sent, in_progress, ready, delivered
LabCaseWorkType crown, bridge, denture_full, denture_partial, veneer, retainer, night_guard, implant_abutment, aligner, other
PaymentMethod cash, card, bank_transfer
SubscriptionStatus active, inactive
UserStatus active, inactive, suspended
Weekday monday, tuesday, wednesday, thursday, friday, saturday, sunday
appointment duration (minutes) 30, 60, 90
BloodType A, B, AB, 0
RhFactor positive, negative
NutritionBodyType athlete, non_athlete
NutritionDietaryType omnivore, vegetarian, vegan, halal, kosher, other
NutritionGoal weight_loss, weight_gain, maintenance, muscle_gain, medical_diet, other
NutritionActivityLevel sedentary, light, moderate, active, very_active
NutritionSubstanceUseStatus none, occasional, regular