iClinic Developers

Encounters

The iClinic Integration API returns the encounters (visits) of a clinic: each time a patient came in for an examination within a range of dates. Unlike the other four resources, encounters filter by visit date and use page-number paging (see Pagination).

List encounters

GET/api/integration/v1/encounters

Returns the encounters whose visitDate falls in the range [from, to], newest first. Requires the encounters:read scope.

Cancelled encounters are excluded by default. To mark an appointment as “Cancelled”, call the endpoint with status=all (every status) or status=CANCELLED.

Query parameters

ParameterDescription
fromstring · daterequired First visit date, YYYY-MM-DD, in the clinic's local time.
tostring · dateoptional Last visit date, inclusive. Default: today. The range from–to can span at most 31 days.
statusstring · enumoptional If omitted: every status except CANCELLED. all: every status, including cancelled. Or one of NEW ONGOING FINISHED REOPENED LOCKED CANCELLED. Case-insensitive.
pageintegeroptional Page number, starting at 0. Default 0.
pageSizeintegeroptional From 1 to 500. Default 200.

Response 200

Hover over a row, or move to it with Tab, to see where that field sits in the JSON.

FieldMeaning
requestIdstringThe ID of the request. It matches the X-Request-Id header. Include it when you contact support.
totalintegerTotal number of encounters that match the filter, across all pages.
encountersarrayThe encounters on the current page. The response also returns from, to, page and pageSize exactly as you sent them (after defaults are applied).

An encounter

FieldMeaning
encounterUuidstringDeduplication key. A stable ID of the encounter. It never changes.
idstringThe record code shown to users. For reference only. It can be issued again, so do not use it as a deduplication key.
patientNamestringPatient name.
phonestring | nullPhone number; null if the clinic has no number.
visitDatedateVisit date, YYYY-MM-DD, in the clinic's local time. The system stores the date, not the time of the visit.
checkedInAtdate-time | nullCheck-in time, in Coordinated Universal Time (UTC), when it is known; otherwise null. Do not read null as “has not arrived”; rely on status instead.
completedAtdate-time | nullTime the examination ended (UTC), or null.
statusenum
  • NEW arrived / checked in
  • ONGOING examination in progress
  • FINISHED examination finished
  • REOPENED reopened
  • LOCKED record locked
  • CANCELLED cancelled
patientTypeenum
  • NEW new patient
  • OLD returning patient
  • RE_EXAMINATION scheduled follow-up
diagnosisstringDiagnosis; an empty string if there is none yet.
icd10CodestringICD-10 diagnosis code; an empty string if there is none yet.
patientIdstring | nullAdded in 1.1.0. The patient's id in /patients; null if the encounter is not linked to a patient record.
followUpDatedate | nullAdded in 1.1.0. The follow-up date the doctor scheduled, YYYY-MM-DD; null if no follow-up is scheduled.
updatedAtdate-timeAdded in 1.1.0. When the encounter last changed (UTC).

Errors

Error codeWhen
INVALID_DATE400from or to is missing or malformed.
INVALID_RANGE400to is before from, or the range is longer than 31 days.
INVALID_STATUS400status is not valid.
INVALID_PAGE400page or pageSize is not valid.
INSUFFICIENT_SCOPE403The API key does not have the encounters:read scope.

Every endpoint can also return 401, 429 and 5xx. See Error codes.

curl -sS "https://iclinic.phongkhamhieploi.vn/api/integration/v1/encounters?from=2026-09-14&to=2026-09-19&status=all&page=0&pageSize=200" \
  -H "Authorization: Bearer $ICLINIC_API_KEY"
200 Response
{
  "requestId": "req_7c1f3a",
  "from": "2026-09-14",
  "to": "2026-09-19",
  "page": 0,
  "pageSize": 200,
  "total": 1,
  "encounters": [
    {
      "id": "BA-000123",
      "encounterUuid": "3f0c9a52-6d1b-4e7a-9b1e-2a4c8d5e7f10",
      "patientName": "Nguyễn Văn A",
      "phone": "0900000001",
      "visitDate": "2026-09-19",
      "checkedInAt": "2026-09-19T02:14:05.000Z",
      "completedAt": null,
      "status": "ONGOING",
      "patientType": "OLD",
      "diagnosis": "Tăng huyết áp",
      "icd10Code": "I10",
      "patientId": "5b0d6a38-3f5a-4a52-8f7c-1d2e9c4b7a10",
      "followUpDate": "2026-09-26",
      "updatedAt": "2026-09-19T03:02:40.000Z"
    }
  ]
}