Partner API v1

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_typeaction=upsert (required)action=reference (lookup key)
Patientmrn, first_name, last_namemrn
Practitionernpi, provider_namenpi
Appointmentappointment_id, startappointment_id
Encounterencounter_idencounter_id
MedicationRequestrx_number, medication_namerx_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

fieldrequireddescription
external_idyesYour 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_tagyesClassification / reason code (e.g. pre_appointment_reminder, medication_adherence_followup).
task_groupnoOptional batch or campaign identifier for grouping tasks.
prioritynoroutine (default) | urgent | asap | stat
requested_startnoISO 8601 UTC — earliest time to begin outreach.
requested_endnoISO 8601 UTC — hard cutoff after which outreach will not be attempted.
timezonenoIANA timezone string (e.g. America/New_York). Used to apply local calling hours.
additional_infonoFree-form JSON object for any partner-specific context you want stored on the task.

Batch response

The top-level status summarises the entire batch:

statusmeaning
SUCCESSAll items have status created or duplicate
PARTIAL_SUCCESSMix of successful and failed items
FAILUREAll 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 statusmeaning
createdTask (and all its resources) successfully created and synced
duplicateA 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).
failedValidation 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

codewhen
200 OKAll items resolved to created or duplicate
207 Multi-StatusMix of item statuses (at least one failed)
400 Bad RequestRequest body is empty
401 UnauthorizedMissing or invalid authentication token
422 Unprocessable EntityRequest body fails schema validation (missing required field, wrong type)
500 Internal Server ErrorUnexpected server error
post/api/v1/tasks

Request

  • Base URL
    https://api.hippocraticai.com (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Request body

Response

All items processed successfully (all created or duplicate)

statusstring required
trace_idstring required

Changes

No recorded changes to this operation across all 1 revision of this API.