curl --request POST \
--url https://api.clinikehr.com/v1/clinics/{clinic_id}/patient-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: [{}]})
};
fetch('https://api.clinikehr.com/v1/clinics/{clinic_id}/patient-imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.clinikehr.com/v1/clinics/{clinic_id}/patient-imports"
payload = { "data": [{}] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "validating",
"input_format": "json_array",
"row_count": 123,
"last_processed_row": 123,
"counts": {
"created": 123,
"flagged_duplicate": 123,
"skipped_already_imported": 123,
"failed": 123
},
"row_errors": [
{
"row": 2,
"field": "<string>",
"reason": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"started_by": "key",
"valid_only_run_at": "2023-11-07T05:31:56Z"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}Start a patient import
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 through the same validation a real create does. If EVERY row is valid the import runs at once and the response is the finished job (status: succeeded). If ANY row fails, nothing is written and the response is the job with status: needs_review and a row_errors list — row number, field and reason for each, never the value that failed. Fix the file and send it again, or call runValidPatientImportRows to import only the rows that passed. A file with exactly the same content that has already been imported is refused already_imported, so retrying a timed-out call is safe; no Idempotency-Key is needed or read. An import contacts no patient and starts no automation. A possible duplicate is still created and counted in flagged_duplicate, for staff to review. Limits: 100 rows and 10 MiB, refused before any row is read. Needs patients:write, the API add-on and the accepted API data agreement. Only a clinic’s own key may import — an organization connected to the clinic may not, whatever it was granted (not_found).
curl --request POST \
--url https://api.clinikehr.com/v1/clinics/{clinic_id}/patient-imports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: [{}]})
};
fetch('https://api.clinikehr.com/v1/clinics/{clinic_id}/patient-imports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.clinikehr.com/v1/clinics/{clinic_id}/patient-imports"
payload = { "data": [{}] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "validating",
"input_format": "json_array",
"row_count": 123,
"last_processed_row": 123,
"counts": {
"created": 123,
"flagged_duplicate": 123,
"skipped_already_imported": 123,
"failed": 123
},
"row_errors": [
{
"row": 2,
"field": "<string>",
"reason": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"started_by": "key",
"valid_only_run_at": "2023-11-07T05:31:56Z"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
How data is written.
json_array, ndjson, fhir_bundle json_array — an array of patient objects in the same shape as createPatient (a row that carries allergies, current_medications or chronic_conditions is rejected by name like any other invalid row). ndjson — one string, a patient object per line. fhir_bundle — a FHIR Bundle whose entries include Patient resources (other resource types are ignored). At most 100 rows.
1 - 100 elementsResponse
The finished job — succeeded, needs_review, or failed.
Show child attributes
Show child attributes