List treatment plans
https://zwhwryofdsgmzgqbcghl.supabase.co/functions/v1/api/v1/treatment_plansRequires the treatment:read scope. See keys and scopes.
Try it
10 requests a minute
Kept in this tab only (sessionStorage), never saved to disk and never put in the code sample. It is sent to CuspFlow's own proxy on this domain, not to a third party.
Confirm the clinic id (optional)
Fill this in and the request is refused unless the key really belongs to that clinic. It guards against pasting the wrong key, not against an attacker: the clinic is already in the key and anyone holding it can read it from whoami.
Query parameters (18)
curl --request GET \
--url 'https://zwhwryofdsgmzgqbcghl.supabase.co/functions/v1/api/v1/treatment_plans' \
--header 'Authorization: Bearer '"$CUSPFLOW_API_KEY" \
--header 'Accept: application/json'Query parameters
limitinteger defaults to 50 | Page size. Default 50, clamped to 200 rather than rejected. |
cursorstring | Opaque keyset cursor from `meta.next_cursor`. Do not construct one by hand. There is no offset parameter: PostgREST caps a range at 1000 rows and truncates silently. |
fieldsstring | Comma-separated subset of: id, clinic_id, branch_id, patient_id, appointment_id, dentist_id, chair_id, status, payment_status, clinical_notes, teeth_codes, tooth_notes, finalized_at, import_report_id, created_at, updated_at. |
sortstring | Sortable: created_at, updated_at, finalized_at. Prefix with `-` for descending. Default `-created_at`. An `id` tiebreak is always appended so the order is total. |
include_totalboolean defaults to false | Run an exact count and return it as `meta.total`. Expensive; counts double against the rate limit. |
include_deletedboolean defaults to false | Include soft-deleted rows. `deleted_at` itself is never returned. |
exclude_migratedboolean defaults to false | Exclude rows created by a bulk import (`import_report_id is null`). |
idstring<uuid> | Filter on `id`. Also accepts `id[gte]`, `id[lte]`, `id[gt]`, `id[lt]`, `id[in]` (comma-separated). |
branch_idstring<uuid> | Filter on `branch_id`. Also accepts `branch_id[gte]`, `branch_id[lte]`, `branch_id[gt]`, `branch_id[lt]`, `branch_id[in]` (comma-separated). |
patient_idstring<uuid> | Filter on `patient_id`. Also accepts `patient_id[gte]`, `patient_id[lte]`, `patient_id[gt]`, `patient_id[lt]`, `patient_id[in]` (comma-separated). |
appointment_idstring<uuid> | Filter on `appointment_id`. Also accepts `appointment_id[gte]`, `appointment_id[lte]`, `appointment_id[gt]`, `appointment_id[lt]`, `appointment_id[in]` (comma-separated). |
dentist_idstring<uuid> | Filter on `dentist_id`. Also accepts `dentist_id[gte]`, `dentist_id[lte]`, `dentist_id[gt]`, `dentist_id[lt]`, `dentist_id[in]` (comma-separated). |
chair_idstring<uuid> | Filter on `chair_id`. Also accepts `chair_id[gte]`, `chair_id[lte]`, `chair_id[gt]`, `chair_id[lt]`, `chair_id[in]` (comma-separated). |
statusstring | Filter on `status`. Also accepts `status[gte]`, `status[lte]`, `status[gt]`, `status[lt]`, `status[in]` (comma-separated). |
payment_statusstring | Filter on `payment_status`. Also accepts `payment_status[gte]`, `payment_status[lte]`, `payment_status[gt]`, `payment_status[lt]`, `payment_status[in]` (comma-separated). |
finalized_atstring<date-time> | Filter on `finalized_at`. Also accepts `finalized_at[gte]`, `finalized_at[lte]`, `finalized_at[gt]`, `finalized_at[lt]`, `finalized_at[in]` (comma-separated). |
created_atstring<date-time> | Filter on `created_at`. Also accepts `created_at[gte]`, `created_at[lte]`, `created_at[gt]`, `created_at[lt]`, `created_at[in]` (comma-separated). |
updated_atstring<date-time> | Filter on `updated_at`. Also accepts `updated_at[gte]`, `updated_at[lte]`, `updated_at[gt]`, `updated_at[lt]`, `updated_at[in]` (comma-separated). |
Responses
{
"data": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"clinic_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"branch_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"patient_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"appointment_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"dentist_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"chair_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "string",
"...": "…"
}
],
"meta": {
"next_cursor": "eyJrIjpbIjIwMjYtMTEtMDUiLCIzZmE4NWY2NCJdfQ"
}
}400 | Unknown field in fields/sort/filter, or a malformed cursor. |
401 | Missing, malformed, revoked or expired key. |
403 | Key lacks the `treatment:read` scope. |
429 | Rate limited. See Retry-After. |
Every error is application/problem+json and carries a code you can branch on. The full catalogue is in error codes.
Try it
10 requests a minute
Kept in this tab only (sessionStorage), never saved to disk and never put in the code sample. It is sent to CuspFlow's own proxy on this domain, not to a third party.
Confirm the clinic id (optional)
Fill this in and the request is refused unless the key really belongs to that clinic. It guards against pasting the wrong key, not against an attacker: the clinic is already in the key and anyone holding it can read it from whoami.
Query parameters (18)
curl --request GET \
--url 'https://zwhwryofdsgmzgqbcghl.supabase.co/functions/v1/api/v1/treatment_plans' \
--header 'Authorization: Bearer '"$CUSPFLOW_API_KEY" \
--header 'Accept: application/json'