This is a slow operation that fetches up-to-date patient data directly from the EMR system. If the newest data is not critical, consider using the GET /patients endpoint instead for faster results from cached data.
Performs a live fetch of patient data from the connected EMR system (eClinicalWorks) based on search criteria. This endpoint initiates an asynchronous search and returns results via webhook when ready.

Headers

NameTypeDescription
client_idstringRequired. Your Cobalt API client ID.
client_secretstringRequired. Your Cobalt API client secret.
access_tokenstringRequired. Token from Link Flow for the specific user.

Body Parameters

NameTypeDescription
search_bystringRequired. Identifies the search method or criteria being used. Must be either “dob”, “name”, or “phone”.
dobstringDate of birth in ISO 8601 format (YYYY-MM-DD).
first_namestringPatient’s first name.
last_namestringPatient’s last name.
phonestringPhone number in format XXX-XXX-XXXX (e.g., “555-123-4567”).
At least one of dob, first_name, last_name, or phone must be provided along with search_by. The search_by value selects which value(s) are used for searching, and are required.

Example Request

curl -X POST "https://api.usecobalt.com/v1/patients/fetch" \
  --header "client_id: <your_client_id>" \
  --header "client_secret: <your_client_secret>" \
  --header "access_token: <your_access_token>" \
  --header "Content-Type: application/json" \
  --data '{
    "search_by": "name",
    "first_name": "John",
    "last_name": "Doe"
  }'

Success Response

{
  "success": true,
  "message": "Live fetch request accepted. Results will be sent via webhook when ready.",
  "job_execution_id": "<job-execution-id>"
}

Error Responses

{
  "success": false,
  "message": "Missing required parameters: search_by."
}
{
  "success": false,
  "message": "At least one of the following parameters must be provided: dob, first_name, last_name, phone."
}
{
  "success": false,
  "message": "Invalid dob format. Use ISO format (YYYY-MM-DD)."
}
{
  "success": false,
  "message": "Invalid phone format. Must be XXX-XXX-XXXX."
}
{
  "success": false,
  "message": "Live fetch for patients is not supported for [EMR_NAME]. Currently supported: eClinicalWorks."
}
  • This endpoint supports live fetching from eClinicalWorks
  • The operation is asynchronous - results are delivered via webhook notification
  • Phone numbers must be formatted as XXX-XXX-XXXX
  • Dates must be in ISO 8601 format (YYYY-MM-DD)