Get a list of patients for a site
Retrieve a list of patients with optional sorting, pagination, and filtering.
Query parameters
-
ID of the site to retrieve patients for.
-
Number of items per page.
-
Comma-separated list of fields to be returned in the response. Only 'id', 'first_name', 'last_name', 'mrn', 'dob', 'gender', 'phone', 'address', 'address_line2, 'zip', 'is_frozen', 'created_at', 'updated_at' columns are allowed.
-
Filter criteria to narrow down the list of patients. The filter parameter is an object with key-value pairs where the key is the field to filter by and the value is '{operator}{value}'. The operator is optional and defaults to '='. (e.g. '/patients?site_id=1&filter[id]=>100&filter[created_at]=>2021-01-01')
-
Field to sort the results by. Only 'id' and 'created_at' columns are allowed, prefixed with a minus sign (-) for descending order and without for ascending order.
Values are
id,-id,created_at, or-created_at.
curl \
--request GET 'https://publicapi.ekareinc.com/api/v1/patients?site_id=42' \
--header "X-API-KEY: $API_KEY"
{
"data": [
{
"id": 3098,
"mrn": "123456",
"first_name": "John",
"last_name": "Doe",
"dob": "1990-01-01",
"gender": "M",
"phone": "+(1) 123-456-7890",
"address": "123 Main St",
"address_line2": "Apt 1",
"zip": "12345",
"is_frozen": false,
"created_at": "2021-01-01 00:00:00",
"updated_at": "2021-01-01 00:00:00"
}
],
"metadata": {
"current_page": 1,
"last_page": 55,
"per_page": 2,
"total": 110,
"next_page_url": "http://publicapi.ekareinc.com/api/v1/patients?site_id=1&page=2",
"prev_page_url": "string"
}
}
{
"error": "Not Found",
"message": "Specified site not found.",
"error_cde": "104"
}
{
"error": "Access denied",
"message": "Forbidden. You do not have permission to access this resource.",
"error_code": "101"
}
{
"error": "Invalid API token",
"message": "Unauthorized. Please provide a valid API token.",
"error_code": "100"
}
{
"error": "Bad Request",
"message": "The given data was invalid.",
"error_code": "102"
}