This is a slow operation that fetches up-to-date appointment data directly from the EMR system. If the newest data is not critical, consider using the GET /appointments endpoint instead for faster results from cached data.
Performs a live fetch of appointment data from the connected EMR system (eClinicalWorks) for a specified date range. This endpoint initiates an asynchronous fetch and returns results via webhook when ready.
Name | Type | Description |
---|
client_id | string | Required. Your Cobalt API client ID. |
client_secret | string | Required. Your Cobalt API client secret. |
access_token | string | Required. Token from Link Flow for the specific user. |
Body Parameters
Name | Type | Description |
---|
start_date | string | Required. Start date for the appointment range in ISO 8601 format (YYYY-MM-DD). |
end_date | string | Required. End date for the appointment range in ISO 8601 format (YYYY-MM-DD). |
The date range cannot exceed 7 days. The end_date must be after the start_date.
Example Request
curl --request POST \
--url https://api.usecobalt.com/v1/appointments/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 '{
"start_date": "2023-12-01",
"end_date": "2023-12-07"
}'
Success Response (202 Accepted)
{
"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: start_date, end_date."
}
{
"success": false,
"message": "Invalid date format. Use ISO format (YYYY-MM-DD)."
}
{
"success": false,
"message": "end_date must be after start_date."
}
{
"success": false,
"message": "Date range cannot exceed 7 days."
}
{
"success": false,
"message": "Live fetch for appointments 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
- Both dates must be in ISO 8601 format (YYYY-MM-DD)
- Maximum date range is 7 days