Skip to main content

Endpoint

GET https://app.mycura.org/api/cura/patients/{id}

Path Parameters

id
string
required
The unique UUID of the patient to retrieve

Response

success
boolean
Indicates if the request was successful
patient
object
The patient information object
error
string
Error message if the request failed (only present when success is false)

Examples

Basic Request

curl -X GET "https://app.mycura.org/api/cura/patients/28dffdd1-c18b-46e4-88f7-9b2f073c70dc" \
  -H "X-API-Key: YOUR_API_KEY"

Response Examples

Success Response

{
  "success": true,
  "patient": {
    "id": "28dffdd1-c18b-46e4-88f7-9b2f073c70dc",
    "name": "Ansh Mehta",
    "phone_number": "15622853979",
    "conditions": [
      "{\"name\":\"GERD\",\"symptoms\":\"Heart burn\"}"
    ],
    "allergies": null,
    "medications": null,
    "notes": [],
    "reminders_enabled": false,
    "refill_info": null,
    "join_status": null,
    "subscription_plan": "free",
    "whatsapp_terms_accepted": true,
    "created_at": "2025-08-29T22:08:42.746701+00:00",
    "updated_at": "2025-08-29T22:10:07.30223+00:00"
  }
}

Patient Not Found

{
  "error": "Patient not found"
}

Use Cases

Retrieve patient information before making chat requests to understand available context:
// Get patient info first
const response = await fetch(`https://app.mycura.org/api/cura/patients/${patientId}`, {
  headers: { 'X-API-Key': apiKey }
});
const { patient } = await response.json();

// Use patient context in chat
const chatResponse = await fetch('https://app.mycura.org/api/cura/chat', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': apiKey
  },
  body: JSON.stringify({
    message: 'What are my medication interactions?',
    patientId: patient.id
  })
});
Sync patient data between your system and Cura:
// Check if patient data needs updating
const curaResponse = await fetch(`https://app.mycura.org/api/cura/patients/${patientId}`, {
  headers: { 'X-API-Key': apiKey }
});
const { patient: curaPatient } = await curaResponse.json();

const localPatient = await getLocalPatient(patientId);

if (curaPatient.updated_at !== localPatient.updated_at) {
  // Sync the data
  await updateLocalPatient(patientId, curaPatient);
}
Verify patient access before displaying sensitive information:
try {
  const response = await fetch(`https://app.mycura.org/api/cura/patients/${patientId}`, {
    headers: { 'X-API-Key': apiKey }
  });
  
  if (!response.ok) {
    throw new Error('Patient not found');
  }
  
  const { patient } = await response.json();
  // Patient exists and user has access
  displayPatientDashboard(patient);
} catch (error) {
  // Handle unauthorized access or missing patient
  showAccessDenied();
}

Best Practices

Privacy Considerations: Only retrieve patient data when necessary and ensure proper access controls are in place in your application.
  • Cache Appropriately: Cache patient data to reduce API calls, but refresh when needed
  • Error Handling: Always check for patient existence before using the data
  • Access Control: Implement proper authorization in your application layer
  • Data Freshness: Check updated_at timestamps to determine if cached data is stale

Error Codes

Status CodeError MessageDescription
401”Unauthorized - Invalid API key”The provided API key is invalid
404”Patient not found”No patient exists with the specified ID
500”Failed to fetch patient”An unexpected error occurred