Submit outreach task bundles
Submit a batch of outreach task bundles.
Each item in the batch defines three things:
- target — who the AI agent will contact (Patient, Practitioner, etc.)
- focus — the reason for the outreach (Appointment, MedicationRequest, Encounter, etc.) — optional
- task — when and how to run the outreach (timing, priority, classification)
Up to 10 items can be submitted per request. Each item is processed independently — one failure does not cancel other items in the batch.
target and focus — resource actions
Both target and focus use the same TaskResource shape with an explicit action field:
{
"resource_type": "Patient",
"action": "upsert",
"data": { ... }
}
action="upsert" — HAI creates or updates the resource using the fields in data. Use this when sending a new or updated record. All required fields for the resource type must be present.
action="reference" — HAI looks up an existing resource by its lookup key only. Use this when the resource already exists and no update is needed. data must contain only the lookup key (e.g. mrn for Patient, npi for Practitioner). Returns status=failed for that item if the resource is not found.
Required data fields per resource type
| resource_type | action=upsert (required) | action=reference (lookup key) |
|---|---|---|
| Patient | mrn, first_name, last_name | mrn |
| Practitioner | npi, provider_name | npi |
| Appointment | appointment_id, start | appointment_id |
| Encounter | encounter_id | encounter_id |
| MedicationRequest | rx_number, medication_name | rx_number |
Additional optional fields (e.g. dob, phone, email, gender for Patient; provider_name for Appointment) are accepted and stored when provided. GET Appointment returns provider_name from the stored participant display.
task fields
| field | required | description |
|---|---|---|
| external_id | yes | Your unique identifier for this task. Submitting the same external_id again returns status=duplicate and refreshes the target/for/focus resources (re-upsert + SNOW sync) against the existing task — no new task is created. A transient SNOW failure during that refresh surfaces as failed (retryable with the same external_id), not duplicate. |
| task_tag | yes | Classification / reason code (e.g. pre_appointment_reminder, medication_adherence_followup). |
| task_group | no | Optional batch or campaign identifier for grouping tasks. |
| priority | no | routine (default) | urgent | asap | stat |
| requested_start | no | ISO 8601 UTC — earliest time to begin outreach. |
| requested_end | no | ISO 8601 UTC — hard cutoff after which outreach will not be attempted. |
| timezone | no | IANA timezone string (e.g. America/New_York). Used to apply local calling hours. |
| additional_info | no | Free-form JSON object for any partner-specific context you want stored on the task. |
Batch response
The top-level status summarises the entire batch:
| status | meaning |
|---|---|
| SUCCESS | All items have status created or duplicate |
| PARTIAL_SUCCESS | Mix of successful and failed items |
| FAILURE | All items failed |
Each item is processed atomically — every resource it touches (target, for, each focus[], and the task) is written in a single transaction and committed only after the downstream SNOW sync succeeds. If anything fails (validation, DB, or SNOW sync), the whole item is rolled back — nothing is persisted — and it is reported as failed. Retry the full payload; resubmission is idempotent via external_id.
Each item in results carries its own status:
| per-item status | meaning |
|---|---|
| created | Task (and all its resources) successfully created and synced |
| duplicate | A task with this external_id already exists — the task is not re-created, but its target/for/focus resources are refreshed (re-upsert + SNOW sync). A transient SNOW failure during the refresh returns failed (retryable with the same external_id). |
| failed | Validation error, resource not found, or a downstream failure — the item was rolled back (nothing persisted); see error field. Retry the full payload. |
HTTP response codes
| code | when |
|---|---|
| 200 OK | All items resolved to created or duplicate |
| 207 Multi-Status | Mix of item statuses (at least one failed) |
| 400 Bad Request | Request body is empty |
| 401 Unauthorized | Missing or invalid authentication token |
| 422 Unprocessable Entity | Request body fails schema validation (missing required field, wrong type) |
| 500 Internal Server Error | Unexpected server error |
Request
- Base URLhttps://api.hippocraticai.com (the document declares no server; this is the origin it was published from)
- AuthHTTP bearer
Request body
Response
All items processed successfully (all created or duplicate)
Changes
No recorded changes to this operation across all 1 revision of this API.