Create a patient
curl --request POST \
--url https://rxnote.ai/api/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Test Patient",
"age": 42,
"date_of_birth": "1984-03-02",
"phone": "+919800000000",
"email": "jsmith@example.com",
"medical_record_number": "MRN-1001",
"external_id": "P-1001",
"clinician_email": "doctor@clinic.example"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Test Patient',
age: 42,
date_of_birth: '1984-03-02',
phone: '+919800000000',
email: 'jsmith@example.com',
medical_record_number: 'MRN-1001',
external_id: 'P-1001',
clinician_email: 'doctor@clinic.example'
})
};
fetch('https://rxnote.ai/api/v1/patients', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://rxnote.ai/api/v1/patients"
payload = {
"name": "Test Patient",
"age": 42,
"date_of_birth": "1984-03-02",
"phone": "+919800000000",
"email": "jsmith@example.com",
"medical_record_number": "MRN-1001",
"external_id": "P-1001",
"clinician_email": "doctor@clinic.example"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 4821,
"name": "<string>",
"age": 123,
"sex": "<string>",
"date_of_birth": "<string>",
"phone": "<string>",
"email": "<string>",
"medical_record_number": "<string>",
"external_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"id": 4821,
"name": "<string>",
"age": 123,
"sex": "<string>",
"date_of_birth": "<string>",
"phone": "<string>",
"email": "<string>",
"medical_record_number": "<string>",
"external_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"request_id": "req_Q2w9Lx7Hc4Vb8Np1Zs3Kt6"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"request_id": "req_Q2w9Lx7Hc4Vb8Np1Zs3Kt6"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"request_id": "req_Q2w9Lx7Hc4Vb8Np1Zs3Kt6"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"request_id": "req_Q2w9Lx7Hc4Vb8Np1Zs3Kt6"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"request_id": "req_Q2w9Lx7Hc4Vb8Np1Zs3Kt6"
}
}Patients
Create a patient
Creates a patient, as Add patient does in the app, and returns its id for creating visits. With external_id, a patient that already exists for that id is returned (200) instead of a duplicate. Scope patients:write.
POST
/
patients
Create a patient
curl --request POST \
--url https://rxnote.ai/api/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Test Patient",
"age": 42,
"date_of_birth": "1984-03-02",
"phone": "+919800000000",
"email": "jsmith@example.com",
"medical_record_number": "MRN-1001",
"external_id": "P-1001",
"clinician_email": "doctor@clinic.example"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Test Patient',
age: 42,
date_of_birth: '1984-03-02',
phone: '+919800000000',
email: 'jsmith@example.com',
medical_record_number: 'MRN-1001',
external_id: 'P-1001',
clinician_email: 'doctor@clinic.example'
})
};
fetch('https://rxnote.ai/api/v1/patients', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://rxnote.ai/api/v1/patients"
payload = {
"name": "Test Patient",
"age": 42,
"date_of_birth": "1984-03-02",
"phone": "+919800000000",
"email": "jsmith@example.com",
"medical_record_number": "MRN-1001",
"external_id": "P-1001",
"clinician_email": "doctor@clinic.example"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 4821,
"name": "<string>",
"age": 123,
"sex": "<string>",
"date_of_birth": "<string>",
"phone": "<string>",
"email": "<string>",
"medical_record_number": "<string>",
"external_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"id": 4821,
"name": "<string>",
"age": 123,
"sex": "<string>",
"date_of_birth": "<string>",
"phone": "<string>",
"email": "<string>",
"medical_record_number": "<string>",
"external_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"request_id": "req_Q2w9Lx7Hc4Vb8Np1Zs3Kt6"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"request_id": "req_Q2w9Lx7Hc4Vb8Np1Zs3Kt6"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"request_id": "req_Q2w9Lx7Hc4Vb8Np1Zs3Kt6"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"request_id": "req_Q2w9Lx7Hc4Vb8Np1Zs3Kt6"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"request_id": "req_Q2w9Lx7Hc4Vb8Np1Zs3Kt6"
}
}Authorizations
Your API key, created in RxNote under Settings → API: Authorization: Bearer rxn_live_….
Body
application/json
Required string length:
1 - 255Example:
"Test Patient"
Required range:
0 <= x <= 130Example:
42
Available options:
male, female, other YYYY-MM-DD
Pattern:
^\d{4}-\d{2}-\d{2}$Example:
"1984-03-02"
Maximum string length:
30Example:
"+919800000000"
Maximum string length:
255Your MRN / UHID, searchable later.
Maximum string length:
100Example:
"MRN-1001"
Your system's id for this patient. Creating a patient with an external_id that already exists returns that patient instead of a duplicate.
Required string length:
1 - 255Example:
"P-1001"
Required with an organization key: the RxNote member acting. With a personal key, omit it or send the owner's own email.
Maximum string length:
255Example:
"doctor@clinic.example"
Response
The patient that already had this external_id.
Example:
4821
