{"openapi":"3.1.0","info":{"title":"Extractivio API","version":"1.0.0","description":"Convert PDF bank and credit card statements into structured transactions. Amounts are negative for money out. Text-based PDFs only."},"servers":[{"url":"https://extractivio.com"}],"security":[{"bearer":[]}],"paths":{"/api/v1/convert":{"post":{"operationId":"convertStatement","summary":"Convert a PDF statement","parameters":[{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv","xero","qbo","ofx","qfx","qif"],"default":"json"},"description":"Anything but json returns the file itself."},{"name":"date_order","in":"query","schema":{"type":"string","enum":["dmy","mdy"]},"description":"How to read ambiguous dates such as 03/04. Auto-detected when omitted."},{"name":"bank","in":"query","schema":{"type":"string"},"description":"Bank slug, for example chase, to apply that bank's parsing rules."},{"name":"store","in":"query","schema":{"type":"boolean","default":false},"description":"Keep the result so it appears in /api/v1/conversions."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"object","properties":{"file_url":{"type":"string","format":"uri","description":"Public https URL of the PDF."},"file_base64":{"type":"string","description":"The PDF, base64-encoded."},"filename":{"type":"string"}}}}}},"responses":{"200":{"description":"Transactions (format=json), or the converted file for other formats.","headers":{"x-pages":{"schema":{"type":"integer"}},"x-pages-used":{"schema":{"type":"integer"}},"x-pages-included":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversion"}},"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"missing_file, not_pdf, bad_format, bad_json or download_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"plan_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"too_large (over 15 MB)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"scanned_pdf or unreadable_pdf","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited (60 per minute) or quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/usage":{"get":{"operationId":"getUsage","summary":"Pages used this month","responses":{"200":{"description":"Usage","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string"},"pages_used":{"type":"integer"},"pages_included":{"type":"integer"}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/conversions":{"get":{"operationId":"listConversions","summary":"Stored results, newest first","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"summary","in":"query","schema":{"type":"boolean","default":false},"description":"Omit the transactions."}],"responses":{"200":{"description":"Conversions","content":{"application/json":{"schema":{"type":"object","properties":{"conversions":{"type":"array","items":{"$ref":"#/components/schemas/StoredConversion"}}}}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key from the account page, starting with ex_."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Transaction":{"type":"object","properties":{"date":{"type":"string","format":"date"},"description":{"type":"string"},"amount":{"type":"number","description":"Negative for money out, positive for money in."},"balance":{"type":["number","null"],"description":"Running balance printed on the row, if any."}},"required":["date","description","amount","balance"]},"BalanceCheck":{"type":"object","properties":{"checkable":{"type":"integer","description":"Rows with a balance and a previous balance."},"reconciled":{"type":"integer","description":"Rows where previous balance + amount = balance."}}},"Conversion":{"type":"object","properties":{"id":{"type":["string","null"]},"filename":{"type":"string"},"pages":{"type":"integer"},"currency":{"type":["string","null"]},"balance_check":{"$ref":"#/components/schemas/BalanceCheck"},"warnings":{"type":"array","items":{"type":"string","enum":["year-inferred","unsigned-amounts","card-convention"]}},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}}}},"StoredConversion":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"source":{"type":"string","enum":["email","api"]},"filename":{"type":"string"},"currency":{"type":["string","null"]},"transaction_count":{"type":"integer"},"balance_check":{"$ref":"#/components/schemas/BalanceCheck"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}}}}}}}