{"openapi":"3.1.0","info":{"title":"Chartely API","version":"1.0.0","description":"Chartely turns a stack of case medical records into a chronology you can file: every visit, scan, procedure and work-status note as a dated event with provider, facility, a plain-English summary and a citation to the exact page it came from. Treatment gaps are flagged, a narrative summary is drafted, and the whole thing exports to Word, CSV or JSON. The same engine is a single-key API and an MCP server, so AI legal agents can build chronologies the way a paralegal does. Built for personal-injury, med-mal and workers'-comp teams that are tired of paying per page and waiting a week.","contact":{"name":"Chartely","url":"https://chartely.com","email":"hello@chartely.com"}},"servers":[{"url":"https://chartely.com"}],"security":[{},{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"cty_live_*"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]},"Event":{"type":"object","properties":{"date":{"type":["string","null"],"format":"date","description":"yyyy-mm-dd (or yyyy-mm / yyyy when only a partial date is printed), or null."},"date_text":{"type":["string","null"],"description":"The date exactly as printed, when it could not be normalized."},"date_precision":{"type":"string","enum":["day","month","year","unknown"]},"provider":{"type":["string","null"]},"facility":{"type":["string","null"]},"event_type":{"type":"string","enum":["visit","emergency","admission","discharge","imaging","test","procedure","surgery","medication","therapy","consult","work_status","other"]},"title":{"type":"string"},"summary":{"type":"string"},"page_ref":{"type":"integer","minimum":1,"description":"1-based page number in the uploaded document this event was read from."},"source_quote":{"type":["string","null"]},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["event_type","title","page_ref","confidence"]},"ChronologyMeta":{"type":"object","properties":{"patient_ref":{"type":["string","null"],"description":"Claimant/patient name as printed in the records. Not identity-verified."},"record_source":{"type":["string","null"]},"provider_count":{"type":"integer"},"facility_count":{"type":"integer"},"first_event_date":{"type":["string","null"],"format":"date"},"last_event_date":{"type":["string","null"],"format":"date"}}},"BatchResponse":{"type":"object","properties":{"batch_id":{"type":"string"},"status":{"type":"string","enum":["completed"]},"count":{"type":"integer"},"succeeded":{"type":"integer"},"failed":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"status":{"type":"string","enum":["completed","failed"]},"file_name":{"type":"string"},"chronology_id":{"type":["string","null"]},"meta":{"type":"object","properties":{"patient_ref":{"type":["string","null"],"description":"Claimant/patient name as printed in the records. Not identity-verified."},"record_source":{"type":["string","null"]},"provider_count":{"type":"integer"},"facility_count":{"type":"integer"},"first_event_date":{"type":["string","null"],"format":"date"},"last_event_date":{"type":["string","null"],"format":"date"}}},"events":{"type":"array","items":{"type":"object","properties":{"date":{"type":["string","null"],"format":"date","description":"yyyy-mm-dd (or yyyy-mm / yyyy when only a partial date is printed), or null."},"date_text":{"type":["string","null"],"description":"The date exactly as printed, when it could not be normalized."},"date_precision":{"type":"string","enum":["day","month","year","unknown"]},"provider":{"type":["string","null"]},"facility":{"type":["string","null"]},"event_type":{"type":"string","enum":["visit","emergency","admission","discharge","imaging","test","procedure","surgery","medication","therapy","consult","work_status","other"]},"title":{"type":"string"},"summary":{"type":"string"},"page_ref":{"type":"integer","minimum":1,"description":"1-based page number in the uploaded document this event was read from."},"source_quote":{"type":["string","null"]},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["event_type","title","page_ref","confidence"]}},"gaps":{"type":"array","items":{"type":"object","properties":{"from_date":{"type":"string","format":"date"},"to_date":{"type":"string","format":"date"},"days":{"type":"integer"},"after_event_index":{"type":"integer"}}}},"narrative":{"type":"string"},"confidence":{"type":"number","minimum":0,"maximum":1},"page_count":{"type":"integer"},"event_count":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}},"required":["index","status","file_name"]}},"request_id":{"type":"string"},"disclaimer":{"type":"string"}},"required":["status","count","succeeded","failed","results","request_id"]}}},"paths":{"/api/v1/chronology":{"post":{"summary":"Build a page-cited chronology from a case medical-record PDF or text - every event dated, cited to its page, with treatment gaps flagged.","operationId":"post_api_v1_chronology","security":[{},{"bearerAuth":[]}],"parameters":[{"name":"format","in":"query","required":false,"description":"csv | json | word - return a converted file instead of JSON. Word requires a Pro or Scale key.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"chronology_id":{"type":["string","null"]},"status":{"type":"string","enum":["completed"]},"meta":{"type":"object","properties":{"patient_ref":{"type":["string","null"],"description":"Claimant/patient name as printed in the records. Not identity-verified."},"record_source":{"type":["string","null"]},"provider_count":{"type":"integer"},"facility_count":{"type":"integer"},"first_event_date":{"type":["string","null"],"format":"date"},"last_event_date":{"type":["string","null"],"format":"date"}}},"events":{"type":"array","items":{"type":"object","properties":{"date":{"type":["string","null"],"format":"date","description":"yyyy-mm-dd (or yyyy-mm / yyyy when only a partial date is printed), or null."},"date_text":{"type":["string","null"],"description":"The date exactly as printed, when it could not be normalized."},"date_precision":{"type":"string","enum":["day","month","year","unknown"]},"provider":{"type":["string","null"]},"facility":{"type":["string","null"]},"event_type":{"type":"string","enum":["visit","emergency","admission","discharge","imaging","test","procedure","surgery","medication","therapy","consult","work_status","other"]},"title":{"type":"string"},"summary":{"type":"string"},"page_ref":{"type":"integer","minimum":1,"description":"1-based page number in the uploaded document this event was read from."},"source_quote":{"type":["string","null"]},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["event_type","title","page_ref","confidence"]}},"gaps":{"type":"array","items":{"type":"object","properties":{"from_date":{"type":"string","format":"date"},"to_date":{"type":"string","format":"date"},"days":{"type":"integer"},"after_event_index":{"type":"integer"}}}},"narrative":{"type":"string"},"confidence":{"type":"number","minimum":0,"maximum":1},"page_count":{"type":"integer"},"event_count":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"request_id":{"type":"string"},"disclaimer":{"type":"string"},"attribution":{"type":"string","description":"Present on free/anonymous responses only."}},"required":["status","meta","events","gaps","narrative","confidence","page_count","request_id"]}}}},"402":{"description":"Upgrade required (Free plan has no API access)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Could not process the document","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"Already-extracted record text."},"file_base64":{"type":"string","description":"Base64-encoded PDF bytes."},"file_name":{"type":"string"},"file_url":{"type":"string","format":"uri","description":"https:// URL to fetch the PDF from."},"matter_name":{"type":"string"},"matter_type":{"type":"string","enum":["personal_injury","medical_malpractice","workers_comp","mass_tort","disability","other"]}},"description":"Provide exactly one of text, file_base64 or file_url (or send multipart/form-data with a `file` field instead of JSON)."}},"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}}}},"/api/v1/chronology/batch":{"post":{"summary":"Build chronologies for several record sets in one call (Pro: up to 25, Scale: up to 200). One bad file fails only that item, never the whole batch.","operationId":"post_api_v1_chronology_batch","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"batch_id":{"type":"string"},"status":{"type":"string","enum":["completed"]},"count":{"type":"integer"},"succeeded":{"type":"integer"},"failed":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"status":{"type":"string","enum":["completed","failed"]},"file_name":{"type":"string"},"chronology_id":{"type":["string","null"]},"meta":{"type":"object","properties":{"patient_ref":{"type":["string","null"],"description":"Claimant/patient name as printed in the records. Not identity-verified."},"record_source":{"type":["string","null"]},"provider_count":{"type":"integer"},"facility_count":{"type":"integer"},"first_event_date":{"type":["string","null"],"format":"date"},"last_event_date":{"type":["string","null"],"format":"date"}}},"events":{"type":"array","items":{"type":"object","properties":{"date":{"type":["string","null"],"format":"date","description":"yyyy-mm-dd (or yyyy-mm / yyyy when only a partial date is printed), or null."},"date_text":{"type":["string","null"],"description":"The date exactly as printed, when it could not be normalized."},"date_precision":{"type":"string","enum":["day","month","year","unknown"]},"provider":{"type":["string","null"]},"facility":{"type":["string","null"]},"event_type":{"type":"string","enum":["visit","emergency","admission","discharge","imaging","test","procedure","surgery","medication","therapy","consult","work_status","other"]},"title":{"type":"string"},"summary":{"type":"string"},"page_ref":{"type":"integer","minimum":1,"description":"1-based page number in the uploaded document this event was read from."},"source_quote":{"type":["string","null"]},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["event_type","title","page_ref","confidence"]}},"gaps":{"type":"array","items":{"type":"object","properties":{"from_date":{"type":"string","format":"date"},"to_date":{"type":"string","format":"date"},"days":{"type":"integer"},"after_event_index":{"type":"integer"}}}},"narrative":{"type":"string"},"confidence":{"type":"number","minimum":0,"maximum":1},"page_count":{"type":"integer"},"event_count":{"type":"integer"},"warnings":{"type":"array","items":{"type":"string"}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}},"required":["index","status","file_name"]}},"request_id":{"type":"string"},"disclaimer":{"type":"string"}},"required":["status","count","succeeded","failed","results","request_id"]}}}},"402":{"description":"Upgrade required (Free plan has no API access)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Could not process the document","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","description":"One entry per record set. Each item accepts the same text/file_base64+file_name/file_url shape as POST /chronology, plus an optional per-item matter_name/matter_type override.","items":{"type":"object","properties":{"text":{"type":"string"},"file_base64":{"type":"string"},"file_name":{"type":"string"},"file_url":{"type":"string","format":"uri"},"matter_name":{"type":"string"},"matter_type":{"type":"string","enum":["personal_injury","medical_malpractice","workers_comp","mass_tort","disability","other"]}}}},"matter_name":{"type":"string","description":"Batch-level default (JSON body only)."},"matter_type":{"type":"string","enum":["personal_injury","medical_malpractice","workers_comp","mass_tort","disability","other"]}},"description":"JSON body with an `items` array, or multipart/form-data with repeated `file` fields (+ a shared matter_name/matter_type)."}},"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"array","items":{"type":"string","format":"binary"}},"matter_name":{"type":"string"},"matter_type":{"type":"string"}}}}}}}},"/api/v1/chronologies":{"get":{"summary":"List the caller's own saved chronologies, newest first.","operationId":"get_api_v1_chronologies","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"chronologies":{"type":"array","items":{"type":"object"}}}}}}},"402":{"description":"Upgrade required (Free plan has no API access)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Could not process the document","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/chronologies/{id}":{"get":{"summary":"Get one saved chronology with its full event list.","operationId":"get_api_v1_chronologies_id","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Chronology id returned by POST /chronology.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"meta":{"type":"object","properties":{"patient_ref":{"type":["string","null"],"description":"Claimant/patient name as printed in the records. Not identity-verified."},"record_source":{"type":["string","null"]},"provider_count":{"type":"integer"},"facility_count":{"type":"integer"},"first_event_date":{"type":["string","null"],"format":"date"},"last_event_date":{"type":["string","null"],"format":"date"}}},"events":{"type":"array","items":{"type":"object","properties":{"date":{"type":["string","null"],"format":"date","description":"yyyy-mm-dd (or yyyy-mm / yyyy when only a partial date is printed), or null."},"date_text":{"type":["string","null"],"description":"The date exactly as printed, when it could not be normalized."},"date_precision":{"type":"string","enum":["day","month","year","unknown"]},"provider":{"type":["string","null"]},"facility":{"type":["string","null"]},"event_type":{"type":"string","enum":["visit","emergency","admission","discharge","imaging","test","procedure","surgery","medication","therapy","consult","work_status","other"]},"title":{"type":"string"},"summary":{"type":"string"},"page_ref":{"type":"integer","minimum":1,"description":"1-based page number in the uploaded document this event was read from."},"source_quote":{"type":["string","null"]},"confidence":{"type":"string","enum":["high","medium","low"]}},"required":["event_type","title","page_ref","confidence"]}}}}}}},"402":{"description":"Upgrade required (Free plan has no API access)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Could not process the document","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/chronologies/{id}/export":{"get":{"summary":"Download a saved chronology converted to CSV, JSON or Word.","operationId":"get_api_v1_chronologies_id_export","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Chronology id.","schema":{"type":"string"}},{"name":"format","in":"query","required":true,"description":"csv | json | word.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Upgrade required (Free plan has no API access)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Could not process the document","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/v1/pricing":{"get":{"summary":"Machine-readable pricing - plans, included pages, per-page overage, rate limits and features.","operationId":"get_api_v1_pricing","security":[{},{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"unit":{"type":"string","enum":["page"]},"currency":{"type":"string"},"anonymous":{"type":"object"},"plans":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["free","pro","scale"]},"name":{"type":"string"},"price_usd_per_month":{"type":"number"},"included_pages_per_month":{"type":"integer"},"overage_usd_per_page":{"type":"number"},"rate_limit_per_minute":{"type":"integer"},"batch_max_files":{"type":"integer"},"api_access":{"type":"boolean"}}}}}}}}},"402":{"description":"Upgrade required (Free plan has no API access)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Could not process the document","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}}}}}}}}}