# ClinikEHR API > Reference and guides for the ClinikEHR API — read a clinic's own inventory from your own systems. - [ClinikEHR API](https://docs.clinikehr.com/index.md): Connect your software to ClinikEHR clinics: read and send records with simple HTTPS requests and JSON. - [Quickstart](https://docs.clinikehr.com/quickstart.md): Get a key, make your first request, and read back a clinic's inventory in a few minutes. - [SDKs and Postman](https://docs.clinikehr.com/sdks-and-postman.md): Client libraries and a ready-made request collection for the ClinikEHR API. - [TypeScript client](https://docs.clinikehr.com/typescript-sdk.md): Install @clinikehr/api, make your first call, page through lists, handle errors and retries, and verify webhooks — from Node.js. - [Python client](https://docs.clinikehr.com/python-sdk.md): Install clinikehr, make your first call, write records safely, page through lists, handle errors and retries, and verify webhooks — from Python. - [Authentication](https://docs.clinikehr.com/authentication.md): How a ClinikEHR API key is formatted, how to send it, and what each authentication failure means. - [Permissions](https://docs.clinikehr.com/permissions.md): The scopes a key can be given today, what each one exposes, and how a missing one fails. - [Getting access to patient data](https://docs.clinikehr.com/patient-data-access.md): What a key needs before it can read or send patient records, appointments, notes and other patient information. - [Pagination](https://docs.clinikehr.com/pagination.md): How every list endpoint pages through results, and how to read to the end reliably. - [Response formats: JSON and FHIR](https://docs.clinikehr.com/json-and-fhir.md): The two formats this API answers in, how to read each one, and how to ask for FHIR. Includes the same allergy shown both ways. - [Errors](https://docs.clinikehr.com/errors.md): The error shape every failed request returns, and the stable codes you can branch your code on. - [Rate limits](https://docs.clinikehr.com/rate-limits.md): How many requests a key can make per minute, how to read the headers that tell you where you stand, and what happens if you go over. - [Patients](https://docs.clinikehr.com/patients.md): Find, create, update and archive the people a clinic cares for, and bring in a whole list at once. Every route, with examples. - [Appointments](https://docs.clinikehr.com/appointments.md): See what can be booked, find a free time, then book, reschedule, confirm and cancel a patient's appointment. Every route, with examples. - [Encounters](https://docs.clinikehr.com/encounters.md): Read a patient's visits as the clinic documents them, and open a draft visit for a clinician to complete. - [Clinical notes](https://docs.clinikehr.com/notes.md): Read a patient's notes, find templates and clinicians, and create a draft note for a clinician to finish. Nothing can sign or finalise. - [Conditions](https://docs.clinikehr.com/conditions.md): Read a patient's problem list, and send a diagnosis for a clinician to review. A condition you send never reaches the chart on its own. - [Allergies](https://docs.clinikehr.com/allergies.md): Read a patient's allergies and intolerances, and send one for a clinician to review. An allergy you send never reaches the chart on its own. - [Medications](https://docs.clinikehr.com/medications.md): Read the medicines a patient reports and the prescriptions written for them, and send a reported medicine for a clinician to review. Prescriptions are read-only. - [Referrals](https://docs.clinikehr.com/referrals.md): Read the referrals a clinic has received for a patient, and send one for the clinic to review. The clinic decides to accept, decline or book it, and no request can. - [Providers: the clinic's clinicians](https://docs.clinikehr.com/providers.md): Read the directory of a clinic's clinical staff: name, role, specialty, NPI and licence. It is read-only, and it holds no contact details. - [Outside care providers](https://docs.clinikehr.com/care-providers.md): Read the outside doctors, referrers and specialists a patient names, and add or maintain the contacts your app added. - [Insurance: payers and coverage](https://docs.clinikehr.com/insurance.md): List the payers a clinic has enabled, read a patient's insurance coverage, and add one. Coverage you add stays inactive until staff confirm it. - [Insurance for HMOs and insurers](https://docs.clinikehr.com/insurance-hmos.md): Verify enrollees, vet claims, decide authorizations and report payments for the insurers a clinic links to you, or submit claims as a developer. - [Inventory](https://docs.clinikehr.com/inventory.md): Read a clinic's stock locations, catalogue items, availability and exact stock levels, and archive, restore, delete or write off what the clinic no longer uses. - [Dispensing history and flags](https://docs.clinikehr.com/dispensing.md): Read what a pharmacy has dispensed to a linked patient, and the refill and duplicate-dispensing flags its pharmacists recorded. Read-only, and never a price. - [Prescription pickups](https://docs.clinikehr.com/prescription-pickups.md): Read who collected a prescription, when, and whether a signature is on file — and submit a pickup collection for a clinician to review. - [Outreach events](https://docs.clinikehr.com/outreach-events.md): Read a clinic's outreach (screening-day) events and who is checked in, and check an existing patient in for a clinician to review. - [Pharmacy listings](https://docs.clinikehr.com/pharmacy-listings.md): Find listed pharmacies, check whether one has a medicine, and read its listing. Availability is a band, never an exact count. - [CRM contacts and pipelines](https://docs.clinikehr.com/crm.md): Read pipelines, create and update contacts, search by email or phone, and log activities. Creating a contact never starts outreach. - [Events](https://docs.clinikehr.com/events.md): Read a clinic's change feed to catch up on what changed while your webhook endpoint was down, without losing or double-counting anything. - [Connections](https://docs.clinikehr.com/connections.md): How an organization's key finds the clinics it can reach, connects to a new one, and searches the pharmacy network. - [Stock bands, and what "unknown" means](https://docs.clinikehr.com/stock-bands.md): Reading availability as a band rather than an exact number, and the one place a band can be unknown. - [Verifying a webhook's signature](https://docs.clinikehr.com/verifying-webhook-signatures.md): How to prove a webhook really came from ClinikEHR, with a worked example in two languages. - [Retries and duplicates](https://docs.clinikehr.com/retries-and-idempotency.md): Safe retries on a write, and catching up on webhooks without losing or double-counting one. - [Workspace settings and your account](https://docs.clinikehr.com/workspace-settings-and-account.md): Where to change your workspace, verify your organization, and manage your own sign-in. - [Uploading your own medicine codes](https://docs.clinikehr.com/uploading-partner-codes.md): Registering your own identifier for a medicine, so availability and network search can resolve it. - [Drug requests](https://docs.clinikehr.com/drug-requests.md): Sending a request for medicines to a pharmacy, and following it through to dispensing. - [Reviewing outside submissions](https://docs.clinikehr.com/reviewing-outside-submissions.md): How an item sent in from outside reaches a patient's chart only after a person at the clinic confirms it. - [Automatic acceptance](https://docs.clinikehr.com/automatic-acceptance.md): What you see when a clinic chooses to accept your items without review: the item is already on the chart, marked as automatic and unconfirmed until a clinician reviews it. - [FHIR R4](https://docs.clinikehr.com/fhir.md): Content-negotiated FHIR R4 for patients, appointments, notes and medicines — and patient import. - [Plans and pricing](https://docs.clinikehr.com/plans-and-pricing.md): The three workspace plans, what each one includes, and how to go live. - [Usage and billing](https://docs.clinikehr.com/usage-and-billing.md): How requests and connected clinics are counted, and what happens when you go over your plan's allowance. - [Versioning](https://docs.clinikehr.com/versioning.md): What the version in the URL means, what counts as a breaking change, and how we tell you before one happens. - [API Terms of Use](https://docs.clinikehr.com/terms-of-use.md): The terms a workspace accepts to use the ClinikEHR API. Version 2026-10-03. - [Acceptable Use Policy](https://docs.clinikehr.com/acceptable-use-policy.md): What you may and may not do with the ClinikEHR API. Part of the API Terms of Use. Version 2026-10-03. - [Data Protection Addendum for Organizations](https://docs.clinikehr.com/data-protection-addendum.md): What an organization agrees to before it receives patient information through the ClinikEHR API. Version 2026-10-09. - [Changelog](https://docs.clinikehr.com/changelog/index.md): What's new in the ClinikEHR API — new resources, scopes and endpoints, newest first. - [API reference](https://docs.clinikehr.com/api-reference/overview.md): Every endpoint of the ClinikEHR API: what it takes, what it returns, and the permission it needs. - [Get the current key](https://docs.clinikehr.com/api-reference/me/get-the-current-key.md): The calling key's identity, environment and scopes. Response is the resource DIRECTLY — no `data` wrapper (see the top-level description's "Response envelope" note). - [List connections](https://docs.clinikehr.com/api-reference/connections/list-connections.md): Clinics this key can reach, and the scopes granted to it. - [List patients](https://docs.clinikehr.com/api-reference/patients/list-patients.md): **Permission:** `patients:read` List patients in scope for this key's connection. Restricted/access-controlled patients never appear. - [Create a patient](https://docs.clinikehr.com/api-reference/patients/create-a-patient.md): **Permission:** `patients:write` Create a patient. Possible duplicates are flagged for staff review, never silently merged or refused. run_automations defaults false, suppressing the patient.created Agent Studio dispatch. - [Get a patient](https://docs.clinikehr.com/api-reference/patients/get-a-patient.md): **Permission:** `patients:read` - [Update a patient](https://docs.clinikehr.com/api-reference/patients/update-a-patient.md): **Permission:** `patients:write` - [Archive a patient](https://docs.clinikehr.com/api-reference/patients/archive-a-patient.md): **Permission:** `patients:write` Archive a patient. Never a delete. Sets patients.client_status = 'archived' — the SAME write the app's own archive control makes (db/actions/patients.ts::updateClientStatus). Never removes any row. Idempotent: archiving an already-archived patient succeeds again. A r… - [List possible duplicate patients](https://docs.clinikehr.com/api-reference/patients/list-possible-duplicate-patients.md): **Permission:** `patients:read` Possible-duplicate pairs flagged for staff review. A sandbox (test) key always sees an empty list: the create adapter never seeds this table for a sandbox organization. - [Search patients](https://docs.clinikehr.com/api-reference/patients/search-patients.md): **Permission:** `patients:read` Exact-match patient search by two or more identifiers. Identifiers in the body, never a URL. Never a name-only or partial match; at least two identifiers of DIFFERENT kinds (email, phone, mrn) are required, so this cannot be used to iterate one field at a time. Capped… - [List patient imports](https://docs.clinikehr.com/api-reference/patients/list-patient-imports.md): **Permission:** `patients:write` This clinic's import jobs, oldest first. Job progress and outcome only — never a file, a patient, or a value that failed validation. Needs `patients:write`, like the rest of the import. - [Start a patient import](https://docs.clinikehr.com/api-reference/patients/start-a-patient-import.md): **Permission:** `patients:write` Import up to 100 patients from a FHIR Bundle, NDJSON, or a JSON array. Nothing is written unless every row is valid. The same import the app's Patients screen offers, for the clinic's OWN key. The file is checked in full before anything is written: every row goes thr… - [Get a patient import](https://docs.clinikehr.com/api-reference/patients/get-a-patient-import.md): **Permission:** `patients:write` One import job. Absent, another clinic's, and not-permitted are one `not_found`. - [Import the valid rows](https://docs.clinikehr.com/api-reference/patients/import-the-valid-rows.md): **Permission:** `patients:write` Import only the rows that passed, for a job waiting for review. An explicit, recorded choice — the key that made it is stored on the job. Only a job in `needs_review` whose file is still held (files are deleted after 7 days) can be run this way; anything else is `inv… - [List bookable services](https://docs.clinikehr.com/api-reference/appointments/list-bookable-services.md): **Permission:** `appointments.availability:read` - [List bookable clinicians](https://docs.clinikehr.com/api-reference/appointments/list-bookable-clinicians.md): **Permission:** `appointments.availability:read` - [Get available slots](https://docs.clinikehr.com/api-reference/appointments/get-available-slots.md): **Permission:** `appointments.availability:read` - [List appointments](https://docs.clinikehr.com/api-reference/appointments/list-appointments.md): **Permission:** `appointments:read` - [Book an appointment](https://docs.clinikehr.com/api-reference/appointments/book-an-appointment.md): **Permission:** `appointments:write` - [Get an appointment](https://docs.clinikehr.com/api-reference/appointments/get-an-appointment.md): **Permission:** `appointments:read` - [Update an appointment](https://docs.clinikehr.com/api-reference/appointments/update-an-appointment.md): **Permission:** `appointments:write` - [Cancel an appointment](https://docs.clinikehr.com/api-reference/appointments/cancel-an-appointment.md): **Permission:** `appointments:write` - [List encounters](https://docs.clinikehr.com/api-reference/encounters/list-encounters.md): **Permission:** `encounters:read` - [Open an encounter](https://docs.clinikehr.com/api-reference/encounters/open-an-encounter.md): **Permission:** `encounters:write` - [Get an encounter](https://docs.clinikehr.com/api-reference/encounters/get-an-encounter.md): **Permission:** `encounters:read` - [Update an encounter](https://docs.clinikehr.com/api-reference/encounters/update-an-encounter.md): **Permission:** `encounters:write` - [List notes](https://docs.clinikehr.com/api-reference/notes/list-notes.md): **Permission:** `notes:read` List one patient's clinical notes — metadata only, never note content. patient_id is required. - [Create a draft note](https://docs.clinikehr.com/api-reference/notes/create-a-draft-note.md): **Permission:** `notes:write` Create a DRAFT note. Always status=draft — this route can never sign, lock, finalize or co-sign. clinician_id is the clinic_staff.id the draft is FOR, never the API caller. Unknown content keys are refused (unknown_field) naming both the offending keys and the full vali… - [Get a note](https://docs.clinikehr.com/api-reference/notes/get-a-note.md): **Permission:** `notes:read` - [Update a draft note](https://docs.clinikehr.com/api-reference/notes/update-a-draft-note.md): **Permission:** `notes:write` - [List note templates](https://docs.clinikehr.com/api-reference/notes/list-note-templates.md): **Permission:** `notes:read` - [Get a note template](https://docs.clinikehr.com/api-reference/notes/get-a-note-template.md): **Permission:** `notes:read` - [List note clinicians](https://docs.clinikehr.com/api-reference/notes/list-note-clinicians.md): **Permission:** `notes:read` - [List conditions](https://docs.clinikehr.com/api-reference/conditions/list-conditions.md): **Permission:** `conditions:read` - [Submit a condition](https://docs.clinikehr.com/api-reference/conditions/submit-a-condition.md): **Permission:** `conditions:write` - [Get a condition](https://docs.clinikehr.com/api-reference/conditions/get-a-condition.md): **Permission:** `conditions:read` - [Update or retract a condition](https://docs.clinikehr.com/api-reference/conditions/update-or-retract-a-condition.md): **Permission:** `conditions:write` - [List allergies](https://docs.clinikehr.com/api-reference/allergies/list-allergies.md): **Permission:** `allergies:read` - [Submit an allergy](https://docs.clinikehr.com/api-reference/allergies/submit-an-allergy.md): **Permission:** `allergies:write` - [Get an allergy](https://docs.clinikehr.com/api-reference/allergies/get-an-allergy.md): **Permission:** `allergies:read` - [Update or retract an allergy](https://docs.clinikehr.com/api-reference/allergies/update-or-retract-an-allergy.md): **Permission:** `allergies:write` - [List reported medicines](https://docs.clinikehr.com/api-reference/medications/list-reported-medicines.md): **Permission:** `medications:read` - [Submit a reported medicine](https://docs.clinikehr.com/api-reference/medications/submit-a-reported-medicine.md): **Permission:** `medications:write` - [Get a reported medicine](https://docs.clinikehr.com/api-reference/medications/get-a-reported-medicine.md): **Permission:** `medications:read` - [Update or retract a reported medicine](https://docs.clinikehr.com/api-reference/medications/update-or-retract-a-reported-medicine.md): **Permission:** `medications:write` - [List prescriptions](https://docs.clinikehr.com/api-reference/medications/list-prescriptions.md): **Permission:** `medications:read` - [Get a prescription](https://docs.clinikehr.com/api-reference/medications/get-a-prescription.md): **Permission:** `medications:read` - [List referrals](https://docs.clinikehr.com/api-reference/referrals/list-referrals.md): **Permission:** `referrals:read` - [Submit a referral](https://docs.clinikehr.com/api-reference/referrals/submit-a-referral.md): **Permission:** `referrals:write` - [Get a referral](https://docs.clinikehr.com/api-reference/referrals/get-a-referral.md): **Permission:** `referrals:read` - [Update or retract a referral](https://docs.clinikehr.com/api-reference/referrals/update-or-retract-a-referral.md): **Permission:** `referrals:write` - [Get a submission](https://docs.clinikehr.com/api-reference/submissions/get-a-submission.md): **Permission:** `conditions:write` - [List providers](https://docs.clinikehr.com/api-reference/providers/list-providers.md): **Permission:** `providers:read` - [Get a provider](https://docs.clinikehr.com/api-reference/providers/get-a-provider.md): **Permission:** `providers:read` - [List outside care providers](https://docs.clinikehr.com/api-reference/careproviders/list-outside-care-providers.md): **Permission:** `care_providers:read` - [Add an outside care provider](https://docs.clinikehr.com/api-reference/careproviders/add-an-outside-care-provider.md): **Permission:** `care_providers:write` - [Get an outside care provider](https://docs.clinikehr.com/api-reference/careproviders/get-an-outside-care-provider.md): **Permission:** `care_providers:read` - [Update an outside care provider](https://docs.clinikehr.com/api-reference/careproviders/update-an-outside-care-provider.md): **Permission:** `care_providers:write` - [Remove an outside care provider](https://docs.clinikehr.com/api-reference/careproviders/remove-an-outside-care-provider.md): **Permission:** `care_providers:write` - [List payers](https://docs.clinikehr.com/api-reference/payers/list-payers.md): **Permission:** `payers:read` - [Get a payer](https://docs.clinikehr.com/api-reference/payers/get-a-payer.md): **Permission:** `payers:read` - [List coverages](https://docs.clinikehr.com/api-reference/coverages/list-coverages.md): **Permission:** `coverage:read` - [Create a coverage](https://docs.clinikehr.com/api-reference/coverages/create-a-coverage.md): **Permission:** `coverage:write` - [Get a coverage](https://docs.clinikehr.com/api-reference/coverages/get-a-coverage.md): **Permission:** `coverage:read` - [Update or end a coverage](https://docs.clinikehr.com/api-reference/coverages/update-or-end-a-coverage.md): **Permission:** `coverage:write` - [List insurer enrollees](https://docs.clinikehr.com/api-reference/hmo-insurance/list-insurer-enrollees.md): **Permission:** `insurance.enrollees:read` - [Get an insurer enrollee](https://docs.clinikehr.com/api-reference/hmo-insurance/get-an-insurer-enrollee.md): **Permission:** `insurance.enrollees:read` - [List insurer plans](https://docs.clinikehr.com/api-reference/hmo-insurance/list-insurer-plans.md): **Permission:** `insurance.plans:read` - [Get an insurer plan](https://docs.clinikehr.com/api-reference/hmo-insurance/get-an-insurer-plan.md): **Permission:** `insurance.plans:read` - [List insurer claims](https://docs.clinikehr.com/api-reference/hmo-insurance/list-insurer-claims.md): **Permission:** `insurance.claims:read` - [Submit an insurance claim](https://docs.clinikehr.com/api-reference/hmo-insurance/submit-an-insurance-claim.md): **Permission:** `insurance.claims:submit` - [Get an insurer claim](https://docs.clinikehr.com/api-reference/hmo-insurance/get-an-insurer-claim.md): **Permission:** `insurance.claims:read` - [Vet an insurance claim](https://docs.clinikehr.com/api-reference/hmo-insurance/vet-an-insurance-claim.md): **Permission:** `insurance.claims:adjudicate` - [List pre-authorization requests](https://docs.clinikehr.com/api-reference/hmo-insurance/list-pre-authorization-requests.md): **Permission:** `insurance.pa:read` - [Send a pre-authorization request](https://docs.clinikehr.com/api-reference/hmo-insurance/send-a-pre-authorization-request.md): **Permission:** `insurance.pa:submit` - [Get a pre-authorization request](https://docs.clinikehr.com/api-reference/hmo-insurance/get-a-pre-authorization-request.md): **Permission:** `insurance.pa:read` - [Decide a pre-authorization request](https://docs.clinikehr.com/api-reference/hmo-insurance/decide-a-pre-authorization-request.md): **Permission:** `insurance.pa:decide` - [List payment advices](https://docs.clinikehr.com/api-reference/hmo-insurance/list-payment-advices.md): **Permission:** `insurance.remittances:write` - [Send a payment advice](https://docs.clinikehr.com/api-reference/hmo-insurance/send-a-payment-advice.md): **Permission:** `insurance.remittances:write` - [List stock locations](https://docs.clinikehr.com/api-reference/inventory/list-stock-locations.md): **Permission:** `inventory.stock:read` - [List catalogue items](https://docs.clinikehr.com/api-reference/inventory/list-catalogue-items.md): **Permission:** `inventory.items:read` - [Create a catalogue item](https://docs.clinikehr.com/api-reference/inventory/create-a-catalogue-item.md): **Permission:** `inventory.items:write` Add a catalogue item. Unknown fields refused by name. container_sale_price/container_cost are refused outright. - [Get a catalogue item](https://docs.clinikehr.com/api-reference/inventory/get-a-catalogue-item.md): **Permission:** `inventory.items:read` - [Update a catalogue item](https://docs.clinikehr.com/api-reference/inventory/update-a-catalogue-item.md): **Permission:** `inventory.items:write` Update a catalogue item. Absent field ≠ JSON null. Idempotency-Key OPTIONAL — a PATCH is naturally idempotent. Barcode (`upc`): only a changed value must be a valid GTIN. A `upc` equal, as stored, to the item's current value is accepted even when it is not a v… - [Delete an unused item](https://docs.clinikehr.com/api-reference/inventory/delete-an-unused-item.md): **Permission:** `inventory.items:write` - [Check item availability](https://docs.clinikehr.com/api-reference/inventory/check-item-availability.md): **Permission:** `inventory.availability:read` - [List stock quantities](https://docs.clinikehr.com/api-reference/inventory/list-stock-quantities.md): **Permission:** `inventory.stock:read` - [Upload an external stock batch](https://docs.clinikehr.com/api-reference/inventory/upload-an-external-stock-batch.md): **Permission:** `inventory.stock:write` Upload a batch of external stock quantities/bands for a pharmacy selling through another till. Clinic-owned key only — an organization never pushes a clinic's own stock. batch_id doubles as the idempotency key (a replay of an already-processed batch returns th… - [Get an external stock batch](https://docs.clinikehr.com/api-reference/inventory/get-an-external-stock-batch.md): **Permission:** `inventory.stock:read` - [Archive a catalogue item](https://docs.clinikehr.com/api-reference/inventory/archive-a-catalogue-item.md): **Permission:** `inventory.items:write` - [Restore a catalogue item](https://docs.clinikehr.com/api-reference/inventory/restore-a-catalogue-item.md): **Permission:** `inventory.items:write` - [Write off a lot](https://docs.clinikehr.com/api-reference/inventory/write-off-a-lot.md): **Permission:** `inventory.stock:write` - [Receive stock](https://docs.clinikehr.com/api-reference/inventory/receive-stock.md): **Permission:** `inventory.stock:write` - [Adjust stock](https://docs.clinikehr.com/api-reference/inventory/adjust-stock.md): **Permission:** `inventory.stock:write` - [Transfer stock](https://docs.clinikehr.com/api-reference/inventory/transfer-stock.md): **Permission:** `inventory.stock:write` - [List your medicine codes](https://docs.clinikehr.com/api-reference/inventory/list-your-medicine-codes.md): **Permission:** `inventory.items:write` - [Upload medicine codes](https://docs.clinikehr.com/api-reference/inventory/upload-medicine-codes.md): **Permission:** `inventory.items:write` Upload up to 1,000 of a partner's own medicine codes. An exact identifier match links automatically; the rest wait for review. Idempotent by construction — Idempotency-Key optional. Unknown per-row fields are refused by name WITHOUT aborting the rest of the ba… - [Get a medicine code](https://docs.clinikehr.com/api-reference/inventory/get-a-medicine-code.md): **Permission:** `inventory.items:write` - [Delete a medicine code](https://docs.clinikehr.com/api-reference/inventory/delete-a-medicine-code.md): **Permission:** `inventory.items:write` - [List dispensing history](https://docs.clinikehr.com/api-reference/dispensing/list-dispensing-history.md): **Permission:** `dispensing:read` A linked enrollee's own dispensing history — medicine, quantity, days supply, date. Never price. patient_id is required. For an organization key, the enrollee must be linked through the connection, or this answers not_found. A clinic's own key may read its own custo… - [List dispensing flags](https://docs.clinikehr.com/api-reference/dispensing/list-dispensing-flags.md): **Permission:** `dispensing:read` Refill/duplicate-dispensing flags for the caller's linked enrollees, in a date window. Each flag's rule, evidence, and the pharmacist's reason — never price, margin, staff identity beyond this, or any other customer of the pharmacy. Never references the "possibly th… - [List drug requests](https://docs.clinikehr.com/api-reference/drug-requests/list-drug-requests.md): **Permission:** `requests:read` List drug requests sent to this clinic. An org-owned key sees only requests ITS OWN connection created. No route here lets a requester accept, mark ready, or dispense — those are staff-only, in the app. - [Send a drug request](https://docs.clinikehr.com/api-reference/drug-requests/send-a-drug-request.md): **Permission:** `requests:write` Send a drug request for a linked enrollee. The pharmacist decides; dispensing happens at the till only. clinic_patient_id must already be a patient of this clinic. needed_by defaults to now()+7 days when absent. No price/cost/amount field exists anywhere on this reso… - [Get a drug request](https://docs.clinikehr.com/api-reference/drug-requests/get-a-drug-request.md): **Permission:** `requests:read` - [Cancel a drug request](https://docs.clinikehr.com/api-reference/drug-requests/cancel-a-drug-request.md): **Permission:** `requests:write` Cancel a drug request. Never available once dispensed. Refused with invalid_status_transition (409) when the current status does not allow a requester cancel. - [Answer a substitution](https://docs.clinikehr.com/api-reference/drug-requests/answer-a-substitution.md): **Permission:** `requests:write` Accept or decline a pharmacist-proposed substitute. Only valid from status=substituted. Declining ends the whole request (declined) — the requester may submit a new request rather than looping back to submitted. - [List reachable pharmacies](https://docs.clinikehr.com/api-reference/listing/list-reachable-pharmacies.md): **Permission:** `listing.profile:read` Every pharmacy this key's workspace can reach through an active listing connection. No clinic in the path — the calling key's organization must hold an ACTIVE connection granting listing.profile:read to each returned clinic; a clinic-owned key always gets an em… - [Search listed pharmacies](https://docs.clinikehr.com/api-reference/listing/search-listed-pharmacies.md): **Permission:** `listing.availability:read` Search by medicine identity across every listed pharmacy this key's workspace can reach. A clinic-owned key always gets an empty result. For a workspace TEST key this searches the workspace's own seeded fictional items instead. Fail-closed allow-list — an… - [Send search feedback](https://docs.clinikehr.com/api-reference/listing/send-search-feedback.md): **Permission:** `listing.availability:read` Report whether a network-search result was actually useful. No user data. Nothing reads this yet; it is recorded for future freshness tuning. - [List a pharmacy's listed items](https://docs.clinikehr.com/api-reference/listing/list-a-pharmacys-listed-items.md): **Permission:** `listing.availability:read` One listed pharmacy's items with bands (cache warm-up). Has a clinic in the path, so it goes through the ordinary key/clinic authorization every other per-clinic route uses. Linked, listable, non-excluded items only. - [Get a pharmacy's listing profile](https://docs.clinikehr.com/api-reference/listing/get-a-pharmacys-listing-profile.md): **Permission:** `listing.profile:read` One listed pharmacy's public listing profile. Response is the profile DIRECTLY — no `data` wrapper (see the top-level description's "Response envelope" note). Has a clinic in the path, so it goes through the ordinary key/clinic authorization. For a workspace TE… - [List pipelines](https://docs.clinikehr.com/api-reference/crm/list-pipelines.md): **Permission:** `crm.pipelines:read` - [List contacts](https://docs.clinikehr.com/api-reference/crm/list-contacts.md): **Permission:** `crm.contacts:read` - [Create a contact](https://docs.clinikehr.com/api-reference/crm/create-a-contact.md): **Permission:** `crm.contacts:write` Create a CRM contact. Never starts outreach. Mirrors db/actions/crm.ts createCrmContact's own validation, defaults, and default-pipeline/stage resolution. is_email_domain_blocked is checked server-side on any email. Both crm_contacts outreach triggers (an Agent S… - [Search contacts](https://docs.clinikehr.com/api-reference/crm/search-contacts.md): **Permission:** `crm.contacts:read` - [Get a contact](https://docs.clinikehr.com/api-reference/crm/get-a-contact.md): **Permission:** `crm.contacts:read` - [Update a contact](https://docs.clinikehr.com/api-reference/crm/update-a-contact.md): **Permission:** `crm.contacts:write` - [List a contact's activities](https://docs.clinikehr.com/api-reference/crm/list-a-contacts-activities.md): **Permission:** `crm.activities:read` - [Log an activity](https://docs.clinikehr.com/api-reference/crm/log-an-activity.md): **Permission:** `crm.activities:write` - [List events](https://docs.clinikehr.com/api-reference/events/list-events.md): The clinic's own change feed — catch-up for a partner whose webhook endpoint was down. Needs no scope of its own: any valid key that can reach the clinic may read the feed. The feed is filtered to event types whose required_scope the key's CURRENT scopes cover. - [Get the FHIR capability statement](https://docs.clinikehr.com/api-reference/fhir/get-the-fhir-capability-statement.md): FHIR R4 CapabilityStatement — exactly what this gateway supports, nothing more. No bearer key required (this is the same discovery document for every caller); Content-Type is application/fhir+json, not the {data} envelope. Lists ONLY the resources/interactions this gateway actually serves — Patient,… ## OpenAPI Specs - [ehr-api.v1](/openapi/ehr-api.v1.yaml) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.