Overview
This page documents all data models used in the Enterprise API v2. All field names usesnake_case and timestamps are in ISO 8601 format.
Case
Represents a legal case in your organization.Enumerations
case_category values accepted when creating a case, including an inlinecase on a retrieval request:
personal_injurymotor_vehicle_accidentmedical_malpracticeworkers_compensationproduct_liabilitypremises_liabilitywrongful_deathother
activependingclosed
Document
Represents an uploaded document associated with a case.RetrievalRequest
Represents a medical record retrieval request submitted to a healthcare provider on behalf of a patient.
On
POST /v2/retrieval-requests, provide exactly one of case_id (an existing case) or case (an inline Case create body). Creating the case inline requires cases:write. The case-scoped create route takes its case ID from the URL and does not accept an inline case. GET and list responses omit the create-only auth_form and attachments upload references.
Enumerations
status — a simplified, stable enum suitable for client routing logic:
action_required_reason (only set when
status is action_required):
payment_needed— A provider fee needs your approval or paymentcontact_missing— Facility contact details could not be confirmedrequest_issue— Facility flagged an issue with the requestother— Catch-all
See the Record Retrieval Guide for what each stage means and a full example.
RetrievalRequestCosts
GET /v2/retrieval-requests/{id} returns current costs for a request. Amounts are
in USD, not cents. Costs can change after completion without advancing
public_updated_at or producing a webhook, so fetch the request again when you
need current costs.
RetrievalTimelineEntry
One step of a RetrievalRequesttimeline, mirroring a row of the dashboard’s status stepper. The standard steps (submitted through acknowledged, plus completed) always appear; invoice_received, action_required and cancelled appear only when they occurred, and action_required repeats once per action request.
PendingActionRequest
The open action request on a RetrievalRequest, returned byGET /v2/retrieval-requests/{id} only. null when nothing is waiting on your firm. Answer it with Respond to action request.
RequestedRecord
A single record line on a retrieval request. Each line targets one record type, optionally with its own date range and (for billing types) a deliverable format. A request may include multiple lines of the sametype with different dates or formats.
The table describes values accepted when creating a retrieval. GET and list
responses can contain additional
type, deliverable_format, or requirements
strings; clients should handle unfamiliar values.
type values
Grouped by category. The same categories appear in the dashboard form.
Medical
Billing —
deliverable_format is required for every billing line.
Imaging
deliverable_format values
Only applicable to billing-category lines.
To request multiple formats for the same billing type, submit multiple lines:
Permission-gated features
A handful of values are available only when enabled for your organization. Submitting one your organization does not have access to is rejected by the API. Contact Tavrn support to enable for your organization.
Lines without
requirements and without these gated type values work for all organizations.
A single request may use only one attestation kind — certification or affidavit — across all of its requested_records. Lines may include or omit requirements, but every line that includes one must use the same kind. A request that mixes the two (on the same line or different lines) is rejected with a 400 validation_error:
Patient
Sub-object on a RetrievalRequest. Supply as much as you know — many facilities verify identity against DOB, SSN last-4, or address before releasing records.
GET and list always include the patient fields, but
name and optional fields
can be null when unavailable. The API returns ssn: null even when an SSN was
supplied.
Facility
The facility / provider being asked for records. To create a retrieval, supply this object or a top-levelfacility_id from facility search.
Required-on-create fields apply only when supplying the facility object.
GET and list always include the name and address fields, but any can be
null
when unavailable. phone and fax can be omitted.
Facility Search Result
Returned byGET /v2/facilities
in a results array, without pagination or a total count.
Each requirement has
slug (identifier), label, description (string or null),
category (input, document, or instruction), and record_types (array of
categories such as medical_records, billings, or radiology). Empty
record_types means the requirement applies to all record types.
Document requirements may also include template_download_url (string, URI) for
an available blank template. Links are valid for 1 hour; repeat the facility search
for a fresh link. The field is omitted when no link is available.
UploadedFile
Reference to a file uploaded via the case presigned upload URL or, before a case exists, the retrieval upload URL. Use the returnedupload_id to attach it to a retrieval request.
Used directly as the element shape of
attachments[]. The auth_form field uses an extended shape — AuthFormUpload — that adds optional signer metadata.
AuthFormUpload
Extends UploadedFile with optional signer metadata. Used for theauth_form field on a retrieval request.
When both
signer_name and signer_relationship are omitted, the authorization is treated as signed by the patient themselves.
RetrievalRequestDocument
Represents a record received from a facility, a provider invoice, or a request cost summary. Distinct from Document, which represents a file uploaded to a case for another workflow. The two resources do not overlap.
An invoice can appear in the document list and contribute to costs before it is
downloadable. Its download endpoint returns
404 until the file is available.
retrieval_request.documents_available is sent when it becomes downloadable.
A cost_summary is available once the request is completed and billing is finalized.
It summarizes Tavrn credits and fees, provider fees, and the total.
See Request cost PDF for the download flow.
Enumerations
category:records— Records received from the facility (e.g., medical records, billing, radiology)invoice— A provider invoice for fees charged to retrieve the recordscost_summary— A PDF of credits, provider fees, and total costs for a completed request with finalized billing
Webhook
Represents a webhook endpoint configuration. Creating a webhook requiresname, url, and at least one event in events. description is optional. The table describes the object returned by GET, list, and update; the create response is shorter.
Webhook Events
retrieval_request.status_changed- Public retrieval status or timeline changedretrieval_request.action_required- Client action request opened or reopenedretrieval_request.documents_available- Records or a downloadable provider invoice became available
The
secret field is returned only during webhook creation. The create response
contains id, name, url, description, events, secret, is_enabled,
auto_disabled_at, last_failure, and created_at. Read the webhook to get the
additional health fields. API keys need retrievals:read as well as
webhooks:write to subscribe to retrieval events.Pagination
Cursor-paginated list endpoints, including cases, Requestors, and retrieval requests, use the fields below.GET /v2/retrieval-requests/{id}/documents returns the complete current document list in one response: next and previous are always null, and it does not accept limit, cursor, or category filters.
Query Parameters for cursor-paginated lists:
limit- Max results per page (default: 20, max: 100)cursor- Opaque pagination cursor
Error
Error response format.Common Error Codes
invalid_api_key- Missing or invalid API keyinsufficient_scope- API key lacks required scopevalidation_error- Request validation failedresource_not_found- Resource not foundinvalid_request- Malformed requestduplicate_name- Webhook name already exists within your organization
Example Objects
Complete Case
Paginated Response
Retrieval Request Creation (case-scoped)
This is a body forPOST /v2/cases/{case_id}/retrieval-requests. The standalone
POST /v2/retrieval-requests route also needs either case_id or an inline case.