{"openapi":"3.1.0","info":{"title":"PaperTotal API","version":"1.0.0","description":"The PaperTotal API. Send a key as `Authorization: Bearer ptk_live_...`. A key reaches one workspace and only the scopes it was given. An OAuth access token (`pta_...`) goes on the same header and reaches the same routes, within the scopes the person granted.\n\nRequests are limited per workspace, across all of its keys and tokens: 600 a minute on Business, 120 on Pro, 60 on Starter and 30 with no plan. Past that the API answers 429 with code RATE_LIMITED and a Retry-After header.\n\nMoney is an integer in minor units with a currency code, dates are YYYY-MM-DD, and every error has the same body with a stable code and a message written for a person.\n\nSending a file. Ask POST /v1/uploads for a ticket, saying what the file is for (`purpose`), its type and its size in bytes. PUT exactly that many bytes to the ticket's `url`, with its `headers` and no others: the file goes straight to storage and never through this API. Then call the route the file is for with JSON naming `uploadId` where it would otherwise take a multipart `file`: POST /v1/documents or any other route that reads a document, such as POST /v1/documents/classify, POST /v1/parse or POST /v1/split, for document, POST /v1/expenses/{id}/receipts for expense_receipt, POST /v1/mileage/{id}/odometer-photos for odometer_photo, POST /v1/approvals/policy for policy_document, the statement imports under /v1/payment-accounts for statement, and POST /v1/attachments for attachment. Nothing counts until that route has checked the stored file: its bytes decide its type, and a file that is not acceptable is refused there and deleted. The ticket stops working at `expiresAt`, and a failed PUT is treated as an expired one: ask for a new ticket and try once more. A multipart `file` on the same routes still works, and is the simple way for a script.\n\nA key can require signed requests. Send X-PaperTotal-Request-Timestamp with the Unix time and X-PaperTotal-Request-Signature with the hex HMAC-SHA256 of \"<timestamp>.<METHOD>.<path and query>.<raw body>\", using the key's client secret. A signature is good for 30 minutes either way, and one that is sent is always checked. It covers a JSON body or none, so send a file as file_data when signing."},"servers":[{"url":"https://api.papertotal.com"}],"security":[{"apiKey":[]}],"tags":[{"name":"analytics"},{"name":"api-keys"},{"name":"attachments"},{"name":"automation-rules"},{"name":"bank-statements"},{"name":"bank-statements-set"},{"name":"billing"},{"name":"blueprints"},{"name":"budgets"},{"name":"business-cards"},{"name":"categories"},{"name":"check-with-document"},{"name":"checks"},{"name":"clients"},{"name":"contacts"},{"name":"custom-fields"},{"name":"documents"},{"name":"documents-set"},{"name":"expenses"},{"name":"export-history"},{"name":"exports"},{"name":"folders"},{"name":"forwarding"},{"name":"fraud"},{"name":"integrations"},{"name":"invitations"},{"name":"mail-in"},{"name":"me"},{"name":"members"},{"name":"merchants"},{"name":"mileage"},{"name":"mileage-rates"},{"name":"parse"},{"name":"parse-set"},{"name":"payment-accounts"},{"name":"per-diem"},{"name":"per-diem-rates"},{"name":"personal-rules"},{"name":"projects"},{"name":"reference"},{"name":"release-notifications"},{"name":"report-fields"},{"name":"reports"},{"name":"split"},{"name":"split-and-classify"},{"name":"tags"},{"name":"tax"},{"name":"time"},{"name":"tls-certificates"},{"name":"transactions"},{"name":"travel"},{"name":"uploads"},{"name":"vehicles"},{"name":"w-8ben-e"},{"name":"w2s"},{"name":"w2s-set"},{"name":"w9s"},{"name":"webhooks"},{"name":"workflows"},{"name":"workspace"},{"name":"workspaces"}],"paths":{"/v1/analytics/by-category":{"get":{"operationId":"Analytics_byCategory","tags":["analytics"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by category","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/by-department":{"get":{"operationId":"Analytics_byDepartment","tags":["analytics"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by department","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/by-member":{"get":{"operationId":"Analytics_byMember","tags":["analytics"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by member","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/by-merchant":{"get":{"operationId":"Analytics_byMerchant","tags":["analytics"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by merchant","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/by-project":{"get":{"operationId":"Analytics_byProject","tags":["analytics"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by project","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/by-tag":{"get":{"operationId":"Analytics_byTag","tags":["analytics"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by tag","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/summary":{"get":{"operationId":"Analytics_summary","tags":["analytics"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending totals for a period, with the period before it","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsSummary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/trend":{"get":{"operationId":"Analytics_trend","tags":["analytics"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending over time","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trend"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/api-keys/verify":{"get":{"operationId":"ApiKeys_verify","tags":["api-keys"],"security":[{"apiKey":["any_api_key"]}],"x-required-scope":"any_api_key","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See what the calling key grants","description":"Any key may call this about itself, whatever its scopes. It says what the key can reach, in which workspace, and until when. Every other route under /v1/api-keys takes a person, so a key cannot mint a stronger key.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyVerification"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/attachments":{"post":{"operationId":"Attachments_create","tags":["attachments"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Make a file a comment or a message can carry","description":"From a finished upload with the purpose attachment. Name its id in attachmentIds on a comment or a message. A file nothing names is deleted after a week.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAttachmentInput"},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attachment"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules":{"get":{"operationId":"Automation_list","tags":["automation-rules"],"security":[{"apiKey":["rules:read"]}],"x-required-scope":"rules:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List automation rules","description":"The workspace's rules, top to bottom. The first rule to set a field wins it.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRuleList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Automation_create","tags":["automation-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add an automation rule","description":"Conditions match on the expense, its line items, its tags and flags, the words on its document, or a question for Claude.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRuleInput"},"example":{"name":"string","conditions":[{"field":"merchantName","op":"equals"}],"actions":{}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/{id}":{"delete":{"operationId":"Automation_remove","tags":["automation-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete an automation rule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Automation_update","tags":["automation-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change an automation rule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAutomationRuleInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/{id}/apply":{"post":{"operationId":"Automation_apply","tags":["automation-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Run a rule over expenses not yet submitted","description":"A field a person set keeps their value. Running it twice changes nothing more.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationApply"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/{id}/test":{"post":{"operationId":"Automation_test","tags":["automation-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Count what a saved rule would match","description":"Changes nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationPreview"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/export":{"get":{"operationId":"Automation_exportFile","tags":["automation-rules"],"security":[{"apiKey":["rules:read"]}],"x-required-scope":"rules:read","x-required-permission":"policies.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Export automation rules as a file","description":"Every workspace rule, in order, with names in place of ids, so another workspace can import it. Needs policies.manage.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/import":{"post":{"operationId":"Automation_import","tags":["automation-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import automation rules from CSV","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/import-file":{"post":{"operationId":"Automation_importFile","tags":["automation-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import automation rules from a file","description":"Takes what the export route gives. Each name is looked up in this workspace, and a rule that names something it does not have comes back in errors, with the reason. A rule already here is skipped.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesDocument"},"example":{"format":"papertotal.rules","version":1,"rules":[{"name":"string","conditions":[{"field":"merchantName","op":"equals"}],"actions":{}}]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/preview":{"post":{"operationId":"Automation_preview","tags":["automation-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Count what some conditions would match","description":"Changes nothing. The sample shows expenses, so it needs rules:write and policies.manage.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationPreviewInput"},"example":{"conditions":[{"field":"merchantName","op":"equals"}]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationPreview"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/reorder":{"post":{"operationId":"Automation_reorder","tags":["automation-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Put the rules in a new order","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderAutomationRulesInput"},"example":{"ids":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRuleOrder"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/bank-statements":{"post":{"operationId":"SpecialDocuments_bankStatements","tags":["bank-statements"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a bank statement","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/bank-statements-set":{"get":{"operationId":"DocumentSets_listStatementSets","tags":["bank-statements-set"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List bank statement sets","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentSets_createStatementSet","tags":["bank-statements-set"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF of bank statements and read each one","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Up to 250 pages and 50 MB. Answers at once. bank_statement_set.created says when every statement is read, and bank_statement_set.failed why not. Account numbers are masked in every view.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/bank-statements-set/{id}":{"get":{"operationId":"DocumentSets_getStatementSet","tags":["bank-statements-set"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a bank statement set","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/bank-statements/async":{"post":{"operationId":"SpecialDocuments_bankStatementsAsync","tags":["bank-statements"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a bank statement in the background","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing":{"get":{"operationId":"Billing_view","tags":["billing"],"security":[{"apiKey":["billing:read"]}],"x-required-scope":"billing:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the plan, seats and this month's usage","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/cancel":{"post":{"operationId":"Billing_cancel","tags":["billing"],"security":[{"apiKey":["billing:write"]}],"x-required-scope":"billing:write","x-required-permission":"billing.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Cancel the subscription","description":"It ends when the period already paid for does, as cancelling in the billing portal does. Asking twice changes nothing. Needs billing.manage.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/invoices":{"get":{"operationId":"Billing_invoices","tags":["billing"],"security":[{"apiKey":["billing:read"]}],"x-required-scope":"billing:read","x-required-permission":"billing.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List invoices","description":"Newest first, from Stripe, with Stripe's own links to each invoice's page and PDF. A plan bought in a store has its invoices there.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingInvoicePage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/blueprints":{"get":{"operationId":"Blueprints_list","tags":["blueprints"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List blueprints","description":"This workspace's own, then the built-in catalogue.","parameters":[{"name":"documentType","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueprintList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Blueprints_create","tags":["blueprints"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a blueprint","description":"A strict subset of JSON schema: object, array, string, number, integer and boolean, nested up to four levels and up to 150 fields. A keyword outside it, such as $ref, pattern or anyOf, is refused by name. Needs settings.manage.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBlueprintInput"},"example":{"name":"string","title":"string","schema":{"type":"object","properties":"string"}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blueprint"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/blueprints/{name}":{"delete":{"operationId":"Blueprints_remove","tags":["blueprints"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a blueprint","description":"Results it made stay, and its name can be used again.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Blueprints_get","tags":["blueprints"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a blueprint","description":"Asks for an older version with version.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"version","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":9007199254740991}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blueprint"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Blueprints_update","tags":["blueprints"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a blueprint","description":"A new schema or new field guidance adds a version. Results keep the version that made them.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBlueprintInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blueprint"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/blueprints/draft":{"post":{"operationId":"Blueprints_draft","tags":["blueprints"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Propose a blueprint from a sample","description":"Multipart, or JSON naming an uploadId from POST /v1/uploads. Reads one sample and proposes fields. Nothing is saved until it is sent to POST /v1/blueprints. Costs one scan.","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."}},"required":["uploadId"]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueprintDraft"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/blueprints/draft/{documentId}":{"get":{"operationId":"Blueprints_readDraft","tags":["blueprints"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a proposed blueprint","description":"The document id from proposing one. Answers READING until it has been read.","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueprintDraft"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/budgets":{"get":{"operationId":"Budgets_list","tags":["budgets"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List budgets","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/budgets/{id}":{"get":{"operationId":"Budgets_get","tags":["budgets"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a budget and how it stands","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Budget"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/business-cards":{"post":{"operationId":"SpecialDocuments_businessCards","tags":["business-cards"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a business card","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/categories":{"get":{"operationId":"Categories_list","tags":["categories"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List categories","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"enabled","in":"query","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["EXPENSE","COGS","INCOME","REFUND"]}},{"name":"origin","in":"query","required":false,"schema":{"type":"string","enum":["SYSTEM","CUSTOM","ACCOUNTING"]}},{"name":"headers","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Categories_create","tags":["categories"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a category","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/categories/{id}":{"delete":{"operationId":"Categories_remove","tags":["categories"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a category","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Categories_get","tags":["categories"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a category","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Categories_update","tags":["categories"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a category","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCategoryInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/categories/import":{"post":{"operationId":"Categories_import","tags":["categories"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import categories from CSV","description":"Send the CSV as text/plain, or as JSON with a `csv` field. Rows that match an existing category update it. Columns: Name, Enabled, GL code, Payroll code, Comment required, Comment hint, Max expense. With mode=replace the list becomes what the file says: a category it leaves out is deleted, or turned off if something uses it, and a file with a row it cannot read changes nothing.","parameters":[{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["merge","replace"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/check-with-document":{"post":{"operationId":"SpecialDocuments_checkWithDocument","tags":["check-with-document"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a check with its remittance","description":"Two documents, read apart: the check, and what came with it.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckWithDocumentInput"},"example":{"check":{},"document":{}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckWithDocument"}}}},"202":{"description":"Accepted. One or both are still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckWithDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/checks":{"post":{"operationId":"SpecialDocuments_checks","tags":["checks"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a bank check","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/checks/async":{"post":{"operationId":"SpecialDocuments_checksAsync","tags":["checks"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a bank check in the background","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/clients":{"get":{"operationId":"ClientsController2_list","tags":["clients"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"GET /v1/clients","x-undocumented":true,"parameters":[],"responses":{"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ClientsController2_create","tags":["clients"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"POST /v1/clients","x-undocumented":true,"parameters":[],"responses":{"default":{"$ref":"#/components/responses/Error"}}}},"/v1/clients/{id}":{"delete":{"operationId":"ClientsController2_remove","tags":["clients"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"DELETE /v1/clients/:id","x-undocumented":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"ClientsController2_get","tags":["clients"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"GET /v1/clients/:id","x-undocumented":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"ClientsController2_update","tags":["clients"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"PATCH /v1/clients/:id","x-undocumented":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"default":{"$ref":"#/components/responses/Error"}}}},"/v1/contacts":{"get":{"operationId":"Contacts_list","tags":["contacts"],"security":[{"apiKey":["contacts:read"]}],"x-required-scope":"contacts:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List contacts","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"documentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"email","in":"query","required":false,"schema":{"type":"string","maxLength":254}},{"name":"phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"website","in":"query","required":false,"schema":{"type":"string","maxLength":300}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"region","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"postalCode","in":"query","required":false,"schema":{"type":"string","maxLength":20}},{"name":"country","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/contacts/{id}":{"get":{"operationId":"Contacts_get","tags":["contacts"],"security":[{"apiKey":["contacts:read"]}],"x-required-scope":"contacts:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a contact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/contacts/{id}/vcard":{"get":{"operationId":"Contacts_vCard","tags":["contacts"],"security":[{"apiKey":["contacts:read"]}],"x-required-scope":"contacts:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download a contact as a vCard","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/vcard":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/contacts/export":{"post":{"operationId":"Contacts_export","tags":["contacts"],"security":[{"apiKey":["contacts:read"]}],"x-required-scope":"contacts:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Export contacts as vCard or CSV","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactExportInput"},"example":{"format":"vcard"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/vcard":{"schema":{"type":"string","format":"binary"}},"text/csv":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/custom-fields":{"get":{"operationId":"CustomFields_list","tags":["custom-fields"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List custom fields","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/custom-fields/{id}":{"get":{"operationId":"CustomFields_get","tags":["custom-fields"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a custom field","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomField"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents":{"get":{"operationId":"Documents_list","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List documents","description":"Ranges take __gt, __gte, __lt and __lte on created, updated, issued, total and tax: created__gte=2026-01-01, total__lt=5000. Issued, total and tax are what the document's expense holds, with whatever a person corrected, and a document with no expense has none. A day covers all of itself. order_by sorts, and a leading minus sorts down: -total. A document with no value comes last either way. A cursor resumes the created order only, so any other order pages with offset or page. is_empty names fields that must be empty. q searches the title, file name, notes, OCR text and extracted fields in any case; with an asterisk it searches the OCR text and extracted fields, case sensitive, and returns at most the newest 5,000 matches.","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]}},{"name":"source_id","in":"query","required":false,"schema":{"type":"string","maxLength":255}},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"blueprint_name","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"device_id","in":"query","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}},{"name":"device_user_uuid","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"viewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"trashed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"envelope","in":"query","required":false,"schema":{"type":"string"}},{"name":"created__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"issued","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"total","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"vendor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"notes","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"payment_type","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"last_four_digits","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}$"}},{"name":"first_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"last_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"work_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"cell_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"email","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"website","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"country","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"zip","in":"query","required":false,"schema":{"type":"string","maxLength":20}},{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"is_empty","in":"query","required":false,"schema":{"type":"string","maxLength":400}},{"name":"order_by","in":"query","required":false,"schema":{"type":"string","enum":["created","updated","issued","total","tax","-created","-updated","-issued","-total","-tax"]}},{"name":"folderId","in":"query","required":false,"schema":{"type":"string"}},{"name":"mailInBatchId","in":"query","required":false,"schema":{"type":"string"}},{"name":"setId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"archived","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"unviewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"fraudColor","in":"query","required":false,"schema":{"type":"string","enum":["GREEN","YELLOW","RED"]}},{"name":"fraudSignal","in":"query","required":false,"schema":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},{"name":"fraudReview","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","FRAUD","NOT_FRAUD","UNKNOWN"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":10000}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50}},{"name":"track_total_results","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Documents_create","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Upload a file","description":"Multipart, or JSON naming an uploadId from POST /v1/uploads. The file's type comes from its bytes. Use a JPEG, PNG, WebP, HEIC, TIFF, PDF, DOCX, XLSX, CSV, TXT, HTML, EML or ZIP file. Up to 25 MB, or 50 MB for a PDF sent to be split into a set of documents. Reads best at 300 DPI for a PDF and 1000 pixels on the shorter side of an image. A ZIP unpacks into one document per file, up to 200 files and 200 MB, and each file counts against the plan. A ZIP inside a ZIP is refused. With a key this waits for the reading and answers with it, unless async is set. Name a type, or leave it out and the classifier says what it is.","parameters":[{"name":"client","in":"query","required":false,"schema":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"taxonomy":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"allowed_async_enrichments":{"maxItems":10,"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"compute":{"type":"boolean"},"parse_address":{"type":"boolean"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50},"boost_mode":{"type":"boolean"},"auto_delete":{"type":"boolean"},"stitch":{"type":"boolean"},"crop_document":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"async":{"type":"boolean"},"line_item_expansion":{"type":"boolean"},"tiff_dpi":{"type":"number"},"type":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"clientId":{"type":"string","minLength":8,"maxLength":255},"externalId":{"type":"string","maxLength":200},"folderId":{"type":"string"},"notes":{"type":"string","maxLength":2000},"capturedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"locationAccuracyM":{"type":"number","minimum":0},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"merchantName":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"totalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"taxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"category":{"type":"string","minLength":1,"maxLength":120}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"taxonomy":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"allowed_async_enrichments":{"maxItems":10,"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"compute":{"type":"boolean"},"parse_address":{"type":"boolean"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50},"boost_mode":{"type":"boolean"},"auto_delete":{"type":"boolean"},"stitch":{"type":"boolean"},"crop_document":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"async":{"type":"boolean"},"line_item_expansion":{"type":"boolean"},"tiff_dpi":{"type":"number"},"type":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"clientId":{"type":"string","minLength":8,"maxLength":255},"externalId":{"type":"string","maxLength":200},"folderId":{"type":"string"},"notes":{"type":"string","maxLength":2000},"capturedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"locationAccuracyM":{"type":"number","minimum":0},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"merchantName":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"totalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"taxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"category":{"type":"string","minLength":1,"maxLength":120}},"required":["uploadId"]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents-set":{"get":{"operationId":"DocumentSets_listDocumentsSets","tags":["documents-set"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List sets of documents","description":"Includes ZIPs and batches of addresses.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentSets_createDocumentsSet","tags":["documents-set"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF and read each document in it","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Up to 250 pages and 50 MB. Answers at once. Each part fires document.processed and counts as a scan, and document_set.completed says when all are read.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents-set/{id}":{"get":{"operationId":"DocumentSets_getDocumentsSet","tags":["documents-set"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a set and the documents it made","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}":{"delete":{"operationId":"Documents_remove","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Documents_get","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a document and its extraction","description":"Links are signed again on every read, with no new reading. detailed=true adds the reading with each field wrapped as value, score, ocrScore, rotation, boundingBox, boundingRegion and enriched. with_scores=true adds lineItemsWithScores and taxLinesWithScores. recordStatus says processed, reviewed or archived. bounding_boxes=true adds every line read with its box and four corners, and where each field was read from: boundingBox as [page, x1, y1, x2, y2] and boundingRegion as [x1, y1, x2, y2, x3, y3, x4, y4], both as fractions of the page. confidence_details=true adds how sure the read of each field was. Both can be sent on a submission too.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"bounding_boxes","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"confidence_details","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"detailed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"with_scores","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Documents_update","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a document","description":"status REVIEWED marks it checked, approved sets your own flag, fraudReview records a decision, and billable, merchantName and the totals change its expense, under the rules of PATCH /v1/expenses/{id}. What can be refused is checked first, so nothing changes when any of it is.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Documents_replace","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a document, for a client written for PUT","description":"The same as PATCH: it changes what the body names and nothing else.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/cancel":{"post":{"operationId":"Documents_cancel","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Stop reading a document","description":"For filling in the details by hand. The file stays, and it can be read again.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/crop":{"post":{"operationId":"Documents_crop","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Crop a photo","description":"A box as fractions of the page as it shows now. The original stays as it came: a new page is drawn from it and read again, and it stays cropped through every later read. Only images can be cropped.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CropDocumentInput"},"example":{"x":0,"y":0,"width":0,"height":0}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/fraud-review":{"post":{"operationId":"FraudReview_review","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Record a person's decision on a document","description":"Fraud, not fraud or unknown, with the signals they agree with. A re-read replaces the evidence and leaves this alone. Nobody decides on their own upload except the workspace owner.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FraudReviewInput"},"example":{"decision":"FRAUD"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/line-items":{"delete":{"operationId":"DocumentLineItems_removeAll","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete every line item","description":"The total stays as the receipt printed it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"DocumentLineItems_list","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a document's line items","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLinePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentLineItems_create","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a line item","description":"The lines of the document's expense. When they added up to its total, a change to one moves the total and the converted amount with it. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLineInput"},"example":{"description":"string","amountMinor":0}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLine"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/line-items/{lineId}":{"delete":{"operationId":"DocumentLineItems_remove","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a line item","description":"The lines of the document's expense. When they added up to its total, a change to one moves the total and the converted amount with it. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"lineId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"DocumentLineItems_get","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a line item","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"lineId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLine"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"DocumentLineItems_update","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a line item","description":"The lines of the document's expense. When they added up to its total, a change to one moves the total and the converted amount with it. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"lineId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExpenseLineInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLine"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/ofx":{"get":{"operationId":"DocumentOfx_ofx","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download a bank statement as OFX","description":"OFX 1.0.2, the file accounting software and personal finance programs import, from the latest reading of a bank statement: the rules' reading, Claude's, or the bank_statement blueprint's. Each account on the statement gets its own transactions, with FITIDs that stay the same each time. Account and routing numbers are masked, so match the file to an account when importing it. A document that is not a statement, or one with nothing read from it, answers 409 saying which.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/x-ofx":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/original":{"get":{"operationId":"DocumentsBulk_original","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a short-lived link to the original file","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentOriginal"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/pdf":{"get":{"operationId":"DocumentsBulk_pdf","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download a document as a PDF","description":"A file that already is a PDF answers 302 to a short-lived link on storage, so follow the redirect, without your Authorization header. Anything else is built on the spot and comes back here.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/reprocess":{"post":{"operationId":"Documents_reprocess","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a document again","description":"Fields a person changed are left alone.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/reveal":{"post":{"operationId":"DocumentsReveal_reveal","tags":["documents"],"security":[{"apiKey":["documents:reveal"]}],"x-required-scope":"documents:reveal","x-required-permission":"documents.reveal","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Open the bank and tax numbers read from a document","description":"Needs the documents.reveal permission and, for a key, the documents:reveal scope. Every call writes an audit row. Also returns a link to the original file and, for a check, its TIFF images. Nothing else hands these out.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevealDocumentInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevealedDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/rotate":{"post":{"operationId":"Documents_rotate","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Turn a page","description":"A quarter turn, counter-clockwise by default. The original stays as it came: a new page is drawn from it and read again, and it stays turned through every later read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateDocumentInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/split":{"post":{"operationId":"DocumentSplit_split","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF already uploaded","description":"Every page, or the ranges given. Each part is a document and counts as a scan, and the whole goes to the trash once the parts exist.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"client","in":"query","required":false,"schema":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitDocumentInput"},"example":{"mode":"every_page"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/tags":{"delete":{"operationId":"DocumentTags_removeAll","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Take every tag off a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"DocumentTags_list","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a document's tags","description":"Any type of document: receipts, checks, bank statements, business cards, contracts, tax forms and the rest.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTagList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentTags_addMany","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add several tags to a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTagsInput"},"example":{"tags":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTagList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"DocumentTags_add","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a tag to a document","description":"By name. A name the workspace does not have makes the tag. Adding one it already has changes nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTagInput"},"example":{"name":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTagList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/tags/{tagId}":{"delete":{"operationId":"DocumentTags_remove","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Take a tag off a document","description":"The tag stays in the workspace.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"tagId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/tax-lines":{"get":{"operationId":"DocumentTaxLines_list","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a document's tax lines","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLinePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentTaxLines_create","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a tax line","description":"The expense's tax is the sum of its tax lines. When its total was what is under the tax and on top of it, the total moves with the tax. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLineInput"},"example":{"amountMinor":0}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLine"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/tax-lines/{taxLineId}":{"delete":{"operationId":"DocumentTaxLines_remove","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a tax line","description":"The expense's tax is the sum of its tax lines. When its total was what is under the tax and on top of it, the total moves with the tax. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"taxLineId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"DocumentTaxLines_get","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a tax line","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"taxLineId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLine"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"DocumentTaxLines_update","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a tax line","description":"The expense's tax is the sum of its tax lines. When its total was what is under the tax and on top of it, the total moves with the tax. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"taxLineId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExpenseTaxLineInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLine"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/text":{"get":{"operationId":"DocumentsBulk_text","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the text read from a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentText"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/any":{"post":{"operationId":"DocumentExtraction_any","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a document with a blueprint","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. The answer is in blueprint.result. Without a Claude key on the server, blueprint.error says so and the text is still read. 20 pages by default and 50 at most.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","blueprint_name"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50}}},"example":{"blueprint_name":"string"}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50}},"description":"Name the file with one of uploadId, file_url or file_data.","required":["blueprint_name"],"allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string","blueprint_name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/any/async":{"post":{"operationId":"DocumentExtraction_anyAsync","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a document with a blueprint, in the background","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Answers at once. document.processed says when it is done.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","blueprint_name"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50}}},"example":{"blueprint_name":"string"}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50}},"description":"Name the file with one of uploadId, file_url or file_data.","required":["blueprint_name"],"allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string","blueprint_name":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/batch":{"post":{"operationId":"DocumentExtraction_batch","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Submit up to 100 addresses at once","description":"Answers at once with a set. Each address becomes a document with its own webhook, and an address that fails is listed under refused without stopping the rest.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDocumentsInput"},"example":{"file_urls":["string"]}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/bulk":{"post":{"operationId":"DocumentsBulk_run","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Act on many documents","description":"Send ids, or a filter to act on everything that matches. With a filter, call again with nextCursor until it is null.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDocumentInput"},"example":{"action":{"type":"move","folderId":"string"}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDocumentResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/classify":{"post":{"operationId":"DocumentExtraction_classify","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Say what a document is","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Answers with a value and a score, from the built-in list or from document_types. It works with no Claude key for the common types, and Claude only decides what the rules cannot.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Classification"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/count":{"get":{"operationId":"DocumentsBulk_count","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Count the documents a filter matches","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]}},{"name":"source_id","in":"query","required":false,"schema":{"type":"string","maxLength":255}},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"blueprint_name","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"device_id","in":"query","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}},{"name":"device_user_uuid","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"viewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"trashed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"envelope","in":"query","required":false,"schema":{"type":"string"}},{"name":"created__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"issued","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"total","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"vendor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"notes","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"payment_type","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"last_four_digits","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}$"}},{"name":"first_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"last_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"work_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"cell_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"email","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"website","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"country","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"zip","in":"query","required":false,"schema":{"type":"string","maxLength":20}},{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"is_empty","in":"query","required":false,"schema":{"type":"string","maxLength":400}},{"name":"order_by","in":"query","required":false,"schema":{"type":"string","enum":["created","updated","issued","total","tax","-created","-updated","-issued","-total","-tax"]}},{"name":"folderId","in":"query","required":false,"schema":{"type":"string"}},{"name":"mailInBatchId","in":"query","required":false,"schema":{"type":"string"}},{"name":"setId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"archived","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"unviewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"fraudColor","in":"query","required":false,"schema":{"type":"string","enum":["GREEN","YELLOW","RED"]}},{"name":"fraudSignal","in":"query","required":false,"schema":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},{"name":"fraudReview","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","FRAUD","NOT_FRAUD","UNKNOWN"]}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentCount"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/extract":{"post":{"operationId":"DocumentExtraction_extract","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Say what a document is and read it, in one call","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. document_types may name built-in types and blueprints. Answers with extraction, or extraction_error when it could not be read.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Extraction"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/split":{"post":{"operationId":"DocumentSplit_splitUpload","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF on storage into documents","description":"The PDF named by uploadId, from POST /v1/uploads with purpose document_set, up to 50 MB. mode says where it is cut, and detect is the default. Each part is a document, counts as a scan and is held to 25 MB: a part past that is listed under refused, and the rest are filed.","parameters":[{"name":"client","in":"query","required":false,"schema":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitUploadInput"},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/trash":{"get":{"operationId":"DocumentsBulk_trashed","tags":["documents"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List deleted documents","description":"Each can be restored for 30 days.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrashedDocumentPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentsBulk_emptyOrRestore","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Restore deleted documents, or delete them for good","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrashActionInput"},"example":{"action":"restore"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrashActionResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/url":{"post":{"operationId":"PublicDocuments_submit","tags":["documents"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Submit a file by URL or base64","description":"By default the call waits up to 30 seconds and returns the extraction with 201. With async: true, or if reading takes longer, it answers 202 and the document.processed webhook says when it is done. file_url must be public https; redirects are not followed. file_urls reads several images as one document, in order. bucket and package_path read from your own S3 bucket, with keys saved in document settings. Use a JPEG, PNG, WebP, HEIC, TIFF, PDF, DOCX, XLSX, CSV, TXT, HTML, EML or ZIP file. Up to 25 MB, or 50 MB for a PDF sent to be split into a set of documents. Reads best at 300 DPI for a PDF and 1000 pixels on the shorter side of an image. A ZIP unpacks into one document per file, up to 200 files and 200 MB, and each file counts against the plan. A ZIP inside a ZIP is refused.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses":{"get":{"operationId":"Expenses_list","tags":["expenses"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List expenses","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["date:asc","date:desc","merchant:asc","merchant:desc","category:asc","category:desc","status:asc","status:desc","amount:asc","amount:desc"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpensePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Expenses_create","tags":["expenses"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create an expense","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExpenseInput"},"example":{"date":"string","amountMinor":0}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}":{"delete":{"operationId":"Expenses_remove","tags":["expenses"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Void an expense","description":"A voided expense stays for audit and leaves every total.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Expenses_get","tags":["expenses"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get an expense","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Expenses_update","tags":["expenses"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change an expense","description":"Send If-Match with the updatedAt you last read to make this conditional: if someone changed the expense since, it answers 409 CONFLICT with details.reason STALE_WRITE and changes nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"If-Match","in":"header","required":false,"description":"The expense's updatedAt, as read.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExpenseInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/comments":{"get":{"operationId":"ExpenseThread_list","tags":["expenses"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List comments on an expense","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ExpenseThread_add","tags":["expenses"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Comment on an expense","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostedComment"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/comments/{commentId}/reach":{"post":{"operationId":"ExpenseThread_reach","tags":["expenses"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Reach someone a comment on this expense could not","description":"An expense has no participants of its own, so they join the report it is on, and then they are told. Refused when it is on no report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReachMentionedInput"},"example":{"userIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reached"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/comments/mentionable":{"get":{"operationId":"ExpenseThread_mentionable","tags":["expenses"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List who a comment on this expense can mention","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MentionablePeople"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/duplicate":{"post":{"operationId":"ExpenseThread_duplicate","tags":["expenses"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Copy an expense, dated today, with no receipt","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedId"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/duplicates":{"get":{"operationId":"Expenses_duplicates","tags":["expenses"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List an expense and its possible duplicates","description":"Every copy in the group, not just a pair. hidden counts any the caller cannot read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDuplicateGroup"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/flags/{code}/dismiss":{"post":{"operationId":"ExpenseThread_dismissFlag","tags":["expenses"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Dismiss a flag on an expense","description":"For whoever has it for approval, or someone who manages expenses. The flag goes from the expense and stays in the audit log. Not for a hold.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissFlagInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hold"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/hold":{"post":{"operationId":"ExpenseThread_hold","tags":["expenses"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Put an expense on hold","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HoldExpenseInput"},"example":{"reason":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hold"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/receipts":{"post":{"operationId":"ExpenseReceipts_attach","tags":["expenses"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Attach a receipt to an expense","description":"Multipart, or JSON naming an uploadId from POST /v1/uploads. add files it beside what is there, and a first receipt on a receipt expense is read onto it. replace takes the current ones to the trash and reads the new one. Fields a person changed are left alone.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"client","in":"query","required":false,"schema":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"mode":{"default":"add","type":"string","enum":["add","replace"]},"clientId":{"type":"string","minLength":8,"maxLength":255},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"mode":{"default":"add","type":"string","enum":["add","replace"]},"clientId":{"type":"string","minLength":8,"maxLength":255},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}},"required":["uploadId"]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/settle-duplicates":{"post":{"operationId":"Expenses_settleDuplicates","tags":["expenses"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Answer a duplicate question","description":"keep all takes the hold off every one of them. keep selected keeps this one, discards the others and can take values from them, all in one step. The submitter and whoever holds the open approval can do this on an outstanding report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettleDuplicatesInput"},"example":{"keep":"all"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/unhold":{"post":{"operationId":"ExpenseThread_unhold","tags":["expenses"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Take an expense off hold","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hold"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/bulk":{"post":{"operationId":"Expenses_bulk","tags":["expenses"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change many expenses","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkExpenseInput"},"example":{"ids":["string"],"action":{"type":"set_category","categoryId":"string"}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkExpenseResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/totals":{"get":{"operationId":"Expenses_totals","tags":["expenses"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Total the expenses that match a filter, or the ones selected, in any currency","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"maxItems":500,"type":"array","items":{"type":"string","minLength":1}}]}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTotals"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/export-history":{"get":{"operationId":"ExportHistory_list","tags":["export-history"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List which documents went where","description":"Files from exports, postings to connected services, and what programs recorded, with the id each has there. Needs expenses.read_all.","parameters":[{"name":"documentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"target","in":"query","required":false,"schema":{"type":"string","maxLength":60}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"via","in":"query","required":false,"schema":{"type":"string","enum":["EXPORT","SYNC","API"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRecordPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ExportHistory_append","tags":["export-history"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Record that documents went somewhere","description":"For an export a program made itself. A record already held is not written again, so a retry is safe.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRecordInput"},"example":{"documentIds":["string"],"target":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRecordsAppended"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/exports":{"get":{"operationId":"Exports_list","tags":["exports"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List exports","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJobPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Exports_create","tags":["exports"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Start an export","description":"Filters select by expense, or by report with reportState, reportIds, startDate and endDate (one year at most), approvedAfter and exported. policyIds takes workspace ids, and a key can only name its own. `template` is the file's whole layout as text, with ${expense.merchant}, <#list reports as report> and <#if report.exported>, and takes CSV, TXT, JSON or XML: a mistake in it answers 422 with the line. `onFinish` can email the file, mark the reports it covers as exported, which needs reports:write, and upload it by SFTP. SFTP needs the host key fingerprint of the server, refuses a private address, and never returns the credentials.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExportInput"},"example":{"kind":"expenses","format":"CSV"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJob"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/exports/{id}":{"get":{"operationId":"Exports_get","tags":["exports"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get an export and, when ready, its link","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJob"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/folders":{"get":{"operationId":"Folders_list","tags":["folders"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List folders","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"parentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Folders_create","tags":["folders"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"expenses.write_all","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a folder","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/folders/{id}":{"delete":{"operationId":"Folders_remove","tags":["folders"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"expenses.write_all","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a folder","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Folders_get","tags":["folders"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a folder","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Folders_update","tags":["folders"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"expenses.write_all","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a folder","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFolderInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/forwarding/emails":{"get":{"operationId":"Forwarding_recent","tags":["forwarding"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List email sent to the caller's forwarding addresses","description":"Every message, filed or not, with the sender, subject, received time, whether it carried a file, and any file left out and why.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundEmailPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/fraud/blocklist":{"get":{"operationId":"Fraud_blocklist","tags":["fraud"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List blocked devices","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceBlockPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Fraud_block","tags":["fraud"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Block a device","description":"A blocked device still captures. Its documents read red, with the reason stated, for a reviewer.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockDeviceInput"},"example":{"deviceId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceBlock"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/fraud/blocklist/{deviceId}":{"delete":{"operationId":"Fraud_unblock","tags":["fraud"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Remove a device from the blocklist","parameters":[{"name":"deviceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Fraud_blockStatus","tags":["fraud"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Check whether a device is blocked","description":"A device nobody blocked answers blocked: false, not 404.","parameters":[{"name":"deviceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceBlockStatus"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/fraud/export":{"get":{"operationId":"Fraud_export","tags":["fraud"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download the evidence on documents that match a filter","description":"The same filter as listing documents. Needs expenses.read_all.","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]}},{"name":"source_id","in":"query","required":false,"schema":{"type":"string","maxLength":255}},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"blueprint_name","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"device_id","in":"query","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}},{"name":"device_user_uuid","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"viewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"trashed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"envelope","in":"query","required":false,"schema":{"type":"string"}},{"name":"created__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"issued","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"total","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"vendor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"notes","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"payment_type","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"last_four_digits","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}$"}},{"name":"first_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"last_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"work_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"cell_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"email","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"website","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"country","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"zip","in":"query","required":false,"schema":{"type":"string","maxLength":20}},{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"is_empty","in":"query","required":false,"schema":{"type":"string","maxLength":400}},{"name":"order_by","in":"query","required":false,"schema":{"type":"string","enum":["created","updated","issued","total","tax","-created","-updated","-issued","-total","-tax"]}},{"name":"folderId","in":"query","required":false,"schema":{"type":"string"}},{"name":"mailInBatchId","in":"query","required":false,"schema":{"type":"string"}},{"name":"setId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"archived","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"unviewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"fraudColor","in":"query","required":false,"schema":{"type":"string","enum":["GREEN","YELLOW","RED"]}},{"name":"fraudSignal","in":"query","required":false,"schema":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},{"name":"fraudReview","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","FRAUD","NOT_FRAUD","UNKNOWN"]}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations":{"get":{"operationId":"Integrations_list","tags":["integrations"],"security":[{"apiKey":["integrations:read"]}],"x-required-scope":"integrations:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List connected services and what can be connected","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/health":{"get":{"operationId":"Integrations_health","tags":["integrations"],"security":[{"apiKey":["integrations:read"]}],"x-required-scope":"integrations:read","x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See how a connection stands","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationHealth"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/records":{"get":{"operationId":"Integrations_records","tags":["integrations"],"security":[{"apiKey":["integrations:read"]}],"x-required-scope":"integrations:read","x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List what was sent to a service","description":"Each record names the expense and the id it has in the other system.","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","SYNCED","FAILED","SKIPPED","VOIDED"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRecordPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invitations":{"get":{"operationId":"Invitations_list","tags":["invitations"],"security":[{"apiKey":["members:read"]}],"x-required-scope":"members:read","x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List invitations","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","EXPIRED","ACCEPTED","REVOKED"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Invitations_create","tags":["invitations"],"security":[{"apiKey":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Invite someone to this workspace","description":"They join when they accept, signed in with this address. An open invitation holds a seat.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitationInput"},"example":{"email":"someone@example.com"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationSent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invitations/{id}":{"delete":{"operationId":"Invitations_revoke","tags":["invitations"],"security":[{"apiKey":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Withdraw an invitation","description":"Works on a lapsed plan.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invitations/{id}/resend":{"post":{"operationId":"Invitations_resend","tags":["invitations"],"security":[{"apiKey":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Send an invitation again","description":"A new link. The old one stops working.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationSent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invitations/import":{"post":{"operationId":"Invitations_import","tags":["invitations"],"security":[{"apiKey":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Invite many people from CSV","description":"Send the CSV as text/plain, or as JSON with a `csv` field, with an Email column and an optional Role column.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in":{"get":{"operationId":"Mailin_list","tags":["mail-in"],"security":[{"apiKey":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List mail-in batches","description":"A member sees the batches they asked for.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInBatchPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Mailin_request","tags":["mail-in"],"security":[{"apiKey":["mailin:write"]}],"x-required-scope":"mailin:write","x-required-feature":"mail_in","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Request envelopes and a mail-in batch","description":"`envelopes` is how many to send, and the answer says how many can still be requested this week. The estimate holds that many documents of this month's allowance. Both holds commit with the batch, or not at all. Left out, `afterScan` follows the workspace's shredding setting.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMailInInput"},"example":{"expectedDocuments":1}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInRequested"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/{id}":{"get":{"operationId":"Mailin_get","tags":["mail-in"],"security":[{"apiKey":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a mail-in batch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInBatch"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Mailin_changeAddress","tags":["mail-in"],"security":[{"apiKey":["mailin:write"]}],"x-required-scope":"mailin:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the address on a batch","description":"For the person who asked or a manager, until the batch finishes. A batch's code cannot be changed.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeMailInAddressInput"},"example":{"shippingAddress":{"name":"string","line1":"string","city":"string","region":"string","postalCode":"string"}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInBatch"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/{id}/barcode":{"get":{"operationId":"Mailin_batchBarcode","tags":["mail-in"],"security":[{"apiKey":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a batch's barcode","description":"A Code 128 image of the batch reference.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/{id}/cancel":{"post":{"operationId":"Mailin_cancel","tags":["mail-in"],"security":[{"apiKey":["mailin:write"]}],"x-required-scope":"mailin:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Cancel a batch nobody has started on","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInBatch"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/{id}/cover-sheet":{"get":{"operationId":"Mailin_batchCoverSheet","tags":["mail-in"],"security":[{"apiKey":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a batch's cover sheet","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/{id}/documents":{"get":{"operationId":"Mailin_documents","tags":["mail-in"],"security":[{"apiKey":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List what came out of a batch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInDocumentPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/allowance":{"get":{"operationId":"Mailin_allowance","tags":["mail-in"],"security":[{"apiKey":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See this month's paper allowance","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInAllowance"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/barcode":{"get":{"operationId":"Mailin_barcode","tags":["mail-in"],"security":[{"apiKey":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the workspace's barcode","description":"A Code 128 image of the workspace reference.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/cover-sheet":{"get":{"operationId":"Mailin_coverSheet","tags":["mail-in"],"security":[{"apiKey":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the workspace's cover sheet","description":"One page to put on top of a stack of paper, with the barcode on it.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/settings":{"get":{"operationId":"Mailin_settings","tags":["mail-in"],"security":[{"apiKey":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See your saved mail-in address","description":"One person's own, in this workspace. Nobody else reads it.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Mailin_saveSettings","tags":["mail-in"],"security":[{"apiKey":["mailin:write"]}],"x-required-scope":"mailin:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Save your mail-in address","description":"Envelopes and returned paper go here when a request names no address. Null forgets it. Batches already requested keep theirs: change those one at a time.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInSettingsInput"},"example":{"address":{"name":"string","line1":"string","city":"string","region":"string","postalCode":"string"}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/forwarding-address":{"delete":{"operationId":"Users_removeAlias","tags":["me"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Give up the chosen forwarding address","description":"The random address keeps working. Only the chosen one stops.","parameters":[],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Users_chooseAlias","tags":["me"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Choose a forwarding address","description":"Beside the random one, which keeps working. A name someone else holds is refused.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForwardingAliasInput"},"example":{"alias":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForwardingAlias"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/forwarding-address/rotate":{"post":{"operationId":"Users_rotate","tags":["me"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Issue a new forwarding address","description":"The old address stops working the moment this one is issued.","parameters":[],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members":{"get":{"operationId":"Members_list","tags":["members"],"security":[{"apiKey":["members:read"]}],"x-required-scope":"members:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List the members of this workspace","description":"Pay-adjacent fields stay empty unless the caller has members.manage.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["ACTIVE","SUSPENDED"]}},{"name":"role","in":"query","required":false,"schema":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members/{id}":{"delete":{"operationId":"Members_remove","tags":["members"],"security":[{"apiKey":["members:write"]}],"x-required-scope":"members:write","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Remove a member","description":"Their expenses stay. Anyone may remove their own membership. Taking access away works on a lapsed plan.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Members_get","tags":["members"],"security":[{"apiKey":["members:read"]}],"x-required-scope":"members:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a member","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Members_update","tags":["members"],"security":[{"apiKey":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a member","description":"Only an owner can change an owner, or make someone an owner.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members/bulk":{"post":{"operationId":"Members_bulk","tags":["members"],"security":[{"apiKey":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change many members at once","description":"A member the rules refuse stays as they were, and the rest still change.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkMemberInput"},"example":{"ids":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkMemberResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members/provision":{"post":{"operationId":"Members_provisionPeople","tags":["members"],"security":[{"apiKey":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Provision and remove people from a list","description":"From a request body or an https address, with a dry run. Answers with who was added, updated and removed, and who was skipped and why. A change of address needs a domain this workspace verified. SFTP is not offered.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members/seats":{"get":{"operationId":"Members_seats","tags":["members"],"security":[{"apiKey":["members:read"]}],"x-required-scope":"members:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See seats in use against the plan","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatUsage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/merchants":{"get":{"operationId":"Merchants_list","tags":["merchants"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List merchants","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Merchants_create","tags":["merchants"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a merchant","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMerchantInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Merchant"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/merchants/{id}":{"get":{"operationId":"Merchants_get","tags":["merchants"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a merchant","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Merchant"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Merchants_update","tags":["merchants"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a merchant","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Merchant"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/merchants/{id}/aliases/{aliasId}":{"delete":{"operationId":"Merchants_removeAlias","tags":["merchants"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Remove a spelling from a merchant","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"aliasId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Merchant"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/merchants/{id}/merge":{"post":{"operationId":"Merchants_merge","tags":["merchants"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Merge another merchant into this one","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeMerchantInput"},"example":{"intoId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Merchant"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage":{"post":{"operationId":"Mileage_create","tags":["mileage"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-feature":"mileage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Record a trip","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTripInput"},"example":{"date":"string","origin":"string","destination":"string","purpose":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trip"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage-rates":{"get":{"operationId":"MileageRates_list","tags":["mileage-rates"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List mileage rates","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MileageRatePage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage-rates/{id}":{"get":{"operationId":"MileageRates_get","tags":["mileage-rates"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a mileage rate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MileageRate"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/{id}":{"put":{"operationId":"Mileage_update","tags":["mileage"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-feature":"mileage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Replace a trip","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTripInput"},"example":{"date":"string","origin":"string","destination":"string","purpose":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trip"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/{id}/odometer-photos":{"post":{"operationId":"Mileage_attachPhoto","tags":["mileage"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-feature":"mileage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Attach an odometer photo to a trip","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"client","in":"query","required":false,"schema":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","reading"],"properties":{"file":{"type":"string","format":"binary"},"reading":{"type":"string","enum":["START","END"]}}},"example":{"reading":"START"}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"reading":{"type":"string","enum":["START","END"]}},"required":["uploadId","reading"]},"example":{"uploadId":"string","reading":"START"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trip"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/log":{"get":{"operationId":"Mileage_log","tags":["mileage"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Read the mileage log","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"vehicleId","in":"query","required":false,"schema":{"type":"string"}},{"name":"purpose","in":"query","required":false,"schema":{"type":"string","enum":["business","medical","charity"]}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MileageLog"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/log/export":{"get":{"operationId":"Mileage_exportLog","tags":["mileage"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Export the mileage log","description":"The file comes back as JSON, with its content as text.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"vehicleId","in":"query","required":false,"schema":{"type":"string"}},{"name":"purpose","in":"query","required":false,"schema":{"type":"string","enum":["business","medical","charity"]}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadableFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/routes":{"get":{"operationId":"Mileage_routes","tags":["mileage"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List saved routes","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripRoutes"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/parse":{"get":{"operationId":"Parse_list","tags":["parse"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List documents turned into Markdown","parameters":[{"name":"details","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedDocumentPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Parse_create","tags":["parse"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Turn a document into Markdown","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Tables and reading order are kept. details adds a box for each line, and meta holds pages, sharpness and OCR scores. Up to 50 pages.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"details":{"type":"boolean"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"details":{"type":"boolean"}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/parse-set":{"get":{"operationId":"DocumentSets_listParseSets","tags":["parse-set"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List Markdown sets","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentSets_createParseSet","tags":["parse-set"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF and turn each document in it into Markdown","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Up to 50 MB. Answers at once.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/parse-set/{id}":{"get":{"operationId":"DocumentSets_getParseSet","tags":["parse-set"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a Markdown set","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/parse/{id}":{"delete":{"operationId":"Parse_remove","tags":["parse"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete one","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Parse_get","tags":["parse"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a document as Markdown","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"details","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":80}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Parse_update","tags":["parse"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the title, notes or tags of one","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParseUpdateInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/parse/async":{"post":{"operationId":"Parse_createAsync","tags":["parse"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Turn a document into Markdown, in the background","description":"Answers at once. document.processed says when it is done.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"details":{"type":"boolean"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"details":{"type":"boolean"}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts":{"get":{"operationId":"PaymentAccounts_list","tags":["payment-accounts"],"security":[{"apiKey":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List cards and bank accounts","description":"A member sees their own and those of the people reporting to them. Numbers are last four only.","parameters":[{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentAccountPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/{id}":{"get":{"operationId":"PaymentAccounts_get","tags":["payment-accounts"],"security":[{"apiKey":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a card or bank account","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentAccount"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/{id}/statements":{"get":{"operationId":"PaymentAccounts_statements","tags":["payment-accounts"],"security":[{"apiKey":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a card's statement periods","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardStatements"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/export":{"get":{"operationId":"PaymentAccounts_exportList","tags":["payment-accounts"],"security":[{"apiKey":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Export the card table","description":"The file comes back as JSON, with its content as text.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadableFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/per-diem":{"post":{"operationId":"PerDiem_create","tags":["per-diem"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-feature":"per_diem","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Record a per diem","description":"Meals and lodging file as separate expenses, so each deducts at its own percentage.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePerDiemInput"},"example":{"startDate":"string","endDate":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetails"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/per-diem-rates":{"get":{"operationId":"PerDiemRates_list","tags":["per-diem-rates"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List per diem rates","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRatePage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/per-diem-rates/{id}":{"get":{"operationId":"PerDiemRates_get","tags":["per-diem-rates"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a per diem rate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRate"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/personal-rules":{"get":{"operationId":"PersonalRules_list","tags":["personal-rules"],"security":[{"apiKey":["rules:read"]}],"x-required-scope":"rules:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a person's rules","description":"The caller's own, or with ownerId, an employee's. Naming someone else needs policies.manage.","parameters":[{"name":"ownerId","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRuleList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"PersonalRules_create","tags":["personal-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a rule for a person","description":"For the caller, or with ownerId, for an employee. It runs on what that person spends, and can set tags and billable.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalRuleInput"},"example":{"name":"string","merchantContains":"string","actions":{}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/personal-rules/{id}":{"delete":{"operationId":"PersonalRules_remove","tags":["personal-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a person's rule","description":"Name the person with ownerId when the rule is not the caller's.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"PersonalRules_update","tags":["personal-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a person's rule","description":"Name the person with ownerId when the rule is not the caller's.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalRuleInput"},"example":{"name":"string","merchantContains":"string","actions":{}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/personal-rules/reorder":{"post":{"operationId":"PersonalRules_reorder","tags":["personal-rules"],"security":[{"apiKey":["rules:write"]}],"x-required-scope":"rules:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Put the caller's own rules in a new order","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderAutomationRulesInput"},"example":{"ids":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRuleOrder"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/projects":{"get":{"operationId":"Projects_list","tags":["projects"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List projects","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Projects_create","tags":["projects"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a project","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/projects/{id}":{"delete":{"operationId":"Projects_remove","tags":["projects"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Projects_get","tags":["projects"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Projects_update","tags":["projects"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/projects/import":{"post":{"operationId":"Projects_import","tags":["projects"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import projects from CSV","description":"Send the CSV as text/plain, or as JSON with a `csv` field. Rows that match an existing project update it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reference/countries":{"get":{"operationId":"Reference_countries","tags":["reference"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List country codes and the currency each prints","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceCountryPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reference/currencies":{"get":{"operationId":"Reference_currencies","tags":["reference"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List currency codes","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceCurrencyPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reference/locales":{"get":{"operationId":"Reference_locales","tags":["reference"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the locales offered in a picker","description":"A workspace can hold any language tag; these are the usual ones.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceLocalePage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reference/system-categories":{"get":{"operationId":"Reference_systemCategories","tags":["reference"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the categories a new workspace starts with","description":"A workspace's own are at GET /v1/categories.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceSystemCategoryPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/release-notifications":{"get":{"operationId":"ReleaseNotes_list","tags":["release-notifications"],"security":[{"apiKey":["any_credential"]}],"x-required-scope":"any_credential","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List release notes","description":"Versioned notes on what changed, newest first. Any key or token may read them, whatever its scopes.","parameters":[{"name":"product","in":"query","required":false,"schema":{"type":"string","enum":["app_web","api","mcp","model_document_extraction","model_bank_statements","model_checks","model_fraud_detection"]}},{"name":"environment","in":"query","required":false,"schema":{"type":"string","enum":["production","sandbox"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseNotePage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/report-fields":{"get":{"operationId":"ReportFields_list","tags":["report-fields"],"security":[{"apiKey":["workspace:read"]}],"x-required-scope":"workspace:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List report fields","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportFieldList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ReportFields_create","tags":["report-fields"],"security":[{"apiKey":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"settings.manage","x-required-feature":"custom_fields","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a report field","description":"TEXT, DATE, LIST for a dropdown, or FORMULA.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportFieldInput"},"example":{"name":"string","type":"TEXT"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportField"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/report-fields/{id}":{"delete":{"operationId":"ReportFields_remove","tags":["report-fields"],"security":[{"apiKey":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a report field","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"ReportFields_update","tags":["report-fields"],"security":[{"apiKey":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"settings.manage","x-required-feature":"custom_fields","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a report field","description":"Name and type stay as they were created, since reports already hold values by them.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReportFieldInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportField"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/report-fields/turn-off":{"post":{"operationId":"ReportFields_turnOff","tags":["report-fields"],"security":[{"apiKey":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Turn report fields off","description":"Lists are kept and turned off, and the rest are deleted.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportFieldsOff"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports":{"get":{"operationId":"Reports_list","tags":["reports"],"security":[{"apiKey":["reports:read"]}],"x-required-scope":"reports:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List reports","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]},{"type":"array","items":{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]}}]}},{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all","assigned"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Reports_create","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a report","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReportInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}":{"delete":{"operationId":"Reports_remove","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a draft report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Reports_get","tags":["reports"],"security":[{"apiKey":["reports:read"]}],"x-required-scope":"reports:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Reports_update","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReportInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/accept-findings":{"post":{"operationId":"Reports_acceptFindings","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Accept what the receipt checks found","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/approve":{"post":{"operationId":"Reports_approve","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Approve a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveReportInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/close":{"post":{"operationId":"Reports_close","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Close a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/comments":{"get":{"operationId":"ReportComments_list","tags":["reports"],"security":[{"apiKey":["reports:read"]}],"x-required-scope":"reports:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List comments on a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ReportComments_add","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Comment on a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostedComment"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/comments/{commentId}/reach":{"post":{"operationId":"ReportComments_reach","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Reach someone a comment on this report could not","description":"The author adds them to the report, and then they are told.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReachMentionedInput"},"example":{"userIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reached"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/comments/mentionable":{"get":{"operationId":"ReportComments_mentionable","tags":["reports"],"security":[{"apiKey":["reports:read"]}],"x-required-scope":"reports:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List who a comment on this report can mention","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MentionablePeople"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/duplicate":{"post":{"operationId":"Reports_duplicate","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Start a new report from this one","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/expenses":{"post":{"operationId":"Reports_addExpenses","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add expenses to a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportExpensesInput"},"example":{"ids":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/expenses/{expenseId}":{"delete":{"operationId":"Reports_removeExpense","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Take an expense off a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expenseId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/expenses/{expenseId}/reject":{"post":{"operationId":"Reports_rejectExpense","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Reject one expense on a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expenseId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectExpenseInput"},"example":{"reason":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/mark-exported":{"post":{"operationId":"Reports_markExported","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Mark a report as exported","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/mark-reimbursed":{"post":{"operationId":"Reports_markReimbursed","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Mark a report as reimbursed","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/participants":{"post":{"operationId":"Reports_invite","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Add a person to a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportParticipantInput"},"example":{"userId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/participants/{userId}":{"delete":{"operationId":"Reports_uninvite","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Take a person off a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/reassign":{"post":{"operationId":"Reports_reassign","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Hand a report to another approver","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReassignReportInput"},"example":{"approverId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/reject":{"post":{"operationId":"Reports_reject","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Send a report back","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectReportInput"},"example":{"reason":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/reopen":{"post":{"operationId":"Reports_reopen","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Reopen a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/retract":{"post":{"operationId":"Reports_retract","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Take a submitted report back","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/submit":{"post":{"operationId":"Reports_submit","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Submit a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitReportInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/bulk-reassign":{"post":{"operationId":"Reports_bulkReassign","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Hand many reports to another approver","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReassignInput"},"example":{"reportIds":["string"],"approverId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/bulk-submit":{"post":{"operationId":"Reports_bulkSubmit","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Submit many reports","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportsInput"},"example":{"reportIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/mark-reimbursed":{"post":{"operationId":"Reports_bulkMarkReimbursed","tags":["reports"],"security":[{"apiKey":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Mark many reports as reimbursed","description":"Answers 200 when all of them went through, and 207 when some did not. A report that is not approved yet, already paid or in a batch is skipped. One the caller cannot find or mark has failed.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportsInput"},"example":{"reportIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReimbursed"}}}},"207":{"description":"Some went through. The body says what became of each.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReimbursed"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/split":{"get":{"operationId":"Split_listSplits","tags":["split"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List splits","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Split_split","tags":["split"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Find the documents in a PDF","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Returns page ranges and extracts nothing. Up to 250 pages and 50 MB. split_by_blank_page cuts on blank pages instead of detected boundaries.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/split-and-classify":{"post":{"operationId":"Split_splitAndClassify","tags":["split-and-classify"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Find the documents in a PDF and say what each one is","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Each range has a type and a score, optionally from your own document_types.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/split-and-classify/async":{"post":{"operationId":"Split_splitAndClassifyAsync","tags":["split-and-classify"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Find and classify the documents in a PDF, in the background","description":"Answers at once. split.completed and split_and_classify.created deliver the same result, and split.failed and split_and_classify.failed say why not.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/split/{id}":{"get":{"operationId":"Split_getSplit","tags":["split"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a split","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/split/async":{"post":{"operationId":"Split_splitAsync","tags":["split"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Find the documents in a PDF, in the background","description":"Answers at once with the id. split.completed and split.created deliver the ranges, and split.failed says why not.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tags":{"get":{"operationId":"Tags_list","tags":["tags"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List tags","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Tags_create","tags":["tags"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a tag","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tags/{id}":{"delete":{"operationId":"Tags_remove","tags":["tags"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a tag","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Tags_get","tags":["tags"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a tag","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Tags_update","tags":["tags"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a tag","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTagInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tags/import":{"post":{"operationId":"Tags_import","tags":["tags"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import tags from CSV","description":"Send the CSV as text/plain, or as JSON with a `csv` field, with commas or tabs. Rows that match an existing tag update it. With mode=replace, what the file leaves out is deleted, or archived if something uses it. Columns: Name, Group, GL code, Color, Enabled, Depends on. A tag that depends on another goes on an expense only with that one.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tax/summary":{"get":{"operationId":"Tax_summary","tags":["tax"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Totals by tax line for a year","parameters":[{"name":"year","in":"query","required":false,"schema":{"type":"integer","minimum":2000,"maximum":2100}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxSummary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/time":{"post":{"operationId":"Time_create","tags":["time"],"security":[{"apiKey":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Record time","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTimeInput"},"example":{"date":"string","hours":0,"rateMinor":0,"description":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tls-certificates":{"get":{"operationId":"ClientCertificates_list","tags":["tls-certificates"],"security":[{"apiKey":["workspace:read"]}],"x-required-scope":"workspace:read","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List the client certificates this workspace trusts","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCertificatePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ClientCertificates_create","tags":["tls-certificates"],"security":[{"apiKey":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"developer.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a client certificate","description":"PEM, and never a private key. Only its SHA-256 fingerprint decides anything, and adding the same one twice is one row. Mutual TLS ends at the edge, and has to be set up for this server before a workspace can require it.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClientCertificateInput"},"example":{"name":"string","certificate":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCertificate"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tls-certificates/{id}":{"delete":{"operationId":"ClientCertificates_revoke","tags":["tls-certificates"],"security":[{"apiKey":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Stop trusting a client certificate","description":"The last one cannot go while the workspace requires one.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions":{"get":{"operationId":"Transactions_list","tags":["transactions"],"security":[{"apiKey":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List card transactions","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["UNMATCHED","MATCHED","IGNORED","EXPENSED","PENDING"]}},{"name":"paymentAccountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"paymentAccountIds","in":"query","required":false,"schema":{"type":"string","maxLength":20000}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"missingReceipt","in":"query","required":false,"schema":{"type":"string"}},{"name":"unreported","in":"query","required":false,"schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/{id}":{"get":{"operationId":"Transactions_get","tags":["transactions"],"security":[{"apiKey":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a card transaction","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/export":{"get":{"operationId":"Transactions_exportList","tags":["transactions"],"security":[{"apiKey":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Export card data","description":"By date range and card, with `unreported=true` for lines on no report. Leave it out for all of them. The file comes back as JSON, with its content as text.","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["UNMATCHED","MATCHED","IGNORED","EXPENSED","PENDING"]}},{"name":"paymentAccountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"paymentAccountIds","in":"query","required":false,"schema":{"type":"string","maxLength":20000}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"missingReceipt","in":"query","required":false,"schema":{"type":"string"}},{"name":"unreported","in":"query","required":false,"schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadableFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/reconciliation":{"get":{"operationId":"Transactions_reconciliation","tags":["transactions"],"security":[{"apiKey":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Reconcile card data for a date range","description":"Imported, approved and what is stuck, by where it is stuck.","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"paymentAccountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"feed","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reconciliation"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/summary":{"get":{"operationId":"Transactions_summary","tags":["transactions"],"security":[{"apiKey":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Total the card transactions that match a filter","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["UNMATCHED","MATCHED","IGNORED","EXPENSED","PENDING"]}},{"name":"paymentAccountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"paymentAccountIds","in":"query","required":false,"schema":{"type":"string","maxLength":20000}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"missingReceipt","in":"query","required":false,"schema":{"type":"string"}},{"name":"unreported","in":"query","required":false,"schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionSummary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/travel/trips":{"get":{"operationId":"Travel_list","tags":["travel"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List travel trips","description":"Trips filed from itineraries, newest first. Your own, or everyone's with `scope=all` when your role reads everyone's expenses. Trips driven are in the mileage log.","parameters":[{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelTripPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/travel/trips/{id}":{"get":{"operationId":"Travel_get","tags":["travel"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a travel trip","description":"One trip, with its segments and the documents filed against it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelTrip"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/uploads":{"post":{"operationId":"Uploads_create","tags":["uploads"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Sign an upload straight to storage","description":"The way to send a file: its bytes do not pass through this API. Say what it is for and how big it is, PUT the file to the URL in the answer, then name the uploadId on that feature's route in place of a multipart file. The file's own bytes decide what it is. Video goes to an attachment, up to 500 MiB, and is never read.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUploadInput"},"example":{"filename":"string","contentType":"string","sizeBytes":0,"purpose":"document"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadTicket"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/vehicles":{"get":{"operationId":"Vehicles_list","tags":["vehicles"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List vehicles","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"userId","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehiclePage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/vehicles/{id}":{"get":{"operationId":"Vehicles_get","tags":["vehicles"],"security":[{"apiKey":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a vehicle","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vehicle"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/w-8ben-e":{"post":{"operationId":"SpecialDocuments_w8BenE","tags":["w-8ben-e"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a Form W-8BEN-E","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/w2s":{"post":{"operationId":"SpecialDocuments_w2s","tags":["w2s"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a Form W-2","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/w2s-set":{"get":{"operationId":"DocumentSets_listW2Sets","tags":["w2s-set"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List W-2 sets","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentSets_createW2Set","tags":["w2s-set"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF of W-2s and read each one","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Up to 100 pages and 50 MB. Answers at once. w2_set.created says when every form is read, and w2_set.failed why not. Social security and employer numbers are masked in every view.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/w2s-set/{id}":{"get":{"operationId":"DocumentSets_getW2Set","tags":["w2s-set"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a W-2 set","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/w9s":{"post":{"operationId":"SpecialDocuments_w9s","tags":["w9s"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a Form W-9","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks":{"get":{"operationId":"Webhooks_list","tags":["webhooks"],"security":[{"apiKey":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List webhook endpoints","description":"Pending and confirmed alike. Endpoints that belong to one API key are left out unless you ask: send apiKeyId for one key, or include=keys for all of them.","parameters":[{"name":"apiKeyId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"include","in":"query","required":false,"schema":{"type":"string","enum":["keys"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Webhooks_create","tags":["webhooks"],"security":[{"apiKey":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a webhook endpoint","description":"Step one of the handshake. The URL must be public https, and not on papertotal.com. The endpoint starts PENDING, and PaperTotal sends it one signed subscription event holding a one-time token in data.token. Confirm it with POST /v1/webhooks/confirm within a day. Until then it receives nothing else, and after that it is deleted. An address on hooks.zapier.com is confirmed at once, because a catch hook cannot run a handshake. Send apiKeyId to make this one key's own endpoint: documents that key submits report here and not to the workspace's endpoints, it takes document events only, and a key has one. Changing the URL later goes through the handshake again. The signing secret is in this response and the rotate response, and nowhere else.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookInput"},"example":{"url":"string","events":["document.created"]}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}":{"delete":{"operationId":"Webhooks_remove","tags":["webhooks"],"security":[{"apiKey":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Delete a webhook endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Webhooks_get","tags":["webhooks"],"security":[{"apiKey":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a webhook endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Webhooks_update","tags":["webhooks"],"security":[{"apiKey":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a webhook endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}/deliveries":{"get":{"operationId":"Webhooks_deliveries","tags":["webhooks"],"security":[{"apiKey":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List an endpoint's deliveries","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}/rotate-secret":{"post":{"operationId":"Webhooks_rotate","tags":["webhooks"],"security":[{"apiKey":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Issue a new signing secret","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}/test":{"post":{"operationId":"Webhooks_test","tags":["webhooks"],"security":[{"apiKey":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Send a test event","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/confirm":{"post":{"operationId":"Webhooks_confirm","tags":["webhooks"],"security":[{"apiKey":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Confirm a webhook endpoint","description":"Step three of the handshake. Send the token from the subscription event that went to the address. It works once, and expires after a day.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmWebhookInput"},"example":{"token":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/deliveries/{id}/retry":{"post":{"operationId":"Webhooks_retry","tags":["webhooks"],"security":[{"apiKey":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Send a delivery again","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflows/{id}/runs":{"get":{"operationId":"DocumentWorkflows_listRuns","tags":["workflows"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a workflow's runs","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentWorkflows_start","tags":["workflows"],"security":[{"apiKey":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Start a run","description":"Sends a file named by uploadId from POST /v1/uploads, or documents already in this workspace, to the workflow's API import. nodeId starts it at another input instead: a Document aggregator gathers what has come in, and Business insights runs its query. An upload, or an Idempotency-Key, makes a repeat answer with the first run.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartWorkflowRunInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunSummary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflows/{id}/runs/{runId}":{"get":{"operationId":"DocumentWorkflows_getRun","tags":["workflows"],"security":[{"apiKey":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a run and each of its steps","description":"Each step says what happened. A file comes with a signed link that lasts 15 minutes, and an approval says who was asked and who answered.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspace":{"delete":{"operationId":"WorkspaceClosure_close","tags":["workspace"],"security":[{"apiKey":["workspace:delete"]}],"x-required-scope":"workspace:delete","x-required-permission":"workspace.delete","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Close this workspace","description":"Needs the workspace:delete scope, which no preset holds, on a key an owner made. Send the name of the workspace to confirm. Its data is purged after the grace period.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseWorkspaceInput"},"example":{"confirmName":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceClosed"}}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Workspaces_current","tags":["workspace"],"security":[{"apiKey":["workspace:read"]}],"x-required-scope":"workspace:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get this workspace, its plan and its usage","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"WorkspaceSettings_update","tags":["workspace"],"security":[{"apiKey":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change this workspace","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkspaceInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspace/counts":{"get":{"operationId":"Workspaces_counts","tags":["workspace"],"security":[{"apiKey":["workspace:read"]}],"x-required-scope":"workspace:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Count what is waiting on the caller","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCounts"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces":{"get":{"operationId":"WorkspacesCreate_list","tags":["workspaces"],"security":[{"apiKey":["workspace:read"]}],"x-required-scope":"workspace:read","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the workspaces this credential reaches","description":"A key or an app is bound to one workspace, so it lists that one. A person lists all of theirs.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"WorkspacesCreate_create","tags":["workspaces"],"security":[{"apiKey":["workspace:write"]}],"x-required-scope":"workspace:write","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Create a workspace","description":"The caller's person owns it. It starts with what their one trial has left, or with no plan: reading and exporting work, and capture waits on a plan. A plan cannot be bought by an API call, so naming one returns the billing link where a person pays for it. A key stays bound to its own workspace, so the new one needs a key of its own.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreated"}}}},"default":{"$ref":"#/components/responses/Error"}}}}},"webhooks":{"document.created":{"post":{"summary":"The document.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document.processed":{"post":{"summary":"The document.processed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document.processed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document.failed":{"post":{"summary":"The document.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document.enriched":{"post":{"summary":"The document.enriched event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document.enriched"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document.enrichment_failed":{"post":{"summary":"The document.enrichment_failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document.enrichment_failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document_set.completed":{"post":{"summary":"The document_set.completed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document_set.completed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document_set.failed":{"post":{"summary":"The document_set.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document_set.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"split.completed":{"post":{"summary":"The split.completed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"split.completed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"split.created":{"post":{"summary":"The split.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"split.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"split.failed":{"post":{"summary":"The split.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"split.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"split_and_classify.created":{"post":{"summary":"The split_and_classify.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"split_and_classify.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"split_and_classify.failed":{"post":{"summary":"The split_and_classify.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"split_and_classify.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"w2_set.created":{"post":{"summary":"The w2_set.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"w2_set.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"w2_set.failed":{"post":{"summary":"The w2_set.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"w2_set.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"bank_statement_set.created":{"post":{"summary":"The bank_statement_set.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"bank_statement_set.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"bank_statement_set.failed":{"post":{"summary":"The bank_statement_set.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"bank_statement_set.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"expense.created":{"post":{"summary":"The expense.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"expense.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"expense.updated":{"post":{"summary":"The expense.updated event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"expense.updated"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"expense.deleted":{"post":{"summary":"The expense.deleted event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"expense.deleted"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"report.submitted":{"post":{"summary":"The report.submitted event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"report.submitted"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"report.approved":{"post":{"summary":"The report.approved event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"report.approved"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"report.rejected":{"post":{"summary":"The report.rejected event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"report.rejected"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"report.reimbursed":{"post":{"summary":"The report.reimbursed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"report.reimbursed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"integration.posted":{"post":{"summary":"The integration.posted event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"integration.posted"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"integration.failed":{"post":{"summary":"The integration.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"integration.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"subscription":{"post":{"summary":"The subscription event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"subscription"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"ptk_live_...","description":"Scopes: documents:read, documents:write, documents:reveal, expenses:read, expenses:write, reports:read, reports:write, contacts:read, webhooks:manage, members:read, members:write, workspace:read, workspace:write, workspace:delete, rules:read, rules:write, cards:read, mailin:read, mailin:write, billing:read, billing:write, integrations:read."}},"headers":{"X-RateLimit-Limit":{"description":"Requests allowed in the window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the window resets.","schema":{"type":"integer"}}},"responses":{"Error":{"description":"Something went wrong. `code` is stable and `message` is written for a person.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"TravelTripListQuery":{"type":"object","properties":{"scope":{"default":"mine","type":"string","enum":["mine","all"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}},"CreateClientCertificateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"certificate":{"type":"string","minLength":1,"maxLength":20000}},"required":["name","certificate"]},"ReleaseNotificationQuery":{"type":"object","properties":{"product":{"type":"string","enum":["app_web","api","mcp","model_document_extraction","model_bank_statements","model_checks","model_fraud_detection"]},"environment":{"type":"string","enum":["production","sandbox"]}}},"CreateAttachmentInput":{"type":"object","properties":{"uploadId":{"type":"string","minLength":1,"maxLength":64}},"required":["uploadId"]},"CreateUploadInput":{"type":"object","properties":{"filename":{"type":"string"},"contentType":{"type":"string","maxLength":200},"sizeBytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"purpose":{"type":"string","enum":["document","document_set","expense_receipt","odometer_photo","policy_document","statement","attachment","catalog_import","iif_lists","people_list","profile_photo"]},"clientId":{"type":"string","minLength":8,"maxLength":255}},"required":["filename","contentType","sizeBytes","purpose"]},"ExportRecordInput":{"type":"object","properties":{"documentIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"target":{"type":"string","minLength":1,"maxLength":60},"externalId":{"type":"string","minLength":1,"maxLength":200}},"required":["documentIds","target"]},"ExportRecordQuery":{"type":"object","properties":{"documentId":{"type":"string"},"target":{"type":"string","maxLength":60},"externalId":{"type":"string","maxLength":200},"via":{"type":"string","enum":["EXPORT","SYNC","API"]}}},"DocumentReadQuery":{"type":"object","properties":{"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"detailed":{"type":"boolean"},"with_scores":{"type":"boolean"}}},"DocumentTagInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]},"DocumentTagsInput":{"type":"object","properties":{"tags":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}},"required":["tags"]},"ExpenseLineInput":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"categoryId":{"type":["string","null"]}},"required":["description","amountMinor"]},"ExpenseTaxLineInput":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"ratePct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000}},"required":["amountMinor"]},"UpdateExpenseLineInput":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"categoryId":{"type":["string","null"]}}},"UpdateExpenseTaxLineInput":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"ratePct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000}}},"CategoryImportQuery":{"type":"object","properties":{"mode":{"type":"string","enum":["merge","replace"]}}},"CloseWorkspaceInput":{"type":"object","properties":{"confirmName":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmName"]},"ProvisionInput":{"type":"object","properties":{"employees":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"employeeEmail":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"managerEmail":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"employeeID":{"type":"string","minLength":1,"maxLength":60},"policyID":{"type":"string","minLength":1},"approvalLimit":{"type":"integer","minimum":0,"maximum":9007199254740991},"overLimitApprover":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"workerStatus":{"type":"string","minLength":1,"maxLength":60},"isTerminated":{"type":"boolean"},"domainGroupID":{"type":"string","minLength":1},"approvesTo":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","minLength":1,"maxLength":30},"additionalPolicyIDs":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"defaultTags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"firstName":{"type":"string","maxLength":60},"lastName":{"type":"string","maxLength":60},"customField1":{"type":"string","maxLength":200},"customField2":{"type":"string","maxLength":200},"payrollCode":{"type":"string","maxLength":120},"title":{"type":"string","maxLength":120},"department":{"type":"string","maxLength":120},"costCenter":{"type":"string","maxLength":120},"officeLocation":{"type":"string","maxLength":120},"legalEntity":{"type":"string","maxLength":120},"workerType":{"type":"string","maxLength":120}},"required":["employeeEmail"]}},"url":{"type":"string","format":"uri"},"dryRun":{"type":"boolean"},"shouldFixApprovalChains":{"type":"boolean"},"removeMissing":{"type":"boolean"}}},"AutomationPreviewInput":{"type":"object","properties":{"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}}},"required":["conditions"]},"AutomationRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}},"actions":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"vendorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"reportId":{"type":"string","minLength":1},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}}}}},"required":["name","conditions","actions"]},"BulkMemberInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]},"status":{"type":"string","enum":["ACTIVE","SUSPENDED"]},"managerId":{"type":["string","null"]}},"required":["ids"]},"CreateInvitationInput":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1,"maxLength":120},"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]},"message":{"type":"string","maxLength":500}},"required":["email"]},"ChangeMailInAddressInput":{"type":"object","properties":{"shippingAddress":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]}},"required":["shippingAddress"],"additionalProperties":false},"MailInSettingsInput":{"type":"object","properties":{"address":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]},{"type":"null"}]}},"required":["address"],"additionalProperties":false},"CreateMailInInput":{"type":"object","properties":{"envelopes":{"default":1,"type":"integer","minimum":0,"maximum":10},"expectedDocuments":{"type":"integer","minimum":1,"maximum":5000},"afterScan":{"type":"string","enum":["RETURN","SHRED"]},"shippingAddress":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]},"folderId":{"type":["string","null"]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["expectedDocuments"]},"CreateWorkspaceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"baseCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":60},"copyFromId":{"type":"string","minLength":1},"copySections":{"type":"array","items":{"type":"string","enum":["categories","tags","customFields","reportFields","distanceRates","perDiem","workflows","rules","merchantRules","policies","members","accountingConnection","overview"]}},"plan":{"type":"string","enum":["STARTER","PRO","BUSINESS"]},"interval":{"type":"string","enum":["MONTH","YEAR"]}},"required":["name"]},"InvitationListQuery":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","EXPIRED","ACCEPTED","REVOKED"]}}},"MemberListQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"status":{"type":"string","enum":["ACTIVE","SUSPENDED"]},"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]}}},"PaymentAccountListQuery":{"type":"object","properties":{"archived":{"type":"string"}}},"PersonalRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"merchantContains":{"type":"string","minLength":1,"maxLength":200},"actions":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"vendorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"reportId":{"type":"string","minLength":1},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}}}},"ownerId":{"type":"string","minLength":1}},"required":["name","merchantContains","actions"]},"PersonalRuleQuery":{"type":"object","properties":{"ownerId":{"type":"string","minLength":1}}},"ReconciliationQuery":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"paymentAccountId":{"type":"string"},"feed":{"type":"string","maxLength":64},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["from","to"]},"ReorderAutomationRulesInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1}}},"required":["ids"]},"RulesDocument":{"type":"object","properties":{"format":{"type":"string","const":"papertotal.rules"},"version":{"type":"number","const":1},"exportedAt":{"type":"string","maxLength":40},"rules":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}},"actions":{"type":"object","properties":{"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}},"category":{"type":"string","minLength":1,"maxLength":200},"project":{"type":"string","minLength":1,"maxLength":200},"client":{"type":"string","minLength":1,"maxLength":200},"vendor":{"type":"string","minLength":1,"maxLength":200},"tags":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"group":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}},"additionalProperties":false}},"required":["name","conditions","actions"],"additionalProperties":false}}},"required":["format","version","rules"],"additionalProperties":false},"ReportFieldInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"type":{"type":"string","enum":["TEXT","DATE","LIST","FORMULA"]},"options":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"formula":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"required":{"type":"boolean"},"enabled":{"type":"boolean"},"position":{"type":"integer","minimum":0,"maximum":10000}},"required":["name","type"]},"SyncRecordQuery":{"type":"object","properties":{"state":{"type":"string","enum":["PENDING","SYNCED","FAILED","SKIPPED","VOIDED"]}}},"TransactionListQuery":{"type":"object","properties":{"state":{"type":"string","enum":["UNMATCHED","MATCHED","IGNORED","EXPENSED","PENDING"]},"paymentAccountId":{"type":"string"},"paymentAccountIds":{"type":"string","maxLength":20000},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"q":{"type":"string","maxLength":200},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingReceipt":{"type":"string"},"unreported":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}}},"UpdateAutomationRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}},"actions":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"vendorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"reportId":{"type":"string","minLength":1},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}}}}}},"UpdateMemberInput":{"type":"object","properties":{"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]},"status":{"type":"string","enum":["ACTIVE","SUSPENDED"]},"developer":{"type":"boolean"},"managerId":{"type":["string","null"]},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"department":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"employeeId":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"approvalLimitMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"overLimitApproverId":{"type":["string","null"]},"forwardToId":{"type":["string","null"]},"workerStatus":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"defaultTags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"customField1":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"customField2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"payrollCode":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"legalEntity":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"tier":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"officeLocation":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"costCenter":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"accountingCode":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"workerType":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}}},"UpdateReportFieldInput":{"type":"object","properties":{"options":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"formula":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"required":{"type":"boolean"},"enabled":{"type":"boolean"},"position":{"type":"integer","minimum":0,"maximum":10000},"disabledOptions":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}}}},"UpdateWorkspaceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"baseCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":60},"fiscalYearStartMonth":{"type":"integer","minimum":1,"maximum":12},"distanceUnit":{"type":"string","enum":["mi","km"]},"retentionDays":{"anyOf":[{"type":"integer","minimum":60,"maximum":3650},{"type":"null"}]},"callLogRetentionDays":{"anyOf":[{"type":"integer","minimum":30,"maximum":3650},{"type":"null"}]},"readingModel":{"type":"string","enum":["standard","rules_only","always_second_reading"]},"locale":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"showDefaultCategories":{"type":"boolean"},"shredDocuments":{"type":"boolean"},"vatBasisPoints":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"reimbursableTracking":{"type":"boolean"},"calculateMissingTax":{"type":"boolean"},"dateFormat":{"type":"string","enum":["YYYY-MM-DD","MM/DD/YYYY","DD/MM/YYYY","DD.MM.YYYY","MMM D, YYYY"]}}},"ForwardingAliasInput":{"type":"object","properties":{"alias":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{2,38}[a-z0-9]$"}},"required":["alias"]},"UploadSourceQuery":{"type":"object","properties":{"client":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}}},"AnyDocumentInput":{"type":"object","properties":{"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50}},"required":["blueprint_name"]},"BatchDocumentsInput":{"type":"object","properties":{"file_urls":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"external_id":{"type":"string","maxLength":200}},"required":["file_urls"]},"BlueprintListQuery":{"type":"object","properties":{"documentType":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}}},"BlueprintVersionQuery":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991}}},"ClassifyDocumentInput":{"type":"object","properties":{"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}}},"CreateBlueprintInput":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"title":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":300},"documentType":{"default":"OTHER","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"schema":{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/$defs/__schema0"}},"required":["type","properties"],"additionalProperties":false},"fields":{"default":[],"maxItems":150,"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":100},"example":{"type":"string","maxLength":200},"box":{"type":"object","properties":{"page":{"type":"integer","minimum":0,"maximum":49},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","minimum":0,"maximum":1},"height":{"type":"number","minimum":0,"maximum":1}},"required":["page","x","y","width","height"],"additionalProperties":false}},"required":["path"],"additionalProperties":false}}},"required":["name","title","schema"],"$defs":{"__schema0":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema1"}},"__schema1":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"string"},"description":{"type":"string","maxLength":300},"format":{"type":"string","enum":["date","time"]},"enum":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"sensitive":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["number","boolean"]},"description":{"type":"string","maxLength":300}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"integer"},"description":{"type":"string","maxLength":300},"format":{"type":"string","const":"minor"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/$defs/__schema0"}},"required":["type","properties"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"array"},"description":{"type":"string","maxLength":300},"items":{"$ref":"#/$defs/__schema1"}},"required":["type","items"],"additionalProperties":false}]}}},"CropDocumentInput":{"type":"object","properties":{"page":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","exclusiveMinimum":0,"maximum":1},"height":{"type":"number","exclusiveMinimum":0,"maximum":1}},"required":["x","y","width","height"]},"ExtractDocumentInput":{"type":"object","properties":{"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}}},"ParseDocumentInput":{"type":"object","properties":{"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"details":{"type":"boolean"}}},"ParseQuery":{"type":"object","properties":{"details":{"type":"boolean"},"tag":{"type":"string","maxLength":80}}},"ParseUpdateInput":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}}},"RotateDocumentInput":{"type":"object","properties":{"page":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"degrees":{"default":-90,"anyOf":[{"type":"number","const":90},{"type":"number","const":180},{"type":"number","const":270},{"type":"number","const":-90}]}}},"SettleDuplicatesInput":{"oneOf":[{"type":"object","properties":{"keep":{"type":"string","const":"all"},"others":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}}},"required":["keep"]},{"type":"object","properties":{"keep":{"type":"string","const":"selected"},"discard":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string"}},"values":{"default":{},"type":"object","properties":{"merchantName":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000}}}},"required":["keep","discard"]}]},"SplitDocumentInput":{"type":"object","properties":{"mode":{"type":"string","enum":["every_page","custom","detect","blank_pages"]},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"}},"required":["mode"]},"SplitOptions":{"type":"object","properties":{"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200}}},"SplitUploadInput":{"type":"object","properties":{"uploadId":{"type":"string","minLength":1},"mode":{"default":"detect","type":"string","enum":["every_page","custom","detect","blank_pages"]},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"}},"required":["uploadId"]},"UpdateBlueprintInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"documentType":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"schema":{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/$defs/__schema0"}},"required":["type","properties"],"additionalProperties":false},"fields":{"maxItems":150,"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":100},"example":{"type":"string","maxLength":200},"box":{"type":"object","properties":{"page":{"type":"integer","minimum":0,"maximum":49},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","minimum":0,"maximum":1},"height":{"type":"number","minimum":0,"maximum":1}},"required":["page","x","y","width","height"],"additionalProperties":false}},"required":["path"],"additionalProperties":false}}},"$defs":{"__schema0":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema1"}},"__schema1":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"string"},"description":{"type":"string","maxLength":300},"format":{"type":"string","enum":["date","time"]},"enum":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"sensitive":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["number","boolean"]},"description":{"type":"string","maxLength":300}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"integer"},"description":{"type":"string","maxLength":300},"format":{"type":"string","const":"minor"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/$defs/__schema0"}},"required":["type","properties"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"array"},"description":{"type":"string","maxLength":300},"items":{"$ref":"#/$defs/__schema1"}},"required":["type","items"],"additionalProperties":false}]}}},"StartWorkflowRunInput":{"type":"object","properties":{"uploadId":{"type":"string","minLength":1},"documentIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"nodeId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"}}},"AnalyticsQuery":{"type":"object","properties":{"status":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]},"kind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"limit":{"default":50,"type":"integer","minimum":1,"maximum":200},"interval":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]},"groupCurrency":{"type":"string","pattern":"^[A-Z]{3}$"}}},"ApproveReportInput":{"type":"object","properties":{"comment":{"type":"string","maxLength":2000},"held":{"default":"move","type":"string","enum":["move","approve"]},"bypass":{"default":false,"type":"boolean"},"expectedTotalMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000}}},"AttachReceiptInput":{"type":"object","properties":{"mode":{"default":"add","type":"string","enum":["add","replace"]},"clientId":{"type":"string","minLength":8,"maxLength":255},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}}},"BulkDocumentInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"filter":{"type":"object","properties":{"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"source_id":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"owner":{"type":"string","maxLength":100},"device_id":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"device_user_uuid":{"type":"string","maxLength":100},"viewed":{"type":"boolean"},"trashed":{"type":"boolean"},"envelope":{"type":"string"},"created__gt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"created__gte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"created__lt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"created__lte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__gt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__gte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__lt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__lte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"issued":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__gt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__gte":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__lt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__lte":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__gt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__gte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__lt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__lte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__gt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__gte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__lt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__lte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"category":{"type":"string","maxLength":120},"vendor":{"type":"string","maxLength":200},"notes":{"type":"string","maxLength":200},"payment_type":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"last_four_digits":{"type":"string","pattern":"^\\d{4}$"},"first_name":{"type":"string","maxLength":200},"last_name":{"type":"string","maxLength":200},"work_phone":{"type":"string","maxLength":40},"cell_phone":{"type":"string","maxLength":40},"company":{"type":"string","maxLength":200},"email":{"type":"string","maxLength":200},"website":{"type":"string","maxLength":200},"country":{"type":"string","maxLength":80},"state":{"type":"string","maxLength":120},"city":{"type":"string","maxLength":120},"zip":{"type":"string","maxLength":20},"name":{"type":"string","maxLength":200},"is_empty":{"type":"string","maxLength":400},"order_by":{"type":"string","enum":["created","updated","issued","total","tax","-created","-updated","-issued","-total","-tax"]},"folderId":{"type":"string"},"mailInBatchId":{"type":"string"},"setId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"tag":{"type":"string","maxLength":80},"archived":{"type":"boolean"},"unviewed":{"type":"boolean"},"q":{"type":"string","maxLength":200},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"fraudColor":{"type":"string","enum":["GREEN","YELLOW","RED"]},"fraudSignal":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"fraudReview":{"type":"string","enum":["PENDING","FRAUD","NOT_FRAUD","UNKNOWN"]}}},"cursor":{"type":"string"},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"move"},"folderId":{"type":["string","null"]}},"required":["type","folderId"]},{"type":"object","properties":{"type":{"type":"string","const":"set_type"},"documentType":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}},"required":["type","documentType"]},{"type":"object","properties":{"type":{"type":"string","const":"archive"},"archived":{"type":"boolean"}},"required":["type","archived"]},{"type":"object","properties":{"type":{"type":"string","const":"delete"}},"required":["type"]}]}},"required":["action"]},"TrashActionInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string"}},"all":{"type":"boolean"},"action":{"type":"string","enum":["restore","purge"]}},"required":["action"]},"BulkExpenseInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"set_category"},"categoryId":{"type":["string","null"]}},"required":["type","categoryId"]},{"type":"object","properties":{"type":{"type":"string","const":"set_project"},"projectId":{"type":["string","null"]}},"required":["type","projectId"]},{"type":"object","properties":{"type":{"type":"string","const":"add_tag"},"tagId":{"type":"string"}},"required":["type","tagId"]},{"type":"object","properties":{"type":{"type":"string","const":"set_billable"},"billable":{"type":"boolean"}},"required":["type","billable"]},{"type":"object","properties":{"type":{"type":"string","const":"set_reimbursable"},"reimbursable":{"type":"boolean"}},"required":["type","reimbursable"]},{"type":"object","properties":{"type":{"type":"string","const":"add_to_report"},"reportId":{"type":"string"}},"required":["type","reportId"]},{"type":"object","properties":{"type":{"type":"string","const":"mark_reviewed"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"void"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"restore"}},"required":["type"]}]}},"required":["ids","action"]},"BulkReassignInput":{"type":"object","properties":{"reportIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1}},"approverId":{"type":"string","minLength":1},"mode":{"default":"replace","type":"string","enum":["replace","insert"]}},"required":["reportIds","approverId"]},"BulkReportsInput":{"type":"object","properties":{"reportIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1}}},"required":["reportIds"]},"CatalogImportInput":{"type":"object","properties":{"csv":{"type":"string","minLength":1}},"required":["csv"]},"CatalogQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"archived":{"type":"string"}}},"CategoryInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"parentId":{"type":["string","null"]},"glCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"taxLine":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"deductiblePct":{"type":"integer","minimum":0,"maximum":100},"enabled":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","enum":["EXPENSE","COGS","INCOME","REFUND"]},"payrollCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"descriptionHint":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"approverId":{"type":["string","null"]},"commentRequired":{"type":"boolean"},"maxExpenseMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"headerOnly":{"type":"boolean"}},"required":["name"]},"CategoryQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"enabled":{"type":"string"},"type":{"type":"string","enum":["EXPENSE","COGS","INCOME","REFUND"]},"origin":{"type":"string","enum":["SYSTEM","CUSTOM","ACCOUNTING"]},"headers":{"type":"string"}}},"CommentInput":{"type":"object","properties":{"body":{"default":"","type":"string","maxLength":15000},"mentions":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"attachmentIds":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}}},"ContactExportInput":{"type":"object","properties":{"format":{"type":"string","enum":["vcard","google","outlook","csv"]},"ids":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string"}}},"required":["format"]},"ContactListQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"documentId":{"type":"string"},"name":{"type":"string","maxLength":200},"company":{"type":"string","maxLength":200},"email":{"type":"string","maxLength":254},"phone":{"type":"string","maxLength":40},"website":{"type":"string","maxLength":300},"city":{"type":"string","maxLength":120},"region":{"type":"string","maxLength":120},"postalCode":{"type":"string","maxLength":20},"country":{"type":"string","maxLength":120}}},"CreateDocumentInput":{"type":"object","properties":{"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"taxonomy":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"allowed_async_enrichments":{"maxItems":10,"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"compute":{"type":"boolean"},"parse_address":{"type":"boolean"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50},"boost_mode":{"type":"boolean"},"auto_delete":{"type":"boolean"},"stitch":{"type":"boolean"},"crop_document":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"async":{"type":"boolean"},"line_item_expansion":{"type":"boolean"},"tiff_dpi":{"type":"number"},"type":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"clientId":{"type":"string","minLength":8,"maxLength":255},"externalId":{"type":"string","maxLength":200},"folderId":{"type":"string"},"notes":{"type":"string","maxLength":2000},"capturedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"locationAccuracyM":{"type":"number","minimum":0},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"merchantName":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"totalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"taxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"category":{"type":"string","minLength":1,"maxLength":120}}},"CreateExpenseInput":{"type":"object","properties":{"merchantName":{"type":["string","null"]},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"baseAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"fxRate":{"anyOf":[{"type":"number","minimum":1e-8,"maximum":9999999999},{"type":"null"}]},"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"paymentAccountId":{"type":["string","null"]},"cardLast4":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"poNumber":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"mcc":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"taxDeductible":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"alsoCategoryIds":{"maxItems":10,"type":"array","items":{"type":"string"}},"tagIds":{"type":"array","items":{"type":"string"}},"attendees":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[+\\d][\\d\\s().-]*$"}},"required":["name"]}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"categoryId":{"type":["string","null"]}},"required":["description","amountMinor"]}},"kind":{"default":"MANUAL","type":"string","enum":["MANUAL","MILEAGE","PER_DIEM","TIME"]},"quantity":{"type":"number","exclusiveMinimum":0},"rateMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"unit":{"type":"string","maxLength":10},"trip":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"vehicleId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"ownerId":{"type":"string","minLength":1},"reportId":{"type":"string","minLength":1}},"required":["date","amountMinor"]},"CreateExportInput":{"type":"object","properties":{"kind":{"type":"string","enum":["expenses","report","tax","mileage","receipts","documents"]},"format":{"type":"string","enum":["CSV","XLSX","PDF","ZIP","QBO_CSV","XERO_CSV","SAGE_CSV","DYNAMICS_CSV","MYOB_TXT","ORACLE_CSV","SAP_CSV","IIF","OFX","JSON","XML","TXT","XLS"]},"filters":{"default":{},"type":"object","properties":{"status":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]},"kind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"ids":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string"}},"year":{"type":"integer","minimum":2000,"maximum":2100},"reportState":{"anyOf":[{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]},{"minItems":1,"type":"array","items":{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]}}]},"reportIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1}},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"approvedAfter":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"exported":{"type":"boolean"},"categoryIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1}},"documentIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","minLength":1}},"documentTypes":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}},"policyIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1}}}},"templateId":{"type":"string"},"fullPageReceipts":{"type":"boolean"},"template":{"type":"string","minLength":1,"maxLength":20000},"onFinish":{"type":"object","properties":{"email":{"type":"object","properties":{"recipients":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"message":{"type":"string","minLength":1,"maxLength":1000}},"required":["recipients"]},"markAsExported":{"type":"boolean"},"sftpUpload":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253},"port":{"default":22,"type":"integer","minimum":1,"maximum":65535},"username":{"type":"string","minLength":1,"maxLength":256},"password":{"type":"string","minLength":1,"maxLength":1024},"privateKey":{"type":"string","minLength":1,"maxLength":16384},"passphrase":{"type":"string","minLength":1,"maxLength":1024},"hostKeySha256":{"type":"string","pattern":"^(SHA256:)?[A-Za-z0-9+/]{43}=?$"},"path":{"default":".","type":"string","minLength":1,"maxLength":1024}},"required":["host","username","hostKeySha256"]}}},"delimiter":{"type":"string","enum":[",",";","\t","|"]},"bom":{"type":"boolean"},"recipients":{"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"columnSet":{"type":"string","enum":["simple","detailed"]},"preset":{"type":"string","enum":["basic","all_data_expense","all_data_report","canadian_multiple_tax","category","per_diem","tag","tax_report"]},"view":{"type":"object","properties":{"level":{"default":"expense","type":"string","enum":["expense","report"]},"columns":{"minItems":1,"maxItems":60,"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":80}},"required":["key"]}},"sort":{"type":"string","enum":["date:asc","date:desc","merchant:asc","merchant:desc","category:asc","category:desc","status:asc","status:desc","amount:asc","amount:desc"]},"groupBy":{"type":"string","enum":["category","merchant","member","project","status","month"]},"groupsOnly":{"type":"boolean"}},"required":["columns"]}},"required":["kind","format"]},"CreateMerchantInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"defaultCategoryId":{"type":["string","null"]},"website":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"is1099":{"type":"boolean"},"merchantType":{"anyOf":[{"type":"string","enum":["airline","lodging","car_rental","ground_transport","fuel","dining","grocery","office","software","utilities","supplies","other"]},{"type":"null"}]}},"required":["name"]},"CreatePerDiemInput":{"type":"object","properties":{"perDiemRateId":{"type":"string","minLength":1},"mieRateId":{"type":"string","minLength":1},"subRates":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"rateId":{"type":"string","minLength":1},"quantity":{"type":"integer","exclusiveMinimum":0,"maximum":366}},"required":["rateId","quantity"]}},"lodgingRateId":{"type":"string","minLength":1},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"partialDays":{"default":true,"type":"boolean"},"destination":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"mealsCategoryId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"tagIds":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1}},"categoryId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"required":["startDate","endDate"]},"CreateReportInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"purpose":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"expenseIds":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"ownerId":{"type":"string","minLength":1}}},"CreateTimeInput":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"hours":{"type":"number","exclusiveMinimum":0,"maximum":10000},"rateMinor":{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"description":{"type":"string","minLength":1,"maxLength":1000},"categoryId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"required":["date","hours","rateMinor","description"]},"CreateTripInput":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"distance":{"type":"number","exclusiveMinimum":0,"maximum":100000},"odometerStart":{"type":"number","minimum":0,"maximum":10000000},"odometerEnd":{"type":"number","minimum":0,"maximum":10000000},"routeDistance":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":100000},{"type":"null"}]},"roundTrip":{"default":false,"type":"boolean"},"origin":{"type":"string","minLength":1,"maxLength":200},"destination":{"type":"string","minLength":1,"maxLength":200},"stops":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"departed":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"arrived":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"purpose":{"type":"string","minLength":1,"maxLength":500},"vehicleId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"rateId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"routeToken":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]},"categoryId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"required":["date","origin","destination","purpose"]},"CreateWebhookInput":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","maxLength":200},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["document.created","document.processed","document.failed","document.enriched","document.enrichment_failed","document_set.completed","document_set.failed","split.completed","split.created","split.failed","split_and_classify.created","split_and_classify.failed","w2_set.created","w2_set.failed","bank_statement_set.created","bank_statement_set.failed","expense.created","expense.updated","expense.deleted","report.submitted","report.approved","report.rejected","report.reimbursed","integration.posted","integration.failed"]}},"apiKeyId":{"type":"string","minLength":1,"maxLength":64}},"required":["url","events"]},"ConfirmWebhookInput":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":200}},"required":["token"]},"WebhookListQuery":{"type":"object","properties":{"apiKeyId":{"type":"string","minLength":1,"maxLength":64},"include":{"type":"string","enum":["keys"]}}},"DocumentListQuery":{"type":"object","properties":{"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"source_id":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"owner":{"type":"string","maxLength":100},"device_id":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"device_user_uuid":{"type":"string","maxLength":100},"viewed":{"type":"boolean"},"trashed":{"type":"boolean"},"envelope":{"type":"string"},"created__gt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"created__gte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"created__lt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"created__lte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__gt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__gte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__lt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__lte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"issued":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__gt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__gte":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__lt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__lte":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__gt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__gte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__lt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__lte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__gt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__gte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__lt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__lte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"category":{"type":"string","maxLength":120},"vendor":{"type":"string","maxLength":200},"notes":{"type":"string","maxLength":200},"payment_type":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"last_four_digits":{"type":"string","pattern":"^\\d{4}$"},"first_name":{"type":"string","maxLength":200},"last_name":{"type":"string","maxLength":200},"work_phone":{"type":"string","maxLength":40},"cell_phone":{"type":"string","maxLength":40},"company":{"type":"string","maxLength":200},"email":{"type":"string","maxLength":200},"website":{"type":"string","maxLength":200},"country":{"type":"string","maxLength":80},"state":{"type":"string","maxLength":120},"city":{"type":"string","maxLength":120},"zip":{"type":"string","maxLength":20},"name":{"type":"string","maxLength":200},"is_empty":{"type":"string","maxLength":400},"order_by":{"type":"string","enum":["created","updated","issued","total","tax","-created","-updated","-issued","-total","-tax"]},"folderId":{"type":"string"},"mailInBatchId":{"type":"string"},"setId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"tag":{"type":"string","maxLength":80},"archived":{"type":"boolean"},"unviewed":{"type":"boolean"},"q":{"type":"string","maxLength":200},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"fraudColor":{"type":"string","enum":["GREEN","YELLOW","RED"]},"fraudSignal":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"fraudReview":{"type":"string","enum":["PENDING","FRAUD","NOT_FRAUD","UNKNOWN"]}}},"ExpenseListPageQuery":{"type":"object","properties":{"status":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]},"kind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"ownerId":{"type":"string"},"scope":{"default":"mine","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"sort":{"type":"string","enum":["date:asc","date:desc","merchant:asc","merchant:desc","category:asc","category:desc","status:asc","status:desc","amount:asc","amount:desc"]}}},"ExpenseTotalsQuery":{"type":"object","properties":{"status":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]},"kind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"ownerId":{"type":"string"},"scope":{"default":"mine","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"ids":{"anyOf":[{"type":"string","minLength":1},{"maxItems":500,"type":"array","items":{"type":"string","minLength":1}}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}}},"FolderInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"parentId":{"type":["string","null"]}},"required":["name"]},"FolderQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"parentId":{"type":"string"}}},"DismissFlagInput":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}}},"HoldExpenseInput":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"ReachMentionedInput":{"type":"object","properties":{"userIds":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","maxLength":64}}},"required":["userIds"]},"MergeMerchantInput":{"type":"object","properties":{"intoId":{"type":"string","minLength":1}},"required":["intoId"]},"MerchantInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"defaultCategoryId":{"type":["string","null"]},"website":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"is1099":{"type":"boolean"},"merchantType":{"anyOf":[{"type":"string","enum":["airline","lodging","car_rental","ground_transport","fuel","dining","grocery","office","software","utilities","supplies","other"]},{"type":"null"}]}}},"MileageLogQuery":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"scope":{"default":"mine","type":"string","enum":["mine","all"]},"ownerId":{"type":"string"},"vehicleId":{"type":"string"},"purpose":{"type":"string","enum":["business","medical","charity"]}}},"OdometerPhotoInput":{"type":"object","properties":{"reading":{"type":"string","enum":["START","END"]}},"required":["reading"]},"ProjectInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"code":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"clientId":{"type":["string","null"]},"budgetMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"archived":{"type":"boolean"}},"required":["name"]},"ProjectQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"archived":{"type":"string"},"clientId":{"type":"string"}}},"ReassignReportInput":{"type":"object","properties":{"approverId":{"type":"string","minLength":1},"mode":{"default":"replace","type":"string","enum":["replace","insert"]}},"required":["approverId"]},"RejectExpenseInput":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["reason"]},"RejectReportInput":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":2000},"to":{"type":"string","minLength":1}},"required":["reason"]},"ReportExpensesInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}}},"required":["ids"]},"ReportListQuery":{"type":"object","properties":{"status":{"anyOf":[{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]},{"type":"array","items":{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]}}]},"scope":{"default":"mine","type":"string","enum":["mine","all","assigned"]},"ownerId":{"type":"string"},"q":{"type":"string","maxLength":200},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}},"ReportParticipantInput":{"type":"object","properties":{"userId":{"type":"string","minLength":1}},"required":["userId"]},"SubmitReportInput":{"type":"object","properties":{"memo":{"type":"string","maxLength":2000},"cc":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1}},"to":{"type":"string","minLength":1},"ccEmails":{"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"attachPdf":{"type":"boolean"},"approverEmail":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"SubmitDocumentInput":{"type":"object","properties":{"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"taxonomy":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"allowed_async_enrichments":{"maxItems":10,"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"compute":{"type":"boolean"},"parse_address":{"type":"boolean"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50},"boost_mode":{"type":"boolean"},"auto_delete":{"type":"boolean"},"stitch":{"type":"boolean"},"crop_document":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"async":{"type":"boolean"},"line_item_expansion":{"type":"boolean"},"tiff_dpi":{"type":"number"},"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_urls":{"minItems":1,"maxItems":15,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"device_id":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"type":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"bucket":{"type":"string","pattern":"^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$"},"package_path":{"type":"string","minLength":1,"maxLength":1024}}},"TagInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"groupName":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"glCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"archived":{"type":"boolean"},"approverId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"parentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["name"]},"TaxSummaryQuery":{"type":"object","properties":{"year":{"type":"integer","minimum":2000,"maximum":2100}}},"TripRouteQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200}}},"UpdateCategoryInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"parentId":{"type":["string","null"]},"glCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"taxLine":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"deductiblePct":{"type":"integer","minimum":0,"maximum":100},"enabled":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"type":"string","enum":["EXPENSE","COGS","INCOME","REFUND"]},"payrollCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"descriptionHint":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"approverId":{"type":["string","null"]},"commentRequired":{"type":"boolean"},"maxExpenseMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"headerOnly":{"type":"boolean"}}},"UpdateDocumentInput":{"type":"object","properties":{"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"folderId":{"type":["string","null"]},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"status":{"type":"string","enum":["PROCESSED","REVIEWED"]},"approved":{"type":"boolean"},"fraudReview":{"type":"object","properties":{"decision":{"type":"string","enum":["FRAUD","NOT_FRAUD","UNKNOWN"]},"types":{"default":[],"maxItems":25,"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},"note":{"type":"string","maxLength":2000}},"required":["decision"]},"billable":{"type":"boolean"},"merchantName":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"totalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tipMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2000}},{"type":"null"}]}},"corrections":{"type":"object","propertyNames":{"type":"string","enum":["vendor.address","vendor.phoneNumber","vendor.faxNumber","vendor.email","vendor.web","vendor.vatNumber","vendor.regNumber","vendor.abnNumber","vendor.orderNumber","billTo.name","billTo.address","billTo.email","billTo.phoneNumber","shipTo.name","shipTo.address","payment.terms","orderDate","shipDate","deliveryDate","serviceStartDate","serviceEndDate","deliveryNoteNumber","trackingNumber","incoterms","licensePlateNumber","vinNumber","storeNumber","serverName","folio.arrivalDate","folio.departureDate","folio.roomNumber","folio.guestName","folio.confirmationNumber"]},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}},"UpdateExpenseInput":{"type":"object","properties":{"merchantName":{"type":["string","null"]},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"baseAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"fxRate":{"anyOf":[{"type":"number","minimum":1e-8,"maximum":9999999999},{"type":"null"}]},"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"paymentAccountId":{"type":["string","null"]},"cardLast4":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"poNumber":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"mcc":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"taxDeductible":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"alsoCategoryIds":{"maxItems":10,"type":"array","items":{"type":"string"}},"tagIds":{"type":"array","items":{"type":"string"}},"attendees":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[+\\d][\\d\\s().-]*$"}},"required":["name"]}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"categoryId":{"type":["string","null"]}},"required":["description","amountMinor"]}}}},"UpdateFolderInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"parentId":{"type":["string","null"]}}},"UpdateProjectInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"code":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"clientId":{"type":["string","null"]},"budgetMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"archived":{"type":"boolean"}}},"UpdateReportInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"purpose":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}},"UpdateTagInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"groupName":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"glCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"archived":{"type":"boolean"},"approverId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"parentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}}},"UpdateWebhookInput":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"events":{"minItems":1,"type":"array","items":{"type":"string","enum":["document.created","document.processed","document.failed","document.enriched","document.enrichment_failed","document_set.completed","document_set.failed","split.completed","split.created","split.failed","split_and_classify.created","split_and_classify.failed","w2_set.created","w2_set.failed","bank_statement_set.created","bank_statement_set.failed","expense.created","expense.updated","expense.deleted","report.submitted","report.approved","report.rejected","report.reimbursed","integration.posted","integration.failed"]}},"enabled":{"type":"boolean"}}},"VehicleQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"archived":{"type":"string"},"userId":{"type":"string"}}},"BlockDeviceInput":{"type":"object","properties":{"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"reason":{"type":"string","maxLength":500}},"required":["deviceId"]},"FraudReviewInput":{"type":"object","properties":{"decision":{"type":"string","enum":["FRAUD","NOT_FRAUD","UNKNOWN"]},"types":{"default":[],"maxItems":25,"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},"note":{"type":"string","maxLength":2000}},"required":["decision"]},"RevealDocumentInput":{"type":"object","properties":{"kinds":{"maxItems":6,"type":"array","items":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]}},"reason":{"type":"string","maxLength":500}}},"CheckWithDocumentInput":{"type":"object","properties":{"check":{"type":"object","properties":{"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"taxonomy":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"allowed_async_enrichments":{"maxItems":10,"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"compute":{"type":"boolean"},"parse_address":{"type":"boolean"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50},"boost_mode":{"type":"boolean"},"auto_delete":{"type":"boolean"},"stitch":{"type":"boolean"},"crop_document":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"async":{"type":"boolean"},"line_item_expansion":{"type":"boolean"},"tiff_dpi":{"type":"number"},"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_urls":{"minItems":1,"maxItems":15,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"device_id":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"type":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"bucket":{"type":"string","pattern":"^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$"},"package_path":{"type":"string","minLength":1,"maxLength":1024}}},"document":{"type":"object","properties":{"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"taxonomy":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"allowed_async_enrichments":{"maxItems":10,"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"compute":{"type":"boolean"},"parse_address":{"type":"boolean"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50},"boost_mode":{"type":"boolean"},"auto_delete":{"type":"boolean"},"stitch":{"type":"boolean"},"crop_document":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"async":{"type":"boolean"},"line_item_expansion":{"type":"boolean"},"tiff_dpi":{"type":"number"},"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_urls":{"minItems":1,"maxItems":15,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"device_id":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"type":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"bucket":{"type":"string","pattern":"^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$"},"package_path":{"type":"string","minLength":1,"maxLength":1024}}}},"required":["check","document"]},"BillingInvoicePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":["string","null"]},"status":{"type":["string","null"]},"currency":{"type":"string"},"totalMinor":{"type":"number"},"amountPaidMinor":{"type":"number"},"amountDueMinor":{"type":"number"},"createdAt":{"type":"string"},"periodStart":{"type":["string","null"]},"periodEnd":{"type":["string","null"]},"hostedUrl":{"description":"Stripe's page for the invoice.","type":["string","null"]},"pdfUrl":{"description":"Stripe's PDF of it.","type":["string","null"]}},"required":["id","number","status","currency","totalMinor","amountPaidMinor","amountDueMinor","createdAt","periodStart","periodEnd","hostedUrl","pdfUrl"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExportRecordPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"target":{"type":"string","description":"A service, such as QUICKBOOKS_ONLINE, a file format, such as CSV, or what a program named."},"externalId":{"description":"The id it has there.","type":["string","null"]},"exportJobId":{"type":["string","null"]},"via":{"type":"string","enum":["EXPORT","SYNC","API"]},"createdAt":{"type":"string"}},"required":["id","documentId","expenseId","target","externalId","exportJobId","via","createdAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExportRecordsAppended":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"target":{"type":"string","description":"A service, such as QUICKBOOKS_ONLINE, a file format, such as CSV, or what a program named."},"externalId":{"description":"The id it has there.","type":["string","null"]},"exportJobId":{"type":["string","null"]},"via":{"type":"string","enum":["EXPORT","SYNC","API"]},"createdAt":{"type":"string"}},"required":["id","documentId","expenseId","target","externalId","exportJobId","via","createdAt"]}},"alreadyRecorded":{"type":"number","description":"Already recorded, so left as they were."}},"required":["data","alreadyRecorded"]},"DocumentDetail":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"originalFilename":{"type":["string","null"]},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"pageCount":{"type":"number"},"externalId":{"type":["string","null"]},"folderId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"mailInBatchId":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"latitude":{"description":"Where the device said it was when the photo was taken.","type":["number","null"]},"longitude":{"type":["number","null"]},"locationAccuracyM":{"type":["number","null"]},"duplicateOfId":{"type":["string","null"]},"processingError":{"type":["string","null"]},"processingErrorCode":{"anyOf":[{"type":"string","enum":["FILE_ENCRYPTED"]},{"type":"null"}],"description":"Set when the failure is one the file's owner can fix. processingError says what to do."},"verification":{"type":"string"},"capturedAt":{"type":["string","null"]},"processedAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"uploadedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all."},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}],"description":"Null when the page is not one, and for a caller without expenses.read_all."},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all. Value null means nothing could say."},"language":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]}},"ocrScore":{"type":["number","null"]},"isFront":{"description":"A check: the front or the back.","type":["boolean","null"]},"tiffRejectScore":{"description":"A check: 0 is a clean clearing image and 1 is one a bank would send back.","type":["number","null"]},"tiffUpscaled":{"description":"A check: the photo was under 240 DPI, so the clearing image was enlarged.","type":["boolean","null"]}},"required":["index","url","thumbnailUrl","width","height","isBlurry","glare","isLcd","screenshot","aiGenerated","language","languages","ocrScore","isFront","tiffRejectScore","tiffUpscaled"]}},"classification":{"anyOf":[{"type":"object","properties":{"value":{"type":"string","description":"A document class, or one of the labels the caller named."},"score":{"type":"number","description":"0..1."},"engine":{"type":"string","enum":["rules","claude"]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["value","score","engine","scores"]},{"type":"null"}],"description":"What the classifier decided, when it was asked."},"blueprint":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"description":"Null for a built-in, which has no versions.","type":["number","null"]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The fields the blueprint defines. Null when the run failed."},"offsets":{"description":"Where each value sits in the text, for a blueprint that asks.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"begin":{"type":"number"},"end":{"type":"number"}},"required":["begin","end"]}},"unmatched":{"description":"Fields where a value was read and did not fit, such as words where a number belongs or a choice off the list. Each is left empty. An empty field not named here was not on the document.","type":"array","items":{"type":"string"}},"error":{"description":"Why the run gave nothing back.","type":["string","null"]}},"required":["name","version","result","error"]},{"type":"null"}],"description":"The blueprint this was read with, and what came out of it."},"tags":{"type":"array","items":{"type":"string"}},"tagRefs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The same tags with their ids, which a tag route takes."},"recordStatus":{"anyOf":[{"type":"string","enum":["processed","reviewed","archived"]},{"type":"null"}],"description":"Where a read document stands: reviewedAt and archivedAt in one word. Null until it has been read."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."},"setId":{"description":"The upload this came out of: a ZIP, a split PDF or a batch of addresses.","type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}],"description":"Values the workspace custom field rules read out of the text."},"enrichment":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","DONE","FAILED"]},"steps":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"failed":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}}},"required":["status","steps","failed"]},{"type":"null"}],"description":"Work still running after the first answer."},"extraction":{"anyOf":[{"type":"object","properties":{"fields":{"type":"object","properties":{"documentType":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"merchantName":{"type":["string","null"]},"merchantAddress":{"type":["string","null"]},"merchantPhone":{"type":["string","null"]},"merchantWebsite":{"type":["string","null"]},"merchantTaxId":{"type":["string","null"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"time":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG","CUC","HRK","SLL","ZWL","XDR","XSU"]},{"type":"null"}]},"currencyGuessed":{"default":false,"type":"boolean"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxLines":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"code":{"type":["string","null"]},"totalInclusive":{"type":["boolean","null"]}},"required":["amountMinor"]}},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"cardBrand":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"receiptNumber":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"poNumber":{"type":["string","null"]},"lineItems":{"default":[],"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"id":{"type":["string","null"]},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["room","tax","parking","service","fee","delivery","product","food","alcohol","tobacco","transportation","fuel","refund","discount","payment","giftcard","donation","toll","lottery"]},{"type":"null"}]},"fullDescription":{"type":["string","null"]},"normalizedDescription":{"type":["string","null"]},"section":{"type":["string","null"]},"reference":{"type":["string","null"]},"upc":{"type":["string","null"]},"hsn":{"type":["string","null"]},"lot":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unitOfMeasure":{"type":["string","null"]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountRatePct":{"type":["number","null"]},"discountPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxRatePct":{"type":["number","null"]},"taxCode":{"type":["string","null"]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"grossTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"netTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"category":{"type":["string","null"]},"customCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countryOfOrigin":{"type":["string","null"]},"manufacturer":{"type":["string","null"]},"weight":{"type":["string","null"]},"brand":{"type":["string","null"]},"hsaFsaEligible":{"type":["boolean","null"]},"productInfo":{"anyOf":[{"type":"object","properties":{"expandedDescription":{"type":["string","null"]},"brand":{"type":["string","null"]},"categoryPath":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},{"type":"null"}]}},"required":["description","amountMinor"]}},"suggestedCategory":{"type":["string","null"]},"documentTitle":{"type":["string","null"]},"documentReferenceNumber":{"type":["string","null"]},"isDocument":{"type":["boolean","null"]},"isTransaction":{"type":["boolean","null"]},"isMoneyIn":{"type":["boolean","null"]},"accountingEntryType":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}]},"vendor":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"vendors":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}}},{"type":"null"}]},"bankBreakdown":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}}},{"type":"null"}]},"billTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"vatNumber":{"type":["string","null"]},"regNumber":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"email":{"type":["string","null"]}}},{"type":"null"}]},"shipTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"insuranceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cashbackMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"roundingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"finalBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"previousBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"totalQuantity":{"type":["number","null"]},"totalWeight":{"type":["string","null"]},"payment":{"anyOf":[{"type":"object","properties":{"cardNumber":{"type":["string","null"]},"displayName":{"type":["string","null"]},"terms":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["none","visa","master_card","cash","american_express","interac","other","maestro","discover","bancontact","girocard","applepay","paypal","bancomat","giftcard","card","check","bankaxept","bank-to-bank_transfer_bacs","octopus","pix","jcb","waon","mada","wechat","alipay","unionpay","googlepay","rupay","bpay","shopeepay","mir","giropay","food_stamp","diners_club","paypay"]},{"type":"null"}]}}},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"shipDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliveryDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"exchangeRate":{"type":["number","null"]},"countryCode":{"type":["string","null"]},"deliveryNoteNumber":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"trackingNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"incoterms":{"type":["string","null"]},"weights":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"licensePlateNumber":{"type":["string","null"]},"vinNumber":{"type":["string","null"]},"guestCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"serverName":{"type":["string","null"]},"storeNumber":{"type":["string","null"]},"vendingPerson":{"type":["string","null"]},"vendingPersonNumber":{"type":["string","null"]},"customerAccountNumber":{"type":["string","null"]},"category":{"type":["string","null"]},"defaultCategory":{"type":["string","null"]},"barcodes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"type":{"type":"string","enum":["QR_CODE","PDF417","EAN_13","EAN_8","UPC_A","UPC_E","CODE_128","CODE_39","ITF","DATA_MATRIX","AZTEC","OTHER"]},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"boundingRegion":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]}},"required":["data","type","page"]}},{"type":"null"}]},"paymentLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string","enum":["text","hyperlink","qr_code","barcode"]}},"required":["url","source"]}},{"type":"null"}]},"folio":{"anyOf":[{"type":"object","properties":{"arrivalDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"departureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roomNumber":{"type":["string","null"]},"guestName":{"type":["string","null"]},"nights":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"confirmationNumber":{"type":["string","null"]}}},{"type":"null"}]},"enrichedFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"check":{"anyOf":[{"type":"object","properties":{"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountText":{"type":["string","null"]},"amountsAgree":{"type":["boolean","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"checkNumber":{"type":["string","null"]},"checkType":{"anyOf":[{"type":"string","enum":["bank_draft","bill_pay_draft","business_check","cashiers_check","government_check","money_order","personal_check","starter_check","teller_check"]},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"memo":{"type":["string","null"]},"payerName":{"type":["string","null"]},"payerAddress":{"type":["string","null"]},"receiverName":{"type":["string","null"]},"receiverAddress":{"type":["string","null"]},"isSigned":{"type":["boolean","null"]},"endorsement":{"anyOf":[{"type":"object","properties":{"isEndorsed":{"type":["boolean","null"]},"isSigned":{"type":["boolean","null"]},"mobileOrRemoteDeposit":{"anyOf":[{"type":"object","properties":{"checkbox":{"type":["boolean","null"]},"instructions":{"type":["boolean","null"]}}},{"type":"null"}]},"isMobileOrRemoteDepositOnly":{"type":["boolean","null"]}}},{"type":"null"}]},"micr":{"anyOf":[{"type":"object","properties":{"routingNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"serialNumber":{"type":["string","null"]},"raw":{"type":["string","null"]},"branch":{"type":["string","null"]},"institution":{"type":["string","null"]},"transactionCode":{"type":["string","null"]}}},{"type":"null"}]},"fractionalRoutingNumber":{"type":["string","null"]},"routingFromFractional":{"type":["string","null"]},"voidTerms":{"type":["string","null"]}}},{"type":"null"}]},"statement":{"anyOf":[{"type":"object","properties":{"accountHolderName":{"type":["string","null"]},"accountHolderAddress":{"type":["string","null"]},"accountType":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"bankWebsite":{"type":["string","null"]},"bankVatNumber":{"type":["string","null"]},"accountVatNumber":{"type":["string","null"]},"periodStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementNumber":{"type":["string","null"]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"minimumDueMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"routingNumber":{"type":["string","null"]},"swift":{"type":["string","null"]},"iban":{"type":["string","null"]},"accounts":{"default":[],"type":"array","items":{"type":"object","properties":{"number":{"type":["string","null"]},"ibanNumber":{"type":["string","null"]},"accountType":{"type":["string","null"]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"summaries":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["name"]}},"transactions":{"default":[],"type":"array","items":{"type":"object","properties":{"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"postedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"vendor":{"type":["string","null"]},"transactionId":{"type":["string","null"]},"debitAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"creditAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cardNumber":{"type":["string","null"]},"text":{"type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["order"]}}}}},"balancesAgree":{"type":["boolean","null"]}}},{"type":"null"}]},"taxForm":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["W2","W9","W8BEN_E"]},"w2":{"anyOf":[{"type":"object","properties":{"employeeSsn":{"type":["string","null"]},"ein":{"type":["string","null"]},"employerName":{"type":["string","null"]},"employerAddress":{"type":["string","null"]},"controlNumber":{"type":["string","null"]},"employeeName":{"type":["string","null"]},"employeeAddress":{"type":["string","null"]},"wagesOtherComps":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"federalIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"allocatedTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"advanceEicPayment":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dependentCareBenefits":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"nonQualifiedPlans":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"box12":{"default":[],"type":"array","items":{"type":"object","properties":{"box":{"type":"string"},"code":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["box","code"]}},"is13a":{"type":["boolean","null"]},"is13b":{"type":["boolean","null"]},"is13c":{"type":["boolean","null"]},"box14Other":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["label"]}},"stateLines":{"default":[],"type":"array","items":{"type":"object","properties":{"state":{"type":["string","null"]},"employerStateId":{"type":["string","null"]},"stateWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"stateIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localityName":{"type":["string","null"]}}}},"taxYear":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"w9":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"businessName":{"type":["string","null"]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"individual":{"type":["boolean","null"]},"cCorp":{"type":["boolean","null"]},"sCorp":{"type":["boolean","null"]},"partnership":{"type":["boolean","null"]},"trustEstate":{"type":["boolean","null"]},"llc":{"type":["boolean","null"]},"llcType":{"type":["string","null"]},"other":{"type":["boolean","null"]},"otherDescription":{"type":["string","null"]},"exemptPayeeCode":{"type":["string","null"]},"exemption":{"type":["string","null"]},"ssn":{"type":["string","null"]},"ein":{"type":["string","null"]},"accountNumbers":{"type":["string","null"]},"requester":{"type":["string","null"]},"signature":{"type":["boolean","null"]},"signatureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}},{"type":"null"}]},"w8BenE":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","boolean","null"]}},{"type":"null"}]}},"required":["kind"]},{"type":"null"}]},"itinerary":{"anyOf":[{"type":"object","properties":{"travelerName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"returnsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"segments":{"default":[],"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]}}}},{"type":"null"}]},"fieldConfidence":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fieldBoxes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"page":{"type":"number"},"box":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4}},"required":["page","box"]}}},"description":"What was read, as the extraction contract types it. fieldConfidence holds per-field confidence, 0..1."},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["tax_rate_mismatch","item_counts_mismatch","totals_mismatch","line_item_amount_mismatch","line_item_repeats","barcode_decoding_issue","barcode_code_missing_in_ocr","logo_vendor_mismatch","malware","weekend_transaction","time_and_currency_mismatch","exif_creation_modified_date_mismatch","missing_date","suspicious_document_aspect_ratio","generic_placeholder_content"]},"message":{"type":"string"},"page":{"type":["number","null"]}},"required":["code","message"]},"description":"Integrity findings. A caller without expenses.read_all sees the arithmetic and dates only."}},"required":["fields","confidence","flags","warnings"]},{"type":"null"}]},"fraud":{"anyOf":[{"type":"object","properties":{"version":{"type":"string"},"score":{"type":"number","description":"0 to 1, from the signals that fired. Evidence, never a verdict."},"color":{"type":"string","enum":["green","yellow","red"],"description":"Under the workspace yellow threshold is green. Over its red threshold is red."},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"description":"Signals that fired, most important first."},"details":{"type":"object","propertyNames":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"additionalProperties":{"type":"object","properties":{"description":{"type":"string"},"confidence":{"type":"number","description":"How sure the detector is of what it saw, 0 to 1. Not how likely fraud is."},"reasons":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Stable."},"description":{"type":"string","description":"Written for a person."},"field":{"description":"Where it was read: exif:Software, totalMinor.","type":["string","null"]},"value":{"type":["string","null"]},"page":{"description":"Zero-based.","type":["number","null"]},"score":{"type":["number","null"]},"box":{"description":"Where on the page, as fractions of its size: x, y, width, height.","anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]}},"required":["name","description"]}}},"required":["description","confidence","reasons"]},"description":"By signal: a description, a confidence and typed reasons."},"attribution":{"description":"One sentence naming the strongest evidence.","type":["string","null"]},"decision":{"type":"string","enum":["clear","review","fraud","not_fraud","unknown"],"description":"clear or review until a person decides. Only a person can say fraud."},"review":{"anyOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["FRAUD","NOT_FRAUD","UNKNOWN"]},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},"note":{"type":["string","null"]},"reviewedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"reviewedAt":{"type":"string"}},"required":["decision","types","note","reviewedBy","reviewedAt"]},{"type":"null"}]},"deviceId":{"description":"The id the client sent for its device, when it sent one.","type":["string","null"]},"submissions":{"anyOf":[{"type":"object","properties":{"lastMinutes":{"type":"number"},"lastDay":{"type":"number"},"lastWeek":{"type":"number"},"last2Weeks":{"type":"number"},"lastMonth":{"type":"number"}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]},{"type":"null"}],"description":"Documents from this uploader in this workspace, by window."},"deviceProfiles":{"type":"array","items":{"type":"object","properties":{"deviceId":{"type":"string"},"profileId":{"type":"string"},"documentCount":{"type":"number"}},"required":["deviceId","profileId","documentCount"]},"description":"Over 30 days, inside this workspace only."},"digitalTamperingFields":{"type":"array","items":{"type":"string"}},"handwriting":{"type":"object","properties":{"handwrittenFields":{"type":"array","items":{"type":"string"}},"fullyHandwrittenFields":{"type":"array","items":{"type":"string"}},"handwrittenTamperedFields":{"type":"array","items":{"type":"string"}},"handwritingDetected":{"type":["boolean","null"]},"handwritingTamperingPresent":{"type":["boolean","null"]}},"required":["handwrittenFields","fullyHandwrittenFields","handwrittenTamperedFields","handwritingDetected","handwritingTamperingPresent"],"description":"What Claude saw written by hand, in dot notation, when a key is set and the handwriting signal is on. With no key, the lists are empty and the flags null: skipped says why."},"notADocument":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"digitalBackground":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"fraudulentPdf":{"anyOf":[{"type":"object","properties":{"fraudulentPdfCreator":{"type":["number","null"]},"textOverlay":{"type":["number","null"]},"fontMismatch":{"type":["number","null"]},"hasDigitalSignature":{"type":["boolean","null"]},"pdfModified":{"type":["number","null"]},"incrementalUpdates":{"type":["number","null"]},"incrementalChanges":{"type":"array","items":{"type":"string"}},"incrementalEdits":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["page","before","after"]}},"signatureCreationTools":{"type":"array","items":{"type":"string"}},"dateInversion":{"type":["number","null"]},"producerContentMismatch":{"type":["number","null"]},"writerMismatch":{"type":["number","null"]},"nullMetadata":{"type":["number","null"]},"xmpInfoMismatch":{"type":["number","null"]},"futureMetadataDate":{"type":["number","null"]},"rasterProfileMismatch":{"type":["number","null"]},"uncompressedRaster":{"type":["number","null"]},"splicedPage":{"type":["number","null"]},"splicedPageNumber":{"type":["number","null"]},"valueFontSplice":{"type":["number","null"]},"valueFontSplicePage":{"type":["number","null"]},"headlessDesktopRender":{"type":["number","null"]},"headlessRenderPlatform":{"type":["string","null"]},"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["fraudulentPdfCreator","textOverlay","fontMismatch","hasDigitalSignature","pdfModified","incrementalUpdates","incrementalChanges","incrementalEdits","signatureCreationTools","dateInversion","producerContentMismatch","writerMismatch","nullMetadata","xmpInfoMismatch","futureMetadataDate","rasterProfileMismatch","uncompressedRaster","splicedPage","splicedPageNumber","valueFontSplice","valueFontSplicePage","headlessDesktopRender","headlessRenderPlatform","doubleJpeg","firstQuantizationQuality","scrubbedProvenance","score"],"description":"Every key is always reported, so a check nothing could answer is null rather than missing."},{"type":"null"}]},"fraudulentImage":{"anyOf":[{"type":"object","properties":{"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"editorSignature":{"type":["number","null"]},"editorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"editorSignatureValue":{"type":["string","null"]},"generatorSignature":{"type":["number","null"]},"generatorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"generatorSignatureValue":{"type":["string","null"]},"generatorWriterProfile":{"type":["number","null"]},"generatorWriterProfileValue":{"type":["string","null"]},"syntheticRaster":{"type":["number","null"]},"syntheticRasterFingerprints":{"type":"array","items":{"type":"string"}},"unprofiledPng":{"type":["number","null"]},"unprofiledWebp":{"type":["number","null"]},"source":{"anyOf":[{"type":"string","enum":["original","render"]},{"type":"null"}]},"sourceFormats":{"type":"array","items":{"type":"string"}},"unreadableSource":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["doubleJpeg","firstQuantizationQuality","scrubbedProvenance","editorSignature","editorSignatureField","editorSignatureValue","generatorSignature","generatorSignatureField","generatorSignatureValue","generatorWriterProfile","generatorWriterProfileValue","syntheticRaster","syntheticRasterFingerprints","unprofiledPng","unprofiledWebp","source","sourceFormats","unreadableSource","score"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}]},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Value null means nothing could say: no pixel model runs, only metadata can answer."},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]}},"required":["index","isBlurry","isLcd","screenshot","aiGenerated","glare"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"reason":{"type":"string"}},"required":["check","reason"]},"description":"Checks that could not run on this file, so a clean result is not read as more than it is."}},"required":["version","score","color","types","details","attribution","decision","review","deviceId","submissions","deviceProfiles","digitalTamperingFields","handwriting","notADocument","digitalBackground","fraudulentPdf","fraudulentImage","pages","skipped"],"description":"Evidence for a reviewer. Null until inspected, and for a caller without expenses.read_all."},{"type":"null"}]},"sealed":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]},"masked":{"type":"string","description":"All but the last few characters are stars. Punctuation stays where it was."},"field":{"type":["string","null"]},"page":{"type":"number"}},"required":["kind","masked","field","page"]},"description":"Bank and tax numbers read from this document, as masks. POST /v1/documents/{id}/reveal opens them."},"updatedAt":{"type":"string"},"extractor":{"description":"What read it: rules, claude, a blueprint, business-card, or none.","type":["string","null"]},"ocrText":{"description":"Everything read off the page. Card, bank and tax numbers are masked.","type":["string","null"]},"pdfUrl":{"description":"The PDF as uploaded, signed for 15 minutes. Null for an image, and for a PDF that prints a number only a reveal hands out.","type":["string","null"]},"meta":{"type":"object","properties":{"totalPages":{"type":"number"},"processedPages":{"type":"number"},"ocrScore":{"description":"The average character confidence of the reading, which doubles as a measure of the image.","type":["number","null"]},"originalFileName":{"type":["string","null"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"language":{"description":"BCP-47.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]},"description":"Every language found, best first."},"deviceId":{"type":["string","null"]},"deviceUserUuid":{"description":"The signed-in person the device was capturing for. Null when no device was named.","type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"sourceDocuments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Each file as submitted: name, type, size in KB, width, height and EXIF."},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}],"description":"Who uploaded it."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."}},"required":["totalPages","processedPages","ocrScore","originalFileName","source","language","languages","deviceId","deviceUserUuid","latitude","longitude","sourceDocuments","owner","duplicates"]},"reviewedAt":{"description":"A person checked what was read.","type":["string","null"]},"approvedAt":{"description":"A developer's own approved flag. An expense's approval is a different thing.","type":["string","null"]},"reading":{"description":"Null when nothing has been read yet.","anyOf":[{"type":"object","properties":{"lines":{"description":"With bounding_boxes: every line read, with where it is.","type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"confidence":{"type":"number"},"box":{"description":"[x, y, width, height] in pixels of the page.","type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},"quad":{"description":"The four corners as x, y pairs, for a line read at an angle.","type":"array","items":{"type":"number"}},"page":{"type":"number"}},"required":["text","confidence","page"]}},"fieldDetail":{"description":"With confidence_details: where each field was read from and how sure the read was.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},{"type":"null"}]},"detailed":{"description":"With detailed: the reading with each field wrapped as value, score, ocrScore, rotation, boundingBox, boundingRegion and enriched."},"lineItemsWithScores":{"description":"With with_scores: the same lines, with a value and its confidence on every sub-field.","type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"taxLinesWithScores":{"description":"With with_scores: the same tax lines, with a value and its confidence on every sub-field.","type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["id","type","source","status","originalFilename","mimeType","sizeBytes","pageCount","externalId","folderId","expenseId","mailInBatchId","title","notes","latitude","longitude","locationAccuracyM","duplicateOfId","processingError","processingErrorCode","verification","capturedAt","processedAt","viewedAt","archivedAt","createdAt","uploadedBy","pages","classification","blueprint","tags","tagRefs","recordStatus","duplicates","setId","customFields","enrichment","extraction","fraud","sealed","updatedAt","extractor","ocrText","pdfUrl","meta","reviewedAt","approvedAt"]},"DocumentTagList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExpenseLine":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"type":["number","null"]},"amountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"categoryId":{"type":["string","null"]}},"required":["id","position","description","sku","quantity","unitPriceMinor","amountMinor","taxMinor","categoryId"]},"ExpenseLinePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"type":["number","null"]},"amountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"categoryId":{"type":["string","null"]}},"required":["id","position","description","sku","quantity","unitPriceMinor","amountMinor","taxMinor","categoryId"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExpenseTaxLine":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"name":{"type":["string","null"]},"code":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"baseMinor":{"type":["number","null"]},"amountMinor":{"type":"number"}},"required":["id","position","name","code","ratePct","baseMinor","amountMinor"]},"ExpenseTaxLinePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"name":{"type":["string","null"]},"code":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"baseMinor":{"type":["number","null"]},"amountMinor":{"type":"number"}},"required":["id","position","name","code","ratePct","baseMinor","amountMinor"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"WorkspaceClosed":{"type":"object","properties":{"status":{"type":"string","const":"closed"},"purgeAfter":{"type":"string","description":"Records are erased after this moment."},"storeSubscriptions":{"type":"array","items":{"type":"object","properties":{"workspaceId":{"type":"string"},"workspaceName":{"type":"string"},"store":{"type":"string","enum":["APP_STORE","PLAY_STORE"]}},"required":["workspaceId","workspaceName","store"]},"description":"Non-empty when a store goes on billing until someone cancels there."}},"required":["status","purgeAfter","storeSubscriptions"]},"ReferenceCurrencyPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"minorDigits":{"type":"number","description":"Decimal places in the minor unit: 2 for USD, 0 for JPY."}},"required":["code","name","minorDigits"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ReferenceCountryPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string","description":"The currency its receipts print."}},"required":["code","name","currency"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ReferenceLocalePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ReferenceSystemCategoryPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Stays when a workspace renames its copy."},"name":{"type":"string"},"glCode":{"type":["string","null"]},"taxLine":{"type":["string","null"]},"deductiblePct":{"type":"number"}},"required":["key","name","glCode","taxLine","deductiblePct"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"BulkReimbursed":{"type":"object","properties":{"reimbursed":{"type":"array","items":{"type":"string"}},"skipped":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":["string","null"]},"code":{"type":"string"},"message":{"type":"string"}},"required":["id","reference","code","message"]},"description":"Not in a state to mark: not approved yet, already paid, in a batch, or nothing on it is reimbursable. Left as it was."},"failed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":["string","null"]},"code":{"type":"string"},"message":{"type":"string"}},"required":["id","reference","code","message"]},"description":"Not found, or not the caller's to mark."}},"required":["reimbursed","skipped","failed"]},"DocumentList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"originalFilename":{"type":["string","null"]},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"pageCount":{"type":"number"},"externalId":{"type":["string","null"]},"folderId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"mailInBatchId":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"latitude":{"description":"Where the device said it was when the photo was taken.","type":["number","null"]},"longitude":{"type":["number","null"]},"locationAccuracyM":{"type":["number","null"]},"duplicateOfId":{"type":["string","null"]},"processingError":{"type":["string","null"]},"processingErrorCode":{"anyOf":[{"type":"string","enum":["FILE_ENCRYPTED"]},{"type":"null"}],"description":"Set when the failure is one the file's owner can fix. processingError says what to do."},"verification":{"type":"string"},"capturedAt":{"type":["string","null"]},"processedAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"uploadedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all."},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}],"description":"Null when the page is not one, and for a caller without expenses.read_all."},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all. Value null means nothing could say."},"language":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]}},"ocrScore":{"type":["number","null"]},"isFront":{"description":"A check: the front or the back.","type":["boolean","null"]},"tiffRejectScore":{"description":"A check: 0 is a clean clearing image and 1 is one a bank would send back.","type":["number","null"]},"tiffUpscaled":{"description":"A check: the photo was under 240 DPI, so the clearing image was enlarged.","type":["boolean","null"]}},"required":["index","url","thumbnailUrl","width","height","isBlurry","glare","isLcd","screenshot","aiGenerated","language","languages","ocrScore","isFront","tiffRejectScore","tiffUpscaled"]}},"classification":{"anyOf":[{"type":"object","properties":{"value":{"type":"string","description":"A document class, or one of the labels the caller named."},"score":{"type":"number","description":"0..1."},"engine":{"type":"string","enum":["rules","claude"]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["value","score","engine","scores"]},{"type":"null"}],"description":"What the classifier decided, when it was asked."},"blueprint":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"description":"Null for a built-in, which has no versions.","type":["number","null"]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The fields the blueprint defines. Null when the run failed."},"offsets":{"description":"Where each value sits in the text, for a blueprint that asks.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"begin":{"type":"number"},"end":{"type":"number"}},"required":["begin","end"]}},"unmatched":{"description":"Fields where a value was read and did not fit, such as words where a number belongs or a choice off the list. Each is left empty. An empty field not named here was not on the document.","type":"array","items":{"type":"string"}},"error":{"description":"Why the run gave nothing back.","type":["string","null"]}},"required":["name","version","result","error"]},{"type":"null"}],"description":"The blueprint this was read with, and what came out of it."},"tags":{"type":"array","items":{"type":"string"}},"tagRefs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The same tags with their ids, which a tag route takes."},"recordStatus":{"anyOf":[{"type":"string","enum":["processed","reviewed","archived"]},{"type":"null"}],"description":"Where a read document stands: reviewedAt and archivedAt in one word. Null until it has been read."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."},"setId":{"description":"The upload this came out of: a ZIP, a split PDF or a batch of addresses.","type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}],"description":"Values the workspace custom field rules read out of the text."},"enrichment":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","DONE","FAILED"]},"steps":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"failed":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}}},"required":["status","steps","failed"]},{"type":"null"}],"description":"Work still running after the first answer."},"extraction":{"anyOf":[{"type":"object","properties":{"fields":{"type":"object","properties":{"documentType":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"merchantName":{"type":["string","null"]},"merchantAddress":{"type":["string","null"]},"merchantPhone":{"type":["string","null"]},"merchantWebsite":{"type":["string","null"]},"merchantTaxId":{"type":["string","null"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"time":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG","CUC","HRK","SLL","ZWL","XDR","XSU"]},{"type":"null"}]},"currencyGuessed":{"default":false,"type":"boolean"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxLines":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"code":{"type":["string","null"]},"totalInclusive":{"type":["boolean","null"]}},"required":["amountMinor"]}},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"cardBrand":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"receiptNumber":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"poNumber":{"type":["string","null"]},"lineItems":{"default":[],"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"id":{"type":["string","null"]},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["room","tax","parking","service","fee","delivery","product","food","alcohol","tobacco","transportation","fuel","refund","discount","payment","giftcard","donation","toll","lottery"]},{"type":"null"}]},"fullDescription":{"type":["string","null"]},"normalizedDescription":{"type":["string","null"]},"section":{"type":["string","null"]},"reference":{"type":["string","null"]},"upc":{"type":["string","null"]},"hsn":{"type":["string","null"]},"lot":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unitOfMeasure":{"type":["string","null"]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountRatePct":{"type":["number","null"]},"discountPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxRatePct":{"type":["number","null"]},"taxCode":{"type":["string","null"]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"grossTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"netTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"category":{"type":["string","null"]},"customCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countryOfOrigin":{"type":["string","null"]},"manufacturer":{"type":["string","null"]},"weight":{"type":["string","null"]},"brand":{"type":["string","null"]},"hsaFsaEligible":{"type":["boolean","null"]},"productInfo":{"anyOf":[{"type":"object","properties":{"expandedDescription":{"type":["string","null"]},"brand":{"type":["string","null"]},"categoryPath":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},{"type":"null"}]}},"required":["description","amountMinor"]}},"suggestedCategory":{"type":["string","null"]},"documentTitle":{"type":["string","null"]},"documentReferenceNumber":{"type":["string","null"]},"isDocument":{"type":["boolean","null"]},"isTransaction":{"type":["boolean","null"]},"isMoneyIn":{"type":["boolean","null"]},"accountingEntryType":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}]},"vendor":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"vendors":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}}},{"type":"null"}]},"bankBreakdown":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}}},{"type":"null"}]},"billTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"vatNumber":{"type":["string","null"]},"regNumber":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"email":{"type":["string","null"]}}},{"type":"null"}]},"shipTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"insuranceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cashbackMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"roundingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"finalBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"previousBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"totalQuantity":{"type":["number","null"]},"totalWeight":{"type":["string","null"]},"payment":{"anyOf":[{"type":"object","properties":{"cardNumber":{"type":["string","null"]},"displayName":{"type":["string","null"]},"terms":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["none","visa","master_card","cash","american_express","interac","other","maestro","discover","bancontact","girocard","applepay","paypal","bancomat","giftcard","card","check","bankaxept","bank-to-bank_transfer_bacs","octopus","pix","jcb","waon","mada","wechat","alipay","unionpay","googlepay","rupay","bpay","shopeepay","mir","giropay","food_stamp","diners_club","paypay"]},{"type":"null"}]}}},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"shipDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliveryDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"exchangeRate":{"type":["number","null"]},"countryCode":{"type":["string","null"]},"deliveryNoteNumber":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"trackingNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"incoterms":{"type":["string","null"]},"weights":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"licensePlateNumber":{"type":["string","null"]},"vinNumber":{"type":["string","null"]},"guestCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"serverName":{"type":["string","null"]},"storeNumber":{"type":["string","null"]},"vendingPerson":{"type":["string","null"]},"vendingPersonNumber":{"type":["string","null"]},"customerAccountNumber":{"type":["string","null"]},"category":{"type":["string","null"]},"defaultCategory":{"type":["string","null"]},"barcodes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"type":{"type":"string","enum":["QR_CODE","PDF417","EAN_13","EAN_8","UPC_A","UPC_E","CODE_128","CODE_39","ITF","DATA_MATRIX","AZTEC","OTHER"]},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"boundingRegion":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]}},"required":["data","type","page"]}},{"type":"null"}]},"paymentLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string","enum":["text","hyperlink","qr_code","barcode"]}},"required":["url","source"]}},{"type":"null"}]},"folio":{"anyOf":[{"type":"object","properties":{"arrivalDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"departureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roomNumber":{"type":["string","null"]},"guestName":{"type":["string","null"]},"nights":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"confirmationNumber":{"type":["string","null"]}}},{"type":"null"}]},"enrichedFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"check":{"anyOf":[{"type":"object","properties":{"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountText":{"type":["string","null"]},"amountsAgree":{"type":["boolean","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"checkNumber":{"type":["string","null"]},"checkType":{"anyOf":[{"type":"string","enum":["bank_draft","bill_pay_draft","business_check","cashiers_check","government_check","money_order","personal_check","starter_check","teller_check"]},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"memo":{"type":["string","null"]},"payerName":{"type":["string","null"]},"payerAddress":{"type":["string","null"]},"receiverName":{"type":["string","null"]},"receiverAddress":{"type":["string","null"]},"isSigned":{"type":["boolean","null"]},"endorsement":{"anyOf":[{"type":"object","properties":{"isEndorsed":{"type":["boolean","null"]},"isSigned":{"type":["boolean","null"]},"mobileOrRemoteDeposit":{"anyOf":[{"type":"object","properties":{"checkbox":{"type":["boolean","null"]},"instructions":{"type":["boolean","null"]}}},{"type":"null"}]},"isMobileOrRemoteDepositOnly":{"type":["boolean","null"]}}},{"type":"null"}]},"micr":{"anyOf":[{"type":"object","properties":{"routingNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"serialNumber":{"type":["string","null"]},"raw":{"type":["string","null"]},"branch":{"type":["string","null"]},"institution":{"type":["string","null"]},"transactionCode":{"type":["string","null"]}}},{"type":"null"}]},"fractionalRoutingNumber":{"type":["string","null"]},"routingFromFractional":{"type":["string","null"]},"voidTerms":{"type":["string","null"]}}},{"type":"null"}]},"statement":{"anyOf":[{"type":"object","properties":{"accountHolderName":{"type":["string","null"]},"accountHolderAddress":{"type":["string","null"]},"accountType":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"bankWebsite":{"type":["string","null"]},"bankVatNumber":{"type":["string","null"]},"accountVatNumber":{"type":["string","null"]},"periodStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementNumber":{"type":["string","null"]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"minimumDueMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"routingNumber":{"type":["string","null"]},"swift":{"type":["string","null"]},"iban":{"type":["string","null"]},"accounts":{"default":[],"type":"array","items":{"type":"object","properties":{"number":{"type":["string","null"]},"ibanNumber":{"type":["string","null"]},"accountType":{"type":["string","null"]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"summaries":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["name"]}},"transactions":{"default":[],"type":"array","items":{"type":"object","properties":{"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"postedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"vendor":{"type":["string","null"]},"transactionId":{"type":["string","null"]},"debitAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"creditAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cardNumber":{"type":["string","null"]},"text":{"type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["order"]}}}}},"balancesAgree":{"type":["boolean","null"]}}},{"type":"null"}]},"taxForm":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["W2","W9","W8BEN_E"]},"w2":{"anyOf":[{"type":"object","properties":{"employeeSsn":{"type":["string","null"]},"ein":{"type":["string","null"]},"employerName":{"type":["string","null"]},"employerAddress":{"type":["string","null"]},"controlNumber":{"type":["string","null"]},"employeeName":{"type":["string","null"]},"employeeAddress":{"type":["string","null"]},"wagesOtherComps":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"federalIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"allocatedTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"advanceEicPayment":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dependentCareBenefits":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"nonQualifiedPlans":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"box12":{"default":[],"type":"array","items":{"type":"object","properties":{"box":{"type":"string"},"code":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["box","code"]}},"is13a":{"type":["boolean","null"]},"is13b":{"type":["boolean","null"]},"is13c":{"type":["boolean","null"]},"box14Other":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["label"]}},"stateLines":{"default":[],"type":"array","items":{"type":"object","properties":{"state":{"type":["string","null"]},"employerStateId":{"type":["string","null"]},"stateWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"stateIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localityName":{"type":["string","null"]}}}},"taxYear":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"w9":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"businessName":{"type":["string","null"]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"individual":{"type":["boolean","null"]},"cCorp":{"type":["boolean","null"]},"sCorp":{"type":["boolean","null"]},"partnership":{"type":["boolean","null"]},"trustEstate":{"type":["boolean","null"]},"llc":{"type":["boolean","null"]},"llcType":{"type":["string","null"]},"other":{"type":["boolean","null"]},"otherDescription":{"type":["string","null"]},"exemptPayeeCode":{"type":["string","null"]},"exemption":{"type":["string","null"]},"ssn":{"type":["string","null"]},"ein":{"type":["string","null"]},"accountNumbers":{"type":["string","null"]},"requester":{"type":["string","null"]},"signature":{"type":["boolean","null"]},"signatureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}},{"type":"null"}]},"w8BenE":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","boolean","null"]}},{"type":"null"}]}},"required":["kind"]},{"type":"null"}]},"itinerary":{"anyOf":[{"type":"object","properties":{"travelerName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"returnsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"segments":{"default":[],"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]}}}},{"type":"null"}]},"fieldConfidence":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fieldBoxes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"page":{"type":"number"},"box":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4}},"required":["page","box"]}}},"description":"What was read, as the extraction contract types it. fieldConfidence holds per-field confidence, 0..1."},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["tax_rate_mismatch","item_counts_mismatch","totals_mismatch","line_item_amount_mismatch","line_item_repeats","barcode_decoding_issue","barcode_code_missing_in_ocr","logo_vendor_mismatch","malware","weekend_transaction","time_and_currency_mismatch","exif_creation_modified_date_mismatch","missing_date","suspicious_document_aspect_ratio","generic_placeholder_content"]},"message":{"type":"string"},"page":{"type":["number","null"]}},"required":["code","message"]},"description":"Integrity findings. A caller without expenses.read_all sees the arithmetic and dates only."}},"required":["fields","confidence","flags","warnings"]},{"type":"null"}]},"fraud":{"anyOf":[{"type":"object","properties":{"version":{"type":"string"},"score":{"type":"number","description":"0 to 1, from the signals that fired. Evidence, never a verdict."},"color":{"type":"string","enum":["green","yellow","red"],"description":"Under the workspace yellow threshold is green. Over its red threshold is red."},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"description":"Signals that fired, most important first."},"details":{"type":"object","propertyNames":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"additionalProperties":{"type":"object","properties":{"description":{"type":"string"},"confidence":{"type":"number","description":"How sure the detector is of what it saw, 0 to 1. Not how likely fraud is."},"reasons":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Stable."},"description":{"type":"string","description":"Written for a person."},"field":{"description":"Where it was read: exif:Software, totalMinor.","type":["string","null"]},"value":{"type":["string","null"]},"page":{"description":"Zero-based.","type":["number","null"]},"score":{"type":["number","null"]},"box":{"description":"Where on the page, as fractions of its size: x, y, width, height.","anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]}},"required":["name","description"]}}},"required":["description","confidence","reasons"]},"description":"By signal: a description, a confidence and typed reasons."},"attribution":{"description":"One sentence naming the strongest evidence.","type":["string","null"]},"decision":{"type":"string","enum":["clear","review","fraud","not_fraud","unknown"],"description":"clear or review until a person decides. Only a person can say fraud."},"review":{"anyOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["FRAUD","NOT_FRAUD","UNKNOWN"]},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},"note":{"type":["string","null"]},"reviewedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"reviewedAt":{"type":"string"}},"required":["decision","types","note","reviewedBy","reviewedAt"]},{"type":"null"}]},"deviceId":{"description":"The id the client sent for its device, when it sent one.","type":["string","null"]},"submissions":{"anyOf":[{"type":"object","properties":{"lastMinutes":{"type":"number"},"lastDay":{"type":"number"},"lastWeek":{"type":"number"},"last2Weeks":{"type":"number"},"lastMonth":{"type":"number"}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]},{"type":"null"}],"description":"Documents from this uploader in this workspace, by window."},"deviceProfiles":{"type":"array","items":{"type":"object","properties":{"deviceId":{"type":"string"},"profileId":{"type":"string"},"documentCount":{"type":"number"}},"required":["deviceId","profileId","documentCount"]},"description":"Over 30 days, inside this workspace only."},"digitalTamperingFields":{"type":"array","items":{"type":"string"}},"handwriting":{"type":"object","properties":{"handwrittenFields":{"type":"array","items":{"type":"string"}},"fullyHandwrittenFields":{"type":"array","items":{"type":"string"}},"handwrittenTamperedFields":{"type":"array","items":{"type":"string"}},"handwritingDetected":{"type":["boolean","null"]},"handwritingTamperingPresent":{"type":["boolean","null"]}},"required":["handwrittenFields","fullyHandwrittenFields","handwrittenTamperedFields","handwritingDetected","handwritingTamperingPresent"],"description":"What Claude saw written by hand, in dot notation, when a key is set and the handwriting signal is on. With no key, the lists are empty and the flags null: skipped says why."},"notADocument":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"digitalBackground":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"fraudulentPdf":{"anyOf":[{"type":"object","properties":{"fraudulentPdfCreator":{"type":["number","null"]},"textOverlay":{"type":["number","null"]},"fontMismatch":{"type":["number","null"]},"hasDigitalSignature":{"type":["boolean","null"]},"pdfModified":{"type":["number","null"]},"incrementalUpdates":{"type":["number","null"]},"incrementalChanges":{"type":"array","items":{"type":"string"}},"incrementalEdits":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["page","before","after"]}},"signatureCreationTools":{"type":"array","items":{"type":"string"}},"dateInversion":{"type":["number","null"]},"producerContentMismatch":{"type":["number","null"]},"writerMismatch":{"type":["number","null"]},"nullMetadata":{"type":["number","null"]},"xmpInfoMismatch":{"type":["number","null"]},"futureMetadataDate":{"type":["number","null"]},"rasterProfileMismatch":{"type":["number","null"]},"uncompressedRaster":{"type":["number","null"]},"splicedPage":{"type":["number","null"]},"splicedPageNumber":{"type":["number","null"]},"valueFontSplice":{"type":["number","null"]},"valueFontSplicePage":{"type":["number","null"]},"headlessDesktopRender":{"type":["number","null"]},"headlessRenderPlatform":{"type":["string","null"]},"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["fraudulentPdfCreator","textOverlay","fontMismatch","hasDigitalSignature","pdfModified","incrementalUpdates","incrementalChanges","incrementalEdits","signatureCreationTools","dateInversion","producerContentMismatch","writerMismatch","nullMetadata","xmpInfoMismatch","futureMetadataDate","rasterProfileMismatch","uncompressedRaster","splicedPage","splicedPageNumber","valueFontSplice","valueFontSplicePage","headlessDesktopRender","headlessRenderPlatform","doubleJpeg","firstQuantizationQuality","scrubbedProvenance","score"],"description":"Every key is always reported, so a check nothing could answer is null rather than missing."},{"type":"null"}]},"fraudulentImage":{"anyOf":[{"type":"object","properties":{"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"editorSignature":{"type":["number","null"]},"editorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"editorSignatureValue":{"type":["string","null"]},"generatorSignature":{"type":["number","null"]},"generatorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"generatorSignatureValue":{"type":["string","null"]},"generatorWriterProfile":{"type":["number","null"]},"generatorWriterProfileValue":{"type":["string","null"]},"syntheticRaster":{"type":["number","null"]},"syntheticRasterFingerprints":{"type":"array","items":{"type":"string"}},"unprofiledPng":{"type":["number","null"]},"unprofiledWebp":{"type":["number","null"]},"source":{"anyOf":[{"type":"string","enum":["original","render"]},{"type":"null"}]},"sourceFormats":{"type":"array","items":{"type":"string"}},"unreadableSource":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["doubleJpeg","firstQuantizationQuality","scrubbedProvenance","editorSignature","editorSignatureField","editorSignatureValue","generatorSignature","generatorSignatureField","generatorSignatureValue","generatorWriterProfile","generatorWriterProfileValue","syntheticRaster","syntheticRasterFingerprints","unprofiledPng","unprofiledWebp","source","sourceFormats","unreadableSource","score"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}]},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Value null means nothing could say: no pixel model runs, only metadata can answer."},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]}},"required":["index","isBlurry","isLcd","screenshot","aiGenerated","glare"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"reason":{"type":"string"}},"required":["check","reason"]},"description":"Checks that could not run on this file, so a clean result is not read as more than it is."}},"required":["version","score","color","types","details","attribution","decision","review","deviceId","submissions","deviceProfiles","digitalTamperingFields","handwriting","notADocument","digitalBackground","fraudulentPdf","fraudulentImage","pages","skipped"],"description":"Evidence for a reviewer. Null until inspected, and for a caller without expenses.read_all."},{"type":"null"}]},"sealed":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]},"masked":{"type":"string","description":"All but the last few characters are stars. Punctuation stays where it was."},"field":{"type":["string","null"]},"page":{"type":"number"}},"required":["kind","masked","field","page"]},"description":"Bank and tax numbers read from this document, as masks. POST /v1/documents/{id}/reveal opens them."},"updatedAt":{"type":"string"},"extractor":{"description":"What read it: rules, claude, a blueprint, business-card, or none.","type":["string","null"]},"ocrText":{"description":"Everything read off the page. Card, bank and tax numbers are masked.","type":["string","null"]},"pdfUrl":{"description":"The PDF as uploaded, signed for 15 minutes. Null for an image, and for a PDF that prints a number only a reveal hands out.","type":["string","null"]},"meta":{"type":"object","properties":{"totalPages":{"type":"number"},"processedPages":{"type":"number"},"ocrScore":{"description":"The average character confidence of the reading, which doubles as a measure of the image.","type":["number","null"]},"originalFileName":{"type":["string","null"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"language":{"description":"BCP-47.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]},"description":"Every language found, best first."},"deviceId":{"type":["string","null"]},"deviceUserUuid":{"description":"The signed-in person the device was capturing for. Null when no device was named.","type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"sourceDocuments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Each file as submitted: name, type, size in KB, width, height and EXIF."},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}],"description":"Who uploaded it."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."}},"required":["totalPages","processedPages","ocrScore","originalFileName","source","language","languages","deviceId","deviceUserUuid","latitude","longitude","sourceDocuments","owner","duplicates"]},"reviewedAt":{"description":"A person checked what was read.","type":["string","null"]},"approvedAt":{"description":"A developer's own approved flag. An expense's approval is a different thing.","type":["string","null"]}},"required":["id","type","source","status","originalFilename","mimeType","sizeBytes","pageCount","externalId","folderId","expenseId","mailInBatchId","title","notes","latitude","longitude","locationAccuracyM","duplicateOfId","processingError","processingErrorCode","verification","capturedAt","processedAt","viewedAt","archivedAt","createdAt","uploadedBy","pages","classification","blueprint","tags","tagRefs","recordStatus","duplicates","setId","customFields","enrichment","extraction","fraud","sealed","updatedAt","extractor","ocrText","pdfUrl","meta","reviewedAt","approvedAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]},"offset":{"description":"Where this page starts, when paging by offset or page.","type":"number"},"nextOffset":{"description":"Send this as `offset` for the next page. Null on the last one.","type":["number","null"]},"page":{"description":"When paging by page number.","type":"number"},"pageSize":{"type":"number"},"totalCount":{"description":"With track_total_results: every document the caller can reach.","type":"number"},"filteredCount":{"description":"With track_total_results: what the filters leave of those.","type":"number"}},"required":["data","nextCursor"]},"ProvisionResult":{"type":"object","properties":{"dryRun":{"type":"boolean"},"added":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"invited":{"type":"boolean"}},"required":["email","invited"]}},"updated":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"fields":{"type":"array","items":{"type":"string"}}},"required":["email","fields"]}},"removed":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string"}},"required":["email","reason"]}}},"required":["dryRun","added","updated","removed","skipped"]},"AutomationApply":{"type":"object","properties":{"matched":{"type":"number"},"updated":{"type":"number"}},"required":["matched","updated"]},"AutomationPreview":{"type":"object","properties":{"matched":{"type":"number","description":"Expenses the conditions match, voided ones aside."},"applicable":{"type":"number","description":"Of those, the ones still unsubmitted, which is what applying the rule changes."},"sample":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"currency":{"type":"string"},"amountMinor":{"type":"number"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","currency","amountMinor","status"]}},"aiSkipped":{"type":"boolean","description":"A question for Claude was left out of this count: it is asked when a document is read, not here."}},"required":["matched","applicable","sample","aiSkipped"]},"AutomationRule":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"position":{"type":"number"},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}},"actions":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"vendorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"reportId":{"type":"string","minLength":1},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}}}},"matchCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","enabled","position","conditions","actions","matchCount","createdAt","updatedAt"]},"AutomationRuleOrder":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"position":{"type":"number"},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}},"actions":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"vendorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"reportId":{"type":"string","minLength":1},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}}}},"matchCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","enabled","position","conditions","actions","matchCount","createdAt","updatedAt"]}}},"required":["data"]},"AutomationRuleList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"position":{"type":"number"},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}},"actions":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"vendorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"reportId":{"type":"string","minLength":1},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}}}},"matchCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","enabled","position","conditions","actions","matchCount","createdAt","updatedAt"]}},"aiAvailable":{"type":"boolean","description":"Whether a question for Claude can be asked right now. When it cannot, each rule that needs one takes its fallback."}},"required":["data","aiAvailable"]},"Billing":{"type":"object","properties":{"plan":{"anyOf":[{"type":"string","enum":["STARTER","PRO","BUSINESS"]},{"type":"null"}]},"status":{"type":"string","enum":["TRIALING","ACTIVE","PAST_DUE","EXPIRED","NONE"]},"source":{"anyOf":[{"type":"string","enum":["STRIPE","APP_STORE","PLAY_STORE","TRIAL","COMP"]},{"type":"null"}]},"active":{"type":"boolean"},"interval":{"anyOf":[{"type":"string","enum":["MONTH","YEAR"]},{"type":"null"}]},"seats":{"type":"number","description":"Seats the workspace holds."},"seatsUsed":{"type":"number","description":"Members now plus open invitations, which hold a seat each. Above `seats` after a downgrade."},"seatsIncluded":{"type":["number","null"]},"maxSeats":{"description":"Null is unlimited, or no plan.","type":["number","null"]},"trialEndsAt":{"type":["string","null"]},"currentPeriodEnd":{"type":["string","null"]},"cancelAtPeriodEnd":{"type":"boolean"},"storeManaged":{"type":"boolean","description":"A live App Store or Google Play subscription owns this workspace, so the web cannot sell to it."},"store":{"anyOf":[{"type":"string","enum":["APP_STORE","PLAY_STORE"]},{"type":"null"}]},"hasStripeSubscription":{"type":"boolean"},"canOpenPortal":{"type":"boolean"},"usage":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","enum":["scans","api_documents"]},"used":{"type":"number"},"limit":{"type":"number"}},"required":["metric","used","limit"]},"description":"The plan's counters for this month."},"stripeConfigured":{"type":"boolean"},"cashsdkConfigured":{"type":"boolean"}},"required":["plan","status","source","active","interval","seats","seatsUsed","seatsIncluded","maxSeats","trialEndsAt","currentPeriodEnd","cancelAtPeriodEnd","storeManaged","store","hasStripeSubscription","canOpenPortal","usage","stripeConfigured","cashsdkConfigured"]},"BulkMemberResult":{"type":"object","properties":{"succeeded":{"type":"array","items":{"type":"string"}},"failed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"message":{"type":"string"}},"required":["id","message"]},"description":"Members the rules refused. They stay as they were, and the rest still change."}},"required":["succeeded","failed"]},"CardStatements":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"open":{"type":"boolean","description":"True for the period still open today."},"count":{"type":"number"},"spentMinor":{"type":"number"},"creditedMinor":{"type":"number"},"netMinor":{"type":"number"},"currency":{"type":"string"}},"required":["from","to","open","count","spentMinor","creditedMinor","netMinor","currency"]}},"IntegrationHealth":{"type":"object","properties":{"provider":{"type":"string","enum":["QUICKBOOKS_ONLINE","XERO","FRESHBOOKS","WAVE","ZOHO_BOOKS","SAGE","NETSUITE","GUSTO","GOOGLE_DRIVE","DROPBOX","BOX","ONEDRIVE","GMAIL","SLACK","ZAPIER","QUICKBOOKS_DESKTOP","INTUIT_ENTERPRISE","CAMPFIRE","DUALENTRY","RILLET","ACCELO","CERTINIA","SAGE_BUSINESS_CLOUD","SAASU","BAMBOOHR","HIBOB","WORKDAY","GOOGLE_WORKSPACE","GREENHOUSE","EVERNOTE","QUICKBOOKS_TIME","RIGHTSIGNATURE","HR_SYNC","BILL_COM","SAP_CONCUR","MICROSOFT_DYNAMICS","MYOB","ORACLE","SAP_ERP"]},"slug":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["CONNECTED","NEEDS_ATTENTION","DISCONNECTED"]},"organisationName":{"type":["string","null"]},"synced":{"type":"number"},"pending":{"type":"number"},"failed":{"type":"number"},"skipped":{"type":"number"},"voided":{"type":"number"},"waiting":{"type":"number","description":"Approved expenses with no record yet."},"lastSyncedAt":{"type":["string","null"]},"tokenExpiresAt":{"type":["string","null"]},"refreshTokenExpiresAt":{"type":["string","null"]},"endsOnDate":{"type":"boolean"},"pausedUntil":{"type":["string","null"]},"pulledAt":{"type":["string","null"]},"postingPaused":{"anyOf":[{"type":"object","properties":{"since":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["since","code","message"]},{"type":"null"}]}},"required":["provider","slug","name","status","organisationName","synced","pending","failed","skipped","voided","waiting","lastSyncedAt","tokenExpiresAt","refreshTokenExpiresAt","pausedUntil","pulledAt"]},"IntegrationList":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["QUICKBOOKS_ONLINE","XERO","FRESHBOOKS","WAVE","ZOHO_BOOKS","SAGE","NETSUITE","GUSTO","GOOGLE_DRIVE","DROPBOX","BOX","ONEDRIVE","GMAIL","SLACK","ZAPIER","QUICKBOOKS_DESKTOP","INTUIT_ENTERPRISE","CAMPFIRE","DUALENTRY","RILLET","ACCELO","CERTINIA","SAGE_BUSINESS_CLOUD","SAASU","BAMBOOHR","HIBOB","WORKDAY","GOOGLE_WORKSPACE","GREENHOUSE","EVERNOTE","QUICKBOOKS_TIME","RIGHTSIGNATURE","HR_SYNC","BILL_COM","SAP_CONCUR","MICROSOFT_DYNAMICS","MYOB","ORACLE","SAP_ERP"]},"slug":{"type":"string"},"name":{"type":"string"},"group":{"type":"string","enum":["ACCOUNTING","PAYROLL","HR","CAPTURE","STORAGE","CHAT","AUTOMATION"]},"availability":{"type":"string","enum":["NOT_CONFIGURED","AVAILABLE","CONNECTED","NEEDS_ATTENTION","EXPORT_AVAILABLE","NOT_CONNECTED"]},"label":{"type":"string","description":"The short status, as printed on the card."},"description":{"type":"string"},"export":{"anyOf":[{"type":"object","properties":{"format":{"type":"string","enum":["CSV","XLSX","PDF","ZIP","QBO_CSV","XERO_CSV","SAGE_CSV","DYNAMICS_CSV","MYOB_TXT","ORACLE_CSV","SAP_CSV","IIF","OFX","JSON","XML","TXT","XLS"]},"label":{"type":"string"},"payroll":{"type":"boolean"}},"required":["format","label"]},{"type":"null"}],"description":"The file that works today, with this provider or without it."},"organisationName":{"type":["string","null"]},"organisationChoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"lastSyncedAt":{"type":["string","null"]},"lastError":{"type":["string","null"]},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"href":{"type":"string"}},"required":["label","href"]}},"customerApp":{"type":"boolean"},"blockedBy":{"type":"string"}},"required":["provider","slug","name","group","availability","label","description","export","organisationName","organisationChoices","lastSyncedAt","lastError","links"]}},"InvitationPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]},"status":{"type":"string","enum":["PENDING","EXPIRED","ACCEPTED","REVOKED"]},"invitedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"expiresAt":{"type":"string"},"acceptedAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","email","name","role","status","invitedBy","expiresAt","acceptedAt","revokedAt","createdAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"InvitationSent":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]},"status":{"type":"string","enum":["PENDING","EXPIRED","ACCEPTED","REVOKED"]},"invitedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"expiresAt":{"type":"string"},"acceptedAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"acceptUrl":{"type":"string","description":"The link the email carries. It works only for someone signed in with this address."}},"required":["id","email","name","role","status","invitedBy","expiresAt","acceptedAt","revokedAt","createdAt","acceptUrl"]},"MailInAllowance":{"type":"object","properties":{"period":{"type":"string","description":"YYYY-MM."},"limit":{"type":"number","description":"Documents a month on this plan."},"used":{"type":"number","description":"Held by this month's batches. It can pass the limit: paper that has arrived is scanned regardless."},"remaining":{"type":"number"},"included":{"type":"boolean","description":"False when the plan does not include mail-in at all."},"available":{"type":"boolean","description":"False until there is a mailroom to send paper to, whatever the plan says."},"mailroomAddress":{"description":"Where own-packaging paper goes. Null until a mailroom has one.","type":["string","null"]},"envelopes":{"type":"object","properties":{"week":{"type":"string","description":"2026-W44. A week starts on Monday, UTC."},"weekLimit":{"type":"number","description":"Envelopes a workspace can have sent in a week."},"used":{"type":"number"},"remaining":{"type":"number","description":"Envelopes that can still be requested this week."}},"required":["week","weekLimit","used","remaining"]}},"required":["period","limit","used","remaining","included","available","mailroomAddress","envelopes"]},"MailInSettings":{"type":"object","properties":{"address":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]},{"type":"null"}]},"updatedAt":{"type":["string","null"]}},"required":["address","updatedAt"]},"MailInBatch":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string","description":"Printed on the packing slip and on the cover sheet."},"workspaceReference":{"type":"string"},"status":{"type":"string","enum":["REQUESTED","ENVELOPE_SENT","IN_TRANSIT","RECEIVED","SCANNING","COMPLETED","RETURNED","LOST","CANCELLED"]},"envelopes":{"type":"number"},"expectedDocuments":{"type":"number"},"documentCount":{"type":"number"},"afterScan":{"type":"string","enum":["RETURN","SHRED"]},"shippingAddress":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]},"folderId":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"notes":{"type":["string","null"]},"requestedById":{"type":"string"},"requestedByName":{"description":"Who this paper belongs to, as printed on the slip and the cover sheet.","type":["string","null"]},"requestedByEmail":{"type":["string","null"]},"envelopeSentAt":{"type":["string","null"]},"receivedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","reference","workspaceReference","status","envelopes","expectedDocuments","documentCount","afterScan","shippingAddress","folderId","trackingNumber","notes","requestedById","requestedByName","requestedByEmail","envelopeSentAt","receivedAt","completedAt","createdAt","updatedAt"]},"MailInBatchPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string","description":"Printed on the packing slip and on the cover sheet."},"workspaceReference":{"type":"string"},"status":{"type":"string","enum":["REQUESTED","ENVELOPE_SENT","IN_TRANSIT","RECEIVED","SCANNING","COMPLETED","RETURNED","LOST","CANCELLED"]},"envelopes":{"type":"number"},"expectedDocuments":{"type":"number"},"documentCount":{"type":"number"},"afterScan":{"type":"string","enum":["RETURN","SHRED"]},"shippingAddress":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]},"folderId":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"notes":{"type":["string","null"]},"requestedById":{"type":"string"},"requestedByName":{"description":"Who this paper belongs to, as printed on the slip and the cover sheet.","type":["string","null"]},"requestedByEmail":{"type":["string","null"]},"envelopeSentAt":{"type":["string","null"]},"receivedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","reference","workspaceReference","status","envelopes","expectedDocuments","documentCount","afterScan","shippingAddress","folderId","trackingNumber","notes","requestedById","requestedByName","requestedByEmail","envelopeSentAt","receivedAt","completedAt","createdAt","updatedAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"MailInRequested":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string","description":"Printed on the packing slip and on the cover sheet."},"workspaceReference":{"type":"string"},"status":{"type":"string","enum":["REQUESTED","ENVELOPE_SENT","IN_TRANSIT","RECEIVED","SCANNING","COMPLETED","RETURNED","LOST","CANCELLED"]},"envelopes":{"type":"number"},"expectedDocuments":{"type":"number"},"documentCount":{"type":"number"},"afterScan":{"type":"string","enum":["RETURN","SHRED"]},"shippingAddress":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]},"folderId":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"notes":{"type":["string","null"]},"requestedById":{"type":"string"},"requestedByName":{"description":"Who this paper belongs to, as printed on the slip and the cover sheet.","type":["string","null"]},"requestedByEmail":{"type":["string","null"]},"envelopeSentAt":{"type":["string","null"]},"receivedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"envelopeAllowance":{"type":"object","properties":{"week":{"type":"string","description":"2026-W44. A week starts on Monday, UTC."},"weekLimit":{"type":"number","description":"Envelopes a workspace can have sent in a week."},"used":{"type":"number"},"remaining":{"type":"number","description":"Envelopes that can still be requested this week."}},"required":["week","weekLimit","used","remaining"]}},"required":["id","reference","workspaceReference","status","envelopes","expectedDocuments","documentCount","afterScan","shippingAddress","folderId","trackingNumber","notes","requestedById","requestedByName","requestedByEmail","envelopeSentAt","receivedAt","completedAt","createdAt","updatedAt","envelopeAllowance"]},"MailInDocumentPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"originalFilename":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","type","status","originalFilename","thumbnailUrl","createdAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Member":{"type":"object","properties":{"id":{"type":"string","description":"The membership: the id PATCH and DELETE /v1/members/:id take."},"userId":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"pronouns":{"type":["string","null"]},"personStatus":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"clearsAt":{"type":["string","null"]}},"required":["text","clearsAt"]},{"type":"null"}],"description":"The note they set beside their name, until it clears. `status` is their membership."},"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]},"status":{"type":"string","enum":["ACTIVE","SUSPENDED"]},"developer":{"type":"boolean","description":"Whether this person can reach API keys and webhooks: always for an owner, and for an admin only with the grant. False unless the caller has members.manage."},"managerId":{"description":"The manager's user id.","type":["string","null"]},"managerName":{"type":["string","null"]},"title":{"type":["string","null"]},"department":{"type":["string","null"]},"employeeId":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"approvalLimitMinor":{"description":"Null unless the caller has members.manage.","type":["number","null"]},"overLimitApproverId":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"forwardToId":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"workerStatus":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"defaultTags":{"type":"array","items":{"type":"string"},"description":"Empty unless the caller has members.manage."},"customField1":{"type":["string","null"]},"customField2":{"type":["string","null"]},"payrollCode":{"description":"Goes out with payroll files. Null unless the caller manages members.","type":["string","null"]},"legalEntity":{"description":"The company the person is employed by. Null unless the caller manages members.","type":["string","null"]},"tier":{"description":"Their travel tier. Null unless the caller manages members.","type":["string","null"]},"officeLocation":{"description":"The office they work from. Null unless the caller manages members.","type":["string","null"]},"costCenter":{"description":"Where their costs are charged. Null unless the caller manages members.","type":["string","null"]},"accountingCode":{"description":"Their code in the books. Null unless the caller manages members.","type":["string","null"]},"workerType":{"description":"Employee, contractor or the like. Null unless the caller manages members.","type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","userId","email","name","photoUrl","pronouns","personStatus","role","status","developer","managerId","managerName","title","department","employeeId","approvalLimitMinor","overLimitApproverId","forwardToId","workerStatus","defaultTags","customField1","customField2","payrollCode","legalEntity","tier","officeLocation","costCenter","accountingCode","workerType","createdAt"]},"MemberPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The membership: the id PATCH and DELETE /v1/members/:id take."},"userId":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"pronouns":{"type":["string","null"]},"personStatus":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"clearsAt":{"type":["string","null"]}},"required":["text","clearsAt"]},{"type":"null"}],"description":"The note they set beside their name, until it clears. `status` is their membership."},"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]},"status":{"type":"string","enum":["ACTIVE","SUSPENDED"]},"developer":{"type":"boolean","description":"Whether this person can reach API keys and webhooks: always for an owner, and for an admin only with the grant. False unless the caller has members.manage."},"managerId":{"description":"The manager's user id.","type":["string","null"]},"managerName":{"type":["string","null"]},"title":{"type":["string","null"]},"department":{"type":["string","null"]},"employeeId":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"approvalLimitMinor":{"description":"Null unless the caller has members.manage.","type":["number","null"]},"overLimitApproverId":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"forwardToId":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"workerStatus":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"defaultTags":{"type":"array","items":{"type":"string"},"description":"Empty unless the caller has members.manage."},"customField1":{"type":["string","null"]},"customField2":{"type":["string","null"]},"payrollCode":{"description":"Goes out with payroll files. Null unless the caller manages members.","type":["string","null"]},"legalEntity":{"description":"The company the person is employed by. Null unless the caller manages members.","type":["string","null"]},"tier":{"description":"Their travel tier. Null unless the caller manages members.","type":["string","null"]},"officeLocation":{"description":"The office they work from. Null unless the caller manages members.","type":["string","null"]},"costCenter":{"description":"Where their costs are charged. Null unless the caller manages members.","type":["string","null"]},"accountingCode":{"description":"Their code in the books. Null unless the caller manages members.","type":["string","null"]},"workerType":{"description":"Employee, contractor or the like. Null unless the caller manages members.","type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","userId","email","name","photoUrl","pronouns","personStatus","role","status","developer","managerId","managerName","title","department","employeeId","approvalLimitMinor","overLimitApproverId","forwardToId","workerStatus","defaultTags","customField1","customField2","payrollCode","legalEntity","tier","officeLocation","costCenter","accountingCode","workerType","createdAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"PaymentAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["CREDIT_CARD","DEBIT_CARD","BANK_ACCOUNT","CASH"]},"brand":{"type":["string","null"]},"last4":{"type":["string","null"]},"isCompany":{"type":"boolean"},"feedSource":{"type":"string","enum":["MANUAL","FILE_IMPORT","PLAID"]},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}]},"institutionName":{"type":["string","null"]},"archived":{"type":"boolean"},"transactionCount":{"type":"number"},"unmatchedCount":{"type":"number"},"lastPostedDate":{"type":["string","null"]},"lastImportedAt":{"description":"When a line last arrived, from a file or the bank.","type":["string","null"]},"transactionStartDate":{"type":["string","null"]},"statementCloseDay":{"type":["number","null"]},"liability":{"type":"string","enum":["PERSONAL","CORPORATE"]},"reimbursable":{"type":["boolean","null"]},"allowDeletingTransactions":{"type":"boolean"},"glAccount":{"type":["string","null"]},"createExpenses":{"type":"boolean"},"assigneeEmail":{"description":"Invited and not yet in: the card is theirs when they join.","type":["string","null"]},"balance":{"anyOf":[{"type":"object","properties":{"currentMinor":{"type":["number","null"]},"limitMinor":{"type":["number","null"]},"remainingMinor":{"type":["number","null"]},"currency":{"type":"string"},"asOf":{"type":"string"}},"required":["currentMinor","limitMinor","remainingMinor","currency","asOf"]},{"type":"null"}],"description":"What the bank last reported, when it reports these at all."},"createdAt":{"type":"string"}},"required":["id","name","kind","brand","last4","isCompany","feedSource","owner","institutionName","archived","transactionCount","unmatchedCount","lastPostedDate","lastImportedAt","transactionStartDate","statementCloseDay","liability","reimbursable","allowDeletingTransactions","glAccount","createExpenses","assigneeEmail","balance","createdAt"]},"PaymentAccountPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["CREDIT_CARD","DEBIT_CARD","BANK_ACCOUNT","CASH"]},"brand":{"type":["string","null"]},"last4":{"type":["string","null"]},"isCompany":{"type":"boolean"},"feedSource":{"type":"string","enum":["MANUAL","FILE_IMPORT","PLAID"]},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}]},"institutionName":{"type":["string","null"]},"archived":{"type":"boolean"},"transactionCount":{"type":"number"},"unmatchedCount":{"type":"number"},"lastPostedDate":{"type":["string","null"]},"lastImportedAt":{"description":"When a line last arrived, from a file or the bank.","type":["string","null"]},"transactionStartDate":{"type":["string","null"]},"statementCloseDay":{"type":["number","null"]},"liability":{"type":"string","enum":["PERSONAL","CORPORATE"]},"reimbursable":{"type":["boolean","null"]},"allowDeletingTransactions":{"type":"boolean"},"glAccount":{"type":["string","null"]},"createExpenses":{"type":"boolean"},"assigneeEmail":{"description":"Invited and not yet in: the card is theirs when they join.","type":["string","null"]},"balance":{"anyOf":[{"type":"object","properties":{"currentMinor":{"type":["number","null"]},"limitMinor":{"type":["number","null"]},"remainingMinor":{"type":["number","null"]},"currency":{"type":"string"},"asOf":{"type":"string"}},"required":["currentMinor","limitMinor","remainingMinor","currency","asOf"]},{"type":"null"}],"description":"What the bank last reported, when it reports these at all."},"createdAt":{"type":"string"}},"required":["id","name","kind","brand","last4","isCompany","feedSource","owner","institutionName","archived","transactionCount","unmatchedCount","lastPostedDate","lastImportedAt","transactionStartDate","statementCloseDay","liability","reimbursable","allowDeletingTransactions","glAccount","createExpenses","assigneeEmail","balance","createdAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Reconciliation":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"currency":{"type":"string","description":"What every figure here is in. Ask for another with currency."},"currencies":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"count":{"type":"number"},"netMinor":{"type":"number"}},"required":["currency","count","netMinor"]},"description":"Every currency posted in these dates, each with its own count and net."},"importedMinor":{"type":"number","description":"What to hold against the card statement."},"importedCount":{"type":"number"},"approvedMinor":{"type":"number","description":"What to hold against the liability account."},"approvedCount":{"type":"number"},"unapprovedMinor":{"type":"number","description":"What is left to accrue at month end, by where it is stuck."},"unapprovedCount":{"type":"number"},"pendingMinor":{"type":"number","description":"Charges the bank has not posted, which are on no statement yet."},"buckets":{"type":"object","properties":{"unreported":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]},"draft":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]},"outstanding":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]},"deleted":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]},"noExpense":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]},"ignored":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]}},"required":["unreported","draft","outstanding","deleted","noExpense","ignored"]},"cards":{"type":"array","items":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"count":{"type":"number"},"importedMinor":{"type":"number"},"unapprovedMinor":{"type":"number"},"duplicates":{"type":"array","items":{"type":"object","properties":{"postedDate":{"type":"string"},"amountMinor":{"type":"number"},"description":{"type":"string"},"count":{"type":"number"}},"required":["postedDate","amountMinor","description","count"]}}},"required":["account","count","importedMinor","unapprovedMinor","duplicates"]}}},"required":["from","to","currency","currencies","importedMinor","importedCount","approvedMinor","approvedCount","unapprovedMinor","unapprovedCount","pendingMinor","buckets","cards"]},"ReportField":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["TEXT","DATE","LIST","FORMULA"]},"options":{"type":"array","items":{"type":"string"}},"formula":{"type":["string","null"]},"required":{"type":"boolean"},"enabled":{"type":"boolean"},"position":{"type":"number"},"disabledOptions":{"description":"List values turned off: kept on reports that hold them, and not offered for new ones.","type":"array","items":{"type":"string"}},"imported":{"description":"Came from the connected books, so it cannot be deleted and its values only turn on and off.","type":"boolean"}},"required":["id","name","type","options","formula","required","enabled","position"]},"ReportFieldList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["TEXT","DATE","LIST","FORMULA"]},"options":{"type":"array","items":{"type":"string"}},"formula":{"type":["string","null"]},"required":{"type":"boolean"},"enabled":{"type":"boolean"},"position":{"type":"number"},"disabledOptions":{"description":"List values turned off: kept on reports that hold them, and not offered for new ones.","type":"array","items":{"type":"string"}},"imported":{"description":"Came from the connected books, so it cannot be deleted and its values only turn on and off.","type":"boolean"}},"required":["id","name","type","options","formula","required","enabled","position"]}}},"required":["data"]},"ReportFieldsOff":{"type":"object","properties":{"deleted":{"type":"number","description":"Fields removed. Lists take work to build, so they are kept."},"disabled":{"type":"number","description":"Lists turned off and kept."}},"required":["deleted","disabled"]},"SeatUsage":{"type":"object","properties":{"active":{"type":"number"},"invited":{"type":"number","description":"Open invitations hold a seat until they are accepted, revoked or expire."},"included":{"type":["number","null"]},"paid":{"description":"Seats the workspace holds, which is what stops an invitation. Null with no plan.","type":["number","null"]},"max":{"description":"The most seats this plan can hold. Null is unlimited.","type":["number","null"]},"full":{"anyOf":[{"type":"object","properties":{"metric":{"type":"string","const":"seats"},"limit":{"type":"number"},"used":{"type":"number"},"addSeats":{"anyOf":[{"type":"object","properties":{"seats":{"type":"number"},"added":{"type":"number"},"priceMinor":{"type":"number"},"interval":{"type":"string","enum":["MONTH","YEAR"]}},"required":["seats","added","priceMinor","interval"]},{"type":"null"}]},"askName":{"type":["string","null"]},"appMessage":{"type":"string","description":"The refusal with no price and no way to buy in it, which an app in a store can show as written."},"message":{"type":"string"}},"required":["metric","limit","used","addSeats","askName","appMessage","message"]},{"type":"null"}],"description":"Set once every seat is taken or invited, with what to do about it."}},"required":["active","invited","included","paid","max","full"]},"SyncRecordPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"expenseId":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"state":{"type":"string","enum":["PENDING","SYNCED","FAILED","SKIPPED","VOIDED"]},"externalType":{"type":["string","null"]},"externalId":{"description":"The record in the other system.","type":["string","null"]},"errorCode":{"type":["string","null"]},"message":{"type":["string","null"]},"attempts":{"type":"number"},"syncedAt":{"type":["string","null"]},"nextAttemptAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"paidBy":{"anyOf":[{"type":"string","enum":["PROVIDER","PAPERTOTAL"]},{"type":"null"}]},"paymentError":{"type":["string","null"]},"resends":{"type":"number"}},"required":["id","expenseId","reference","merchantName","date","amountMinor","currency","state","externalType","externalId","errorCode","message","attempts","syncedAt","nextAttemptAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Transaction":{"type":"object","properties":{"id":{"type":"string"},"paymentAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"postedDate":{"type":"string"},"amountMinor":{"type":"number","description":"Positive is money spent. Negative is a refund or a payment to the card."},"currency":{"type":"string"},"description":{"type":"string"},"merchantName":{"type":["string","null"]},"state":{"type":"string","enum":["UNMATCHED","MATCHED","IGNORED","EXPENSED","PENDING"]},"matchScore":{"type":["number","null"]},"missingReceipt":{"type":"boolean","description":"Older than three days with no expense: a receipt is owed."},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"suggestions":{"type":"array","items":{"type":"object","properties":{"expense":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},"score":{"type":"number"},"amountGapMinor":{"type":"number"},"dayGap":{"type":"number"}},"required":["expense","score","amountGapMinor","dayGap"]}}},"required":["id","paymentAccount","postedDate","amountMinor","currency","description","merchantName","state","matchScore","missingReceipt","expense","suggestions"]},"TransactionPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"paymentAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"postedDate":{"type":"string"},"amountMinor":{"type":"number","description":"Positive is money spent. Negative is a refund or a payment to the card."},"currency":{"type":"string"},"description":{"type":"string"},"merchantName":{"type":["string","null"]},"state":{"type":"string","enum":["UNMATCHED","MATCHED","IGNORED","EXPENSED","PENDING"]},"matchScore":{"type":["number","null"]},"missingReceipt":{"type":"boolean","description":"Older than three days with no expense: a receipt is owed."},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"suggestions":{"type":"array","items":{"type":"object","properties":{"expense":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},"score":{"type":"number"},"amountGapMinor":{"type":"number"},"dayGap":{"type":"number"}},"required":["expense","score","amountGapMinor","dayGap"]}}},"required":["id","paymentAccount","postedDate","amountMinor","currency","description","merchantName","state","matchScore","missingReceipt","expense","suggestions"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"TransactionSummary":{"type":"object","properties":{"currency":{"type":"string","description":"What every figure here is in: the one asked for with currency, or the workspace currency when it has lines, or the commonest."},"currencies":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"count":{"type":"number"},"netMinor":{"type":"number"}},"required":["currency","count","netMinor"]},"description":"Every currency these lines are in, each with its own count and net."},"count":{"type":"number"},"spentMinor":{"type":"number"},"creditedMinor":{"type":"number"},"missingReceipts":{"type":"number"},"byState":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string","enum":["UNMATCHED","MATCHED","IGNORED","EXPENSED","PENDING"]},"count":{"type":"number"},"amountMinor":{"type":"number"}},"required":["state","count","amountMinor"]}}},"required":["currency","currencies","count","spentMinor","creditedMinor","missingReceipts","byState"]},"Workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["PERSONAL","TEAM"]},"baseCurrency":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]},"country":{"type":"string"},"timezone":{"type":"string"},"fiscalYearStartMonth":{"type":"number"},"distanceUnit":{"type":"string"},"claimedDomain":{"type":["string","null"]},"requireMfa":{"type":"boolean"},"retentionDays":{"description":"Documents are deleted this many days after they are read. Null keeps them until someone deletes them.","type":["number","null"]},"callLogRetentionDays":{"description":"Days the API call log is kept. Null is the default of 365.","type":["number","null"]},"preferences":{"type":"object","properties":{"locale":{"description":"How this workspace's findings write money. Null is the person's own.","type":["string","null"]},"showDefaultCategories":{"type":"boolean","description":"False takes the built-in categories out of everyone's list but a manager's, and out of what reading a document suggests."},"shredDocuments":{"type":"boolean","description":"Paper from a mail-in batch is shredded after scanning, unless the batch says otherwise."},"reimbursableTracking":{"type":"boolean","description":"False takes reimbursing out of the workspace: nothing new is flagged."},"calculateMissingTax":{"type":"boolean","description":"Works out a missing tax on a captured document at vatBasisPoints, and says so on the expense."},"dateFormat":{"type":"string","enum":["YYYY-MM-DD","MM/DD/YYYY","DD/MM/YYYY","DD.MM.YYYY","MMM D, YYYY"],"description":"How dates read across the app. The API always sends YYYY-MM-DD."},"vatBasisPoints":{"description":"VAT within the total on a typed expense that gives no tax, in hundredths of a percent. 2000 is 20%.","type":["number","null"]}},"required":["locale","showDefaultCategories","shredDocuments","reimbursableTracking","calculateMissingTax","dateFormat","vatBasisPoints"]},"permissions":{"readOnly":true,"description":"What this caller may do here, from the role of the person the key belongs to.","type":"array","items":{"type":"string","enum":["expenses.read_all","expenses.write_all","reports.read_all","reports.approve","reimbursements.manage","members.manage","settings.manage","policies.manage","billing.manage","integrations.manage","exports.all","developer.manage","audit.read","documents.reveal","cards.manage","security.manage","workspace.delete"]}},"entitlement":{"type":"object","properties":{"plan":{"anyOf":[{"type":"string","enum":["STARTER","PRO","BUSINESS"]},{"type":"null"}]},"lastPlan":{"description":"With no plan in force, the one the workspace held last. What it could read stays readable.","anyOf":[{"type":"string","enum":["STARTER","PRO","BUSINESS"]},{"type":"null"}]},"status":{"type":"string","enum":["TRIALING","ACTIVE","PAST_DUE","EXPIRED","NONE"]},"source":{"anyOf":[{"type":"string","enum":["STRIPE","APP_STORE","PLAY_STORE","TRIAL","COMP"]},{"type":"null"}]},"active":{"type":"boolean","description":"Capture and edits stop when this is false. Reading and exporting never do."},"trialEndsAt":{"type":["string","null"]},"currentPeriodEnd":{"type":["string","null"]},"cancelAtPeriodEnd":{"type":"boolean"},"interval":{"anyOf":[{"type":"string","enum":["MONTH","YEAR"]},{"type":"null"}]},"seats":{"type":"number"},"features":{"readOnly":true,"type":"array","items":{"type":"string","enum":["receipt_capture","email_capture","mileage","expense_reports","tax_reports","standard_exports","multi_currency","business_cards","mail_in","automation_rules","card_feeds","accounting_sync","approvals","policies","reimbursements","custom_fields","per_diem","human_verification","developer_api","multi_level_approvals","sso","audit_log","scheduled_reports"]}},"limits":{"anyOf":[{"type":"object","properties":{"scansPerMonth":{"type":"number"},"seatsIncluded":{"type":"number"},"maxSeats":{"type":["number","null"]},"apiDocumentsPerMonth":{"type":"number"},"mailInDocumentsPerMonth":{"type":"number"}},"required":["scansPerMonth","seatsIncluded","maxSeats","apiDocumentsPerMonth","mailInDocumentsPerMonth"]},{"type":"null"}]}},"required":["plan","status","source","active","trialEndsAt","currentPeriodEnd","cancelAtPeriodEnd","interval","seats","features","limits"]},"services":{"type":"object","properties":{"mailIn":{"type":"boolean"},"humanVerification":{"type":"boolean"}},"required":["mailIn","humanVerification"]},"usage":{"type":"object","propertyNames":{"type":"string","enum":["scans","api_documents"]},"additionalProperties":{"type":"number"},"required":["scans","api_documents"]},"memberCount":{"type":"number"},"sandboxOfId":{"description":"The workspace this is the sandbox of. Null for a live workspace.","type":["string","null"]},"readingModel":{"type":"string","enum":["standard","rules_only","always_second_reading"],"description":"What reads this workspace's documents."},"actingFor":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"access":{"type":"string","enum":["FULL","LIMITED"]}},"required":["userId","name","access"]},{"type":"null"}]}},"required":["id","name","kind","baseCurrency","role","country","timezone","fiscalYearStartMonth","distanceUnit","claimedDomain","requireMfa","retentionDays","callLogRetentionDays","preferences","permissions","entitlement","services","usage","memberCount","sandboxOfId","readingModel"]},"WorkspaceCounts":{"type":"object","properties":{"needsReview":{"type":"number"},"processing":{"type":"number"},"pendingApprovals":{"type":"number"},"holdsApprovals":{"type":"boolean"},"unmatchedTransactions":{"type":"number"},"unreadNotifications":{"type":"number"}},"required":["needsReview","processing","pendingApprovals","holdsApprovals","unmatchedTransactions","unreadNotifications"]},"WorkspaceCreated":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["PERSONAL","TEAM"]},"baseCurrency":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]},"entitlement":{"type":"object","properties":{"plan":{"anyOf":[{"type":"string","enum":["STARTER","PRO","BUSINESS"]},{"type":"null"}],"description":"What the workspace holds now: what the trial of its owner has left, or nothing. Naming a plan does not buy it."},"status":{"type":"string","enum":["TRIALING","ACTIVE","PAST_DUE","EXPIRED","NONE"]},"active":{"type":"boolean"},"trialEndsAt":{"type":["string","null"]}},"required":["plan","status","active","trialEndsAt"]},"checkout":{"anyOf":[{"type":"object","properties":{"plan":{"type":"string","enum":["STARTER","PRO","BUSINESS"]},"interval":{"type":"string","enum":["MONTH","YEAR"]},"url":{"type":"string","description":"The billing page, for a person to pay for the plan. A plan cannot be bought by an API call."}},"required":["plan","interval","url"]},{"type":"null"}],"description":"Set when a plan was named."}},"required":["id","name","kind","baseCurrency","role","entitlement","checkout"]},"WorkspacePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["PERSONAL","TEAM"]},"baseCurrency":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]}},"required":["id","name","kind","baseCurrency","role"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Me":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"displayName":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"phone":{"type":["string","null"]},"language":{"type":"string","enum":["en","es","fr","de","el","it","ja","nl","pl","pt-BR","zh-Hans"],"description":"The language the interface is written in. `locale` only sets how figures print."},"highContrast":{"type":"boolean"},"pronouns":{"type":["string","null"]},"personStatus":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"clearsAt":{"type":["string","null"]}},"required":["text","clearsAt"]},{"type":"null"}],"description":"A note beside their name, until it clears."},"hasPrivateDetails":{"type":"boolean","description":"Whether anything is kept under the emailed code. The details never come back from here."},"locale":{"type":"string"},"timezone":{"type":"string"},"distanceUnit":{"type":"string"},"onboarded":{"type":"boolean"},"onboardingIntent":{"description":"What they said they came for on first run.","type":["string","null"]},"emailBounced":{"type":"boolean","description":"Their address bounced, so mail to it stopped until they fix it."},"phoneVerified":{"type":"boolean","description":"Firebase proved the number with a code."},"hasEmail":{"type":"boolean","description":"False for someone who came in with a phone number and has not added an address yet. `email` then holds an address nothing can be sent to."},"locked":{"type":"boolean","description":"Locked after a report of suspicious activity. Only support can undo it."},"canChangeEmail":{"type":"boolean","description":"A domain group can keep the sign-in address where the company put it."},"canManageWorkspaces":{"type":"boolean","description":"A domain group can stop someone creating or closing workspaces."},"defaultWorkspaceId":{"type":["string","null"]},"forwardingAddress":{"type":"string"},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["PERSONAL","TEAM"]},"baseCurrency":{"type":"string"},"role":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]}},"required":["id","name","kind","baseCurrency","role"]}}},"required":["id","email","emailVerified","displayName","photoUrl","phone","language","highContrast","pronouns","personStatus","hasPrivateDetails","locale","timezone","distanceUnit","onboarded","onboardingIntent","emailBounced","phoneVerified","hasEmail","locked","canChangeEmail","canManageWorkspaces","defaultWorkspaceId","forwardingAddress","workspaces"]},"ForwardingAlias":{"type":"object","properties":{"alias":{"type":"string"},"address":{"type":"string"}},"required":["alias","address"]},"Blueprint":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"What blueprint_name takes."},"title":{"type":"string"},"description":{"type":["string","null"]},"documentType":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"builtIn":{"type":"boolean","description":"Ships with PaperTotal, and can be used and not changed."},"version":{"type":"number","description":"Changing a blueprint adds a version, and results keep the one that made them."},"schema":{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/$defs/__schema0"}},"required":["type","properties"],"additionalProperties":false},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":100},"example":{"type":"string","maxLength":200},"box":{"type":"object","properties":{"page":{"type":"integer","minimum":0,"maximum":49},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","minimum":0,"maximum":1},"height":{"type":"number","minimum":0,"maximum":1}},"required":["page","x","y","width","height"],"additionalProperties":false}},"required":["path"],"additionalProperties":false}},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","name","title","description","documentType","builtIn","version","schema","fields","createdAt","updatedAt"],"$defs":{"__schema0":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema1"}},"__schema1":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"string"},"description":{"type":"string","maxLength":300},"format":{"type":"string","enum":["date","time"]},"enum":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"sensitive":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["number","boolean"]},"description":{"type":"string","maxLength":300}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"integer"},"description":{"type":"string","maxLength":300},"format":{"type":"string","const":"minor"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/$defs/__schema0"}},"required":["type","properties"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"array"},"description":{"type":"string","maxLength":300},"items":{"$ref":"#/$defs/__schema1"}},"required":["type","items"],"additionalProperties":false}]}}},"BlueprintList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"What blueprint_name takes."},"title":{"type":"string"},"documentType":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"builtIn":{"type":"boolean","description":"Ships with PaperTotal, and can be used and not changed."},"version":{"type":"number","description":"Changing a blueprint adds a version, and results keep the one that made them."}},"required":["id","name","title","documentType","builtIn","version"]}},"nextCursor":{"type":"null"}},"required":["data","nextCursor"]},"BlueprintDraft":{"type":"object","properties":{"documentId":{"type":"string"},"status":{"type":"string","enum":["READING","READY","FAILED"]},"draft":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"title":{"type":"string"},"documentType":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"schema":{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/$defs/__schema0"}},"required":["type","properties"],"additionalProperties":false},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":100},"example":{"type":"string","maxLength":200},"box":{"type":"object","properties":{"page":{"type":"integer","minimum":0,"maximum":49},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","minimum":0,"maximum":1},"height":{"type":"number","minimum":0,"maximum":1}},"required":["page","x","y","width","height"],"additionalProperties":false}},"required":["path"],"additionalProperties":false}},"engine":{"type":"string","enum":["rules","claude"]}},"required":["name","title","documentType","schema","fields","engine"]},{"type":"null"}],"description":"A starting point. Nothing is saved until it is sent to POST /v1/blueprints."},"error":{"type":["string","null"]}},"required":["documentId","status","draft","error"],"$defs":{"__schema0":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema1"}},"__schema1":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"string"},"description":{"type":"string","maxLength":300},"format":{"type":"string","enum":["date","time"]},"enum":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"sensitive":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["number","boolean"]},"description":{"type":"string","maxLength":300}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"integer"},"description":{"type":"string","maxLength":300},"format":{"type":"string","const":"minor"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/$defs/__schema0"}},"required":["type","properties"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"array"},"description":{"type":"string","maxLength":300},"items":{"$ref":"#/$defs/__schema1"}},"required":["type","items"],"additionalProperties":false}]}}},"Classification":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"document_type":{"anyOf":[{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},{"type":"null"}],"description":"Null until it has been read."},"engine":{"anyOf":[{"type":"string","enum":["rules","claude"]},{"type":"null"}]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["id","status","document_type","engine","scores"]},"Extraction":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"document_type":{"anyOf":[{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},{"type":"null"}],"description":"Null until it has been read."},"engine":{"anyOf":[{"type":"string","enum":["rules","claude"]},{"type":"null"}]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."},"extraction":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extraction_error":{"type":["string","null"]},"document":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"originalFilename":{"type":["string","null"]},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"pageCount":{"type":"number"},"externalId":{"type":["string","null"]},"folderId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"mailInBatchId":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"latitude":{"description":"Where the device said it was when the photo was taken.","type":["number","null"]},"longitude":{"type":["number","null"]},"locationAccuracyM":{"type":["number","null"]},"duplicateOfId":{"type":["string","null"]},"processingError":{"type":["string","null"]},"processingErrorCode":{"anyOf":[{"type":"string","enum":["FILE_ENCRYPTED"]},{"type":"null"}],"description":"Set when the failure is one the file's owner can fix. processingError says what to do."},"verification":{"type":"string"},"capturedAt":{"type":["string","null"]},"processedAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"uploadedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all."},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}],"description":"Null when the page is not one, and for a caller without expenses.read_all."},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all. Value null means nothing could say."},"language":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]}},"ocrScore":{"type":["number","null"]},"isFront":{"description":"A check: the front or the back.","type":["boolean","null"]},"tiffRejectScore":{"description":"A check: 0 is a clean clearing image and 1 is one a bank would send back.","type":["number","null"]},"tiffUpscaled":{"description":"A check: the photo was under 240 DPI, so the clearing image was enlarged.","type":["boolean","null"]}},"required":["index","url","thumbnailUrl","width","height","isBlurry","glare","isLcd","screenshot","aiGenerated","language","languages","ocrScore","isFront","tiffRejectScore","tiffUpscaled"]}},"classification":{"anyOf":[{"type":"object","properties":{"value":{"type":"string","description":"A document class, or one of the labels the caller named."},"score":{"type":"number","description":"0..1."},"engine":{"type":"string","enum":["rules","claude"]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["value","score","engine","scores"]},{"type":"null"}],"description":"What the classifier decided, when it was asked."},"blueprint":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"description":"Null for a built-in, which has no versions.","type":["number","null"]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The fields the blueprint defines. Null when the run failed."},"offsets":{"description":"Where each value sits in the text, for a blueprint that asks.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"begin":{"type":"number"},"end":{"type":"number"}},"required":["begin","end"]}},"unmatched":{"description":"Fields where a value was read and did not fit, such as words where a number belongs or a choice off the list. Each is left empty. An empty field not named here was not on the document.","type":"array","items":{"type":"string"}},"error":{"description":"Why the run gave nothing back.","type":["string","null"]}},"required":["name","version","result","error"]},{"type":"null"}],"description":"The blueprint this was read with, and what came out of it."},"tags":{"type":"array","items":{"type":"string"}},"tagRefs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The same tags with their ids, which a tag route takes."},"recordStatus":{"anyOf":[{"type":"string","enum":["processed","reviewed","archived"]},{"type":"null"}],"description":"Where a read document stands: reviewedAt and archivedAt in one word. Null until it has been read."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."},"setId":{"description":"The upload this came out of: a ZIP, a split PDF or a batch of addresses.","type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}],"description":"Values the workspace custom field rules read out of the text."},"enrichment":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","DONE","FAILED"]},"steps":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"failed":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}}},"required":["status","steps","failed"]},{"type":"null"}],"description":"Work still running after the first answer."},"extraction":{"anyOf":[{"type":"object","properties":{"fields":{"type":"object","properties":{"documentType":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"merchantName":{"type":["string","null"]},"merchantAddress":{"type":["string","null"]},"merchantPhone":{"type":["string","null"]},"merchantWebsite":{"type":["string","null"]},"merchantTaxId":{"type":["string","null"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"time":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG","CUC","HRK","SLL","ZWL","XDR","XSU"]},{"type":"null"}]},"currencyGuessed":{"default":false,"type":"boolean"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxLines":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"code":{"type":["string","null"]},"totalInclusive":{"type":["boolean","null"]}},"required":["amountMinor"]}},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"cardBrand":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"receiptNumber":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"poNumber":{"type":["string","null"]},"lineItems":{"default":[],"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"id":{"type":["string","null"]},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["room","tax","parking","service","fee","delivery","product","food","alcohol","tobacco","transportation","fuel","refund","discount","payment","giftcard","donation","toll","lottery"]},{"type":"null"}]},"fullDescription":{"type":["string","null"]},"normalizedDescription":{"type":["string","null"]},"section":{"type":["string","null"]},"reference":{"type":["string","null"]},"upc":{"type":["string","null"]},"hsn":{"type":["string","null"]},"lot":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unitOfMeasure":{"type":["string","null"]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountRatePct":{"type":["number","null"]},"discountPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxRatePct":{"type":["number","null"]},"taxCode":{"type":["string","null"]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"grossTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"netTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"category":{"type":["string","null"]},"customCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countryOfOrigin":{"type":["string","null"]},"manufacturer":{"type":["string","null"]},"weight":{"type":["string","null"]},"brand":{"type":["string","null"]},"hsaFsaEligible":{"type":["boolean","null"]},"productInfo":{"anyOf":[{"type":"object","properties":{"expandedDescription":{"type":["string","null"]},"brand":{"type":["string","null"]},"categoryPath":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},{"type":"null"}]}},"required":["description","amountMinor"]}},"suggestedCategory":{"type":["string","null"]},"documentTitle":{"type":["string","null"]},"documentReferenceNumber":{"type":["string","null"]},"isDocument":{"type":["boolean","null"]},"isTransaction":{"type":["boolean","null"]},"isMoneyIn":{"type":["boolean","null"]},"accountingEntryType":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}]},"vendor":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"vendors":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}}},{"type":"null"}]},"bankBreakdown":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}}},{"type":"null"}]},"billTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"vatNumber":{"type":["string","null"]},"regNumber":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"email":{"type":["string","null"]}}},{"type":"null"}]},"shipTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"insuranceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cashbackMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"roundingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"finalBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"previousBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"totalQuantity":{"type":["number","null"]},"totalWeight":{"type":["string","null"]},"payment":{"anyOf":[{"type":"object","properties":{"cardNumber":{"type":["string","null"]},"displayName":{"type":["string","null"]},"terms":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["none","visa","master_card","cash","american_express","interac","other","maestro","discover","bancontact","girocard","applepay","paypal","bancomat","giftcard","card","check","bankaxept","bank-to-bank_transfer_bacs","octopus","pix","jcb","waon","mada","wechat","alipay","unionpay","googlepay","rupay","bpay","shopeepay","mir","giropay","food_stamp","diners_club","paypay"]},{"type":"null"}]}}},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"shipDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliveryDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"exchangeRate":{"type":["number","null"]},"countryCode":{"type":["string","null"]},"deliveryNoteNumber":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"trackingNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"incoterms":{"type":["string","null"]},"weights":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"licensePlateNumber":{"type":["string","null"]},"vinNumber":{"type":["string","null"]},"guestCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"serverName":{"type":["string","null"]},"storeNumber":{"type":["string","null"]},"vendingPerson":{"type":["string","null"]},"vendingPersonNumber":{"type":["string","null"]},"customerAccountNumber":{"type":["string","null"]},"category":{"type":["string","null"]},"defaultCategory":{"type":["string","null"]},"barcodes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"type":{"type":"string","enum":["QR_CODE","PDF417","EAN_13","EAN_8","UPC_A","UPC_E","CODE_128","CODE_39","ITF","DATA_MATRIX","AZTEC","OTHER"]},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"boundingRegion":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]}},"required":["data","type","page"]}},{"type":"null"}]},"paymentLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string","enum":["text","hyperlink","qr_code","barcode"]}},"required":["url","source"]}},{"type":"null"}]},"folio":{"anyOf":[{"type":"object","properties":{"arrivalDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"departureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roomNumber":{"type":["string","null"]},"guestName":{"type":["string","null"]},"nights":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"confirmationNumber":{"type":["string","null"]}}},{"type":"null"}]},"enrichedFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"check":{"anyOf":[{"type":"object","properties":{"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountText":{"type":["string","null"]},"amountsAgree":{"type":["boolean","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"checkNumber":{"type":["string","null"]},"checkType":{"anyOf":[{"type":"string","enum":["bank_draft","bill_pay_draft","business_check","cashiers_check","government_check","money_order","personal_check","starter_check","teller_check"]},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"memo":{"type":["string","null"]},"payerName":{"type":["string","null"]},"payerAddress":{"type":["string","null"]},"receiverName":{"type":["string","null"]},"receiverAddress":{"type":["string","null"]},"isSigned":{"type":["boolean","null"]},"endorsement":{"anyOf":[{"type":"object","properties":{"isEndorsed":{"type":["boolean","null"]},"isSigned":{"type":["boolean","null"]},"mobileOrRemoteDeposit":{"anyOf":[{"type":"object","properties":{"checkbox":{"type":["boolean","null"]},"instructions":{"type":["boolean","null"]}}},{"type":"null"}]},"isMobileOrRemoteDepositOnly":{"type":["boolean","null"]}}},{"type":"null"}]},"micr":{"anyOf":[{"type":"object","properties":{"routingNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"serialNumber":{"type":["string","null"]},"raw":{"type":["string","null"]},"branch":{"type":["string","null"]},"institution":{"type":["string","null"]},"transactionCode":{"type":["string","null"]}}},{"type":"null"}]},"fractionalRoutingNumber":{"type":["string","null"]},"routingFromFractional":{"type":["string","null"]},"voidTerms":{"type":["string","null"]}}},{"type":"null"}]},"statement":{"anyOf":[{"type":"object","properties":{"accountHolderName":{"type":["string","null"]},"accountHolderAddress":{"type":["string","null"]},"accountType":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"bankWebsite":{"type":["string","null"]},"bankVatNumber":{"type":["string","null"]},"accountVatNumber":{"type":["string","null"]},"periodStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementNumber":{"type":["string","null"]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"minimumDueMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"routingNumber":{"type":["string","null"]},"swift":{"type":["string","null"]},"iban":{"type":["string","null"]},"accounts":{"default":[],"type":"array","items":{"type":"object","properties":{"number":{"type":["string","null"]},"ibanNumber":{"type":["string","null"]},"accountType":{"type":["string","null"]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"summaries":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["name"]}},"transactions":{"default":[],"type":"array","items":{"type":"object","properties":{"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"postedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"vendor":{"type":["string","null"]},"transactionId":{"type":["string","null"]},"debitAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"creditAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cardNumber":{"type":["string","null"]},"text":{"type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["order"]}}}}},"balancesAgree":{"type":["boolean","null"]}}},{"type":"null"}]},"taxForm":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["W2","W9","W8BEN_E"]},"w2":{"anyOf":[{"type":"object","properties":{"employeeSsn":{"type":["string","null"]},"ein":{"type":["string","null"]},"employerName":{"type":["string","null"]},"employerAddress":{"type":["string","null"]},"controlNumber":{"type":["string","null"]},"employeeName":{"type":["string","null"]},"employeeAddress":{"type":["string","null"]},"wagesOtherComps":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"federalIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"allocatedTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"advanceEicPayment":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dependentCareBenefits":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"nonQualifiedPlans":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"box12":{"default":[],"type":"array","items":{"type":"object","properties":{"box":{"type":"string"},"code":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["box","code"]}},"is13a":{"type":["boolean","null"]},"is13b":{"type":["boolean","null"]},"is13c":{"type":["boolean","null"]},"box14Other":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["label"]}},"stateLines":{"default":[],"type":"array","items":{"type":"object","properties":{"state":{"type":["string","null"]},"employerStateId":{"type":["string","null"]},"stateWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"stateIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localityName":{"type":["string","null"]}}}},"taxYear":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"w9":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"businessName":{"type":["string","null"]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"individual":{"type":["boolean","null"]},"cCorp":{"type":["boolean","null"]},"sCorp":{"type":["boolean","null"]},"partnership":{"type":["boolean","null"]},"trustEstate":{"type":["boolean","null"]},"llc":{"type":["boolean","null"]},"llcType":{"type":["string","null"]},"other":{"type":["boolean","null"]},"otherDescription":{"type":["string","null"]},"exemptPayeeCode":{"type":["string","null"]},"exemption":{"type":["string","null"]},"ssn":{"type":["string","null"]},"ein":{"type":["string","null"]},"accountNumbers":{"type":["string","null"]},"requester":{"type":["string","null"]},"signature":{"type":["boolean","null"]},"signatureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}},{"type":"null"}]},"w8BenE":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","boolean","null"]}},{"type":"null"}]}},"required":["kind"]},{"type":"null"}]},"itinerary":{"anyOf":[{"type":"object","properties":{"travelerName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"returnsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"segments":{"default":[],"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]}}}},{"type":"null"}]},"fieldConfidence":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fieldBoxes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"page":{"type":"number"},"box":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4}},"required":["page","box"]}}},"description":"What was read, as the extraction contract types it. fieldConfidence holds per-field confidence, 0..1."},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["tax_rate_mismatch","item_counts_mismatch","totals_mismatch","line_item_amount_mismatch","line_item_repeats","barcode_decoding_issue","barcode_code_missing_in_ocr","logo_vendor_mismatch","malware","weekend_transaction","time_and_currency_mismatch","exif_creation_modified_date_mismatch","missing_date","suspicious_document_aspect_ratio","generic_placeholder_content"]},"message":{"type":"string"},"page":{"type":["number","null"]}},"required":["code","message"]},"description":"Integrity findings. A caller without expenses.read_all sees the arithmetic and dates only."}},"required":["fields","confidence","flags","warnings"]},{"type":"null"}]},"fraud":{"anyOf":[{"type":"object","properties":{"version":{"type":"string"},"score":{"type":"number","description":"0 to 1, from the signals that fired. Evidence, never a verdict."},"color":{"type":"string","enum":["green","yellow","red"],"description":"Under the workspace yellow threshold is green. Over its red threshold is red."},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"description":"Signals that fired, most important first."},"details":{"type":"object","propertyNames":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"additionalProperties":{"type":"object","properties":{"description":{"type":"string"},"confidence":{"type":"number","description":"How sure the detector is of what it saw, 0 to 1. Not how likely fraud is."},"reasons":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Stable."},"description":{"type":"string","description":"Written for a person."},"field":{"description":"Where it was read: exif:Software, totalMinor.","type":["string","null"]},"value":{"type":["string","null"]},"page":{"description":"Zero-based.","type":["number","null"]},"score":{"type":["number","null"]},"box":{"description":"Where on the page, as fractions of its size: x, y, width, height.","anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]}},"required":["name","description"]}}},"required":["description","confidence","reasons"]},"description":"By signal: a description, a confidence and typed reasons."},"attribution":{"description":"One sentence naming the strongest evidence.","type":["string","null"]},"decision":{"type":"string","enum":["clear","review","fraud","not_fraud","unknown"],"description":"clear or review until a person decides. Only a person can say fraud."},"review":{"anyOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["FRAUD","NOT_FRAUD","UNKNOWN"]},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},"note":{"type":["string","null"]},"reviewedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"reviewedAt":{"type":"string"}},"required":["decision","types","note","reviewedBy","reviewedAt"]},{"type":"null"}]},"deviceId":{"description":"The id the client sent for its device, when it sent one.","type":["string","null"]},"submissions":{"anyOf":[{"type":"object","properties":{"lastMinutes":{"type":"number"},"lastDay":{"type":"number"},"lastWeek":{"type":"number"},"last2Weeks":{"type":"number"},"lastMonth":{"type":"number"}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]},{"type":"null"}],"description":"Documents from this uploader in this workspace, by window."},"deviceProfiles":{"type":"array","items":{"type":"object","properties":{"deviceId":{"type":"string"},"profileId":{"type":"string"},"documentCount":{"type":"number"}},"required":["deviceId","profileId","documentCount"]},"description":"Over 30 days, inside this workspace only."},"digitalTamperingFields":{"type":"array","items":{"type":"string"}},"handwriting":{"type":"object","properties":{"handwrittenFields":{"type":"array","items":{"type":"string"}},"fullyHandwrittenFields":{"type":"array","items":{"type":"string"}},"handwrittenTamperedFields":{"type":"array","items":{"type":"string"}},"handwritingDetected":{"type":["boolean","null"]},"handwritingTamperingPresent":{"type":["boolean","null"]}},"required":["handwrittenFields","fullyHandwrittenFields","handwrittenTamperedFields","handwritingDetected","handwritingTamperingPresent"],"description":"What Claude saw written by hand, in dot notation, when a key is set and the handwriting signal is on. With no key, the lists are empty and the flags null: skipped says why."},"notADocument":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"digitalBackground":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"fraudulentPdf":{"anyOf":[{"type":"object","properties":{"fraudulentPdfCreator":{"type":["number","null"]},"textOverlay":{"type":["number","null"]},"fontMismatch":{"type":["number","null"]},"hasDigitalSignature":{"type":["boolean","null"]},"pdfModified":{"type":["number","null"]},"incrementalUpdates":{"type":["number","null"]},"incrementalChanges":{"type":"array","items":{"type":"string"}},"incrementalEdits":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["page","before","after"]}},"signatureCreationTools":{"type":"array","items":{"type":"string"}},"dateInversion":{"type":["number","null"]},"producerContentMismatch":{"type":["number","null"]},"writerMismatch":{"type":["number","null"]},"nullMetadata":{"type":["number","null"]},"xmpInfoMismatch":{"type":["number","null"]},"futureMetadataDate":{"type":["number","null"]},"rasterProfileMismatch":{"type":["number","null"]},"uncompressedRaster":{"type":["number","null"]},"splicedPage":{"type":["number","null"]},"splicedPageNumber":{"type":["number","null"]},"valueFontSplice":{"type":["number","null"]},"valueFontSplicePage":{"type":["number","null"]},"headlessDesktopRender":{"type":["number","null"]},"headlessRenderPlatform":{"type":["string","null"]},"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["fraudulentPdfCreator","textOverlay","fontMismatch","hasDigitalSignature","pdfModified","incrementalUpdates","incrementalChanges","incrementalEdits","signatureCreationTools","dateInversion","producerContentMismatch","writerMismatch","nullMetadata","xmpInfoMismatch","futureMetadataDate","rasterProfileMismatch","uncompressedRaster","splicedPage","splicedPageNumber","valueFontSplice","valueFontSplicePage","headlessDesktopRender","headlessRenderPlatform","doubleJpeg","firstQuantizationQuality","scrubbedProvenance","score"],"description":"Every key is always reported, so a check nothing could answer is null rather than missing."},{"type":"null"}]},"fraudulentImage":{"anyOf":[{"type":"object","properties":{"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"editorSignature":{"type":["number","null"]},"editorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"editorSignatureValue":{"type":["string","null"]},"generatorSignature":{"type":["number","null"]},"generatorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"generatorSignatureValue":{"type":["string","null"]},"generatorWriterProfile":{"type":["number","null"]},"generatorWriterProfileValue":{"type":["string","null"]},"syntheticRaster":{"type":["number","null"]},"syntheticRasterFingerprints":{"type":"array","items":{"type":"string"}},"unprofiledPng":{"type":["number","null"]},"unprofiledWebp":{"type":["number","null"]},"source":{"anyOf":[{"type":"string","enum":["original","render"]},{"type":"null"}]},"sourceFormats":{"type":"array","items":{"type":"string"}},"unreadableSource":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["doubleJpeg","firstQuantizationQuality","scrubbedProvenance","editorSignature","editorSignatureField","editorSignatureValue","generatorSignature","generatorSignatureField","generatorSignatureValue","generatorWriterProfile","generatorWriterProfileValue","syntheticRaster","syntheticRasterFingerprints","unprofiledPng","unprofiledWebp","source","sourceFormats","unreadableSource","score"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}]},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Value null means nothing could say: no pixel model runs, only metadata can answer."},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]}},"required":["index","isBlurry","isLcd","screenshot","aiGenerated","glare"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"reason":{"type":"string"}},"required":["check","reason"]},"description":"Checks that could not run on this file, so a clean result is not read as more than it is."}},"required":["version","score","color","types","details","attribution","decision","review","deviceId","submissions","deviceProfiles","digitalTamperingFields","handwriting","notADocument","digitalBackground","fraudulentPdf","fraudulentImage","pages","skipped"],"description":"Evidence for a reviewer. Null until inspected, and for a caller without expenses.read_all."},{"type":"null"}]},"sealed":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]},"masked":{"type":"string","description":"All but the last few characters are stars. Punctuation stays where it was."},"field":{"type":["string","null"]},"page":{"type":"number"}},"required":["kind","masked","field","page"]},"description":"Bank and tax numbers read from this document, as masks. POST /v1/documents/{id}/reveal opens them."},"updatedAt":{"type":"string"},"extractor":{"description":"What read it: rules, claude, a blueprint, business-card, or none.","type":["string","null"]},"ocrText":{"description":"Everything read off the page. Card, bank and tax numbers are masked.","type":["string","null"]},"pdfUrl":{"description":"The PDF as uploaded, signed for 15 minutes. Null for an image, and for a PDF that prints a number only a reveal hands out.","type":["string","null"]},"meta":{"type":"object","properties":{"totalPages":{"type":"number"},"processedPages":{"type":"number"},"ocrScore":{"description":"The average character confidence of the reading, which doubles as a measure of the image.","type":["number","null"]},"originalFileName":{"type":["string","null"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"language":{"description":"BCP-47.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]},"description":"Every language found, best first."},"deviceId":{"type":["string","null"]},"deviceUserUuid":{"description":"The signed-in person the device was capturing for. Null when no device was named.","type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"sourceDocuments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Each file as submitted: name, type, size in KB, width, height and EXIF."},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}],"description":"Who uploaded it."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."}},"required":["totalPages","processedPages","ocrScore","originalFileName","source","language","languages","deviceId","deviceUserUuid","latitude","longitude","sourceDocuments","owner","duplicates"]},"reviewedAt":{"description":"A person checked what was read.","type":["string","null"]},"approvedAt":{"description":"A developer's own approved flag. An expense's approval is a different thing.","type":["string","null"]}},"required":["id","type","source","status","originalFilename","mimeType","sizeBytes","pageCount","externalId","folderId","expenseId","mailInBatchId","title","notes","latitude","longitude","locationAccuracyM","duplicateOfId","processingError","processingErrorCode","verification","capturedAt","processedAt","viewedAt","archivedAt","createdAt","uploadedBy","pages","classification","blueprint","tags","tagRefs","recordStatus","duplicates","setId","customFields","enrichment","extraction","fraud","sealed","updatedAt","extractor","ocrText","pdfUrl","meta","reviewedAt","approvedAt"]}},"required":["id","status","document_type","engine","scores","extraction","extraction_error","document"]},"DocumentSet":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["ZIP","BATCH","SPLIT","DOCUMENTS","W2","BANK_STATEMENT","PARSE"]},"status":{"type":"string","enum":["QUEUED","PROCESSING","COMPLETED","FAILED"]},"originalFilename":{"type":["string","null"]},"pageCount":{"type":"number"},"ranges":{"type":"array","items":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"type":{"type":"string"},"score":{"type":"number"}},"required":["start","end"]},"description":"Pages found, 1-based and inclusive, with a type and score when classified."},"refused":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":"string"}},"required":["name","reason"]}},"error":{"type":["string","null"]},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"pageStart":{"type":["number","null"]},"pageEnd":{"type":["number","null"]}},"required":["id","type","status","pageStart","pageEnd"]}},"createdAt":{"type":"string"},"completedAt":{"type":["string","null"]}},"required":["id","kind","status","originalFilename","pageCount","ranges","refused","error","documents","createdAt","completedAt"]},"DocumentSetPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["ZIP","BATCH","SPLIT","DOCUMENTS","W2","BANK_STATEMENT","PARSE"]},"status":{"type":"string","enum":["QUEUED","PROCESSING","COMPLETED","FAILED"]},"originalFilename":{"type":["string","null"]},"pageCount":{"type":"number"},"ranges":{"type":"array","items":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"type":{"type":"string"},"score":{"type":"number"}},"required":["start","end"]},"description":"Pages found, 1-based and inclusive, with a type and score when classified."},"refused":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":"string"}},"required":["name","reason"]}},"error":{"type":["string","null"]},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"pageStart":{"type":["number","null"]},"pageEnd":{"type":["number","null"]}},"required":["id","type","status","pageStart","pageEnd"]}},"createdAt":{"type":"string"},"completedAt":{"type":["string","null"]}},"required":["id","kind","status","originalFilename","pageCount","ranges","refused","error","documents","createdAt","completedAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ParsedDocument":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"markdown":{"type":["string","null"]},"meta":{"anyOf":[{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"},"blurScore":{"description":"Sharpness of a photographed page. Higher is sharper.","type":["number","null"]},"ocrScore":{"type":["number","null"]}},"required":["index","width","height","blurScore","ocrScore"]}},"ocrScore":{"type":["number","null"]},"engine":{"type":"string","enum":["rules","claude"]}},"required":["pages","ocrScore","engine"]},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"externalId":{"type":["string","null"]},"setId":{"type":["string","null"]},"createdAt":{"type":"string"},"boxes":{"description":"With details: every recognized line and where it sits.","type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"confidence":{"type":"number"},"page":{"type":"number"},"box":{"anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]}},"required":["text","confidence","page","box"]}}},"required":["id","status","markdown","meta","tags","title","notes","externalId","setId","createdAt"]},"ParsedDocumentPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"markdown":{"type":["string","null"]},"meta":{"anyOf":[{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"},"blurScore":{"description":"Sharpness of a photographed page. Higher is sharper.","type":["number","null"]},"ocrScore":{"type":["number","null"]}},"required":["index","width","height","blurScore","ocrScore"]}},"ocrScore":{"type":["number","null"]},"engine":{"type":"string","enum":["rules","claude"]}},"required":["pages","ocrScore","engine"]},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"externalId":{"type":["string","null"]},"setId":{"type":["string","null"]},"createdAt":{"type":"string"},"boxes":{"description":"With details: every recognized line and where it sits.","type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"confidence":{"type":"number"},"page":{"type":"number"},"box":{"anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]}},"required":["text","confidence","page","box"]}}},"required":["id","status","markdown","meta","tags","title","notes","externalId","setId","createdAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"DocumentUpload":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"status":{"type":"string"},"originalFilename":{"type":["string","null"]},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"pageCount":{"type":"number"},"externalId":{"type":["string","null"]},"folderId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"mailInBatchId":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"latitude":{"description":"Where the device said it was when the photo was taken.","type":["number","null"]},"longitude":{"type":["number","null"]},"locationAccuracyM":{"type":["number","null"]},"duplicateOfId":{"type":["string","null"]},"processingError":{"type":["string","null"]},"processingErrorCode":{"anyOf":[{"type":"string","enum":["FILE_ENCRYPTED"]},{"type":"null"}],"description":"Set when the failure is one the file's owner can fix. processingError says what to do."},"verification":{"type":"string"},"capturedAt":{"type":["string","null"]},"processedAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"uploadedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all."},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}],"description":"Null when the page is not one, and for a caller without expenses.read_all."},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all. Value null means nothing could say."},"language":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]}},"ocrScore":{"type":["number","null"]},"isFront":{"description":"A check: the front or the back.","type":["boolean","null"]},"tiffRejectScore":{"description":"A check: 0 is a clean clearing image and 1 is one a bank would send back.","type":["number","null"]},"tiffUpscaled":{"description":"A check: the photo was under 240 DPI, so the clearing image was enlarged.","type":["boolean","null"]}},"required":["index","url","thumbnailUrl","width","height","isBlurry","glare","isLcd","screenshot","aiGenerated","language","languages","ocrScore","isFront","tiffRejectScore","tiffUpscaled"]}},"classification":{"anyOf":[{"type":"object","properties":{"value":{"type":"string","description":"A document class, or one of the labels the caller named."},"score":{"type":"number","description":"0..1."},"engine":{"type":"string","enum":["rules","claude"]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["value","score","engine","scores"]},{"type":"null"}],"description":"What the classifier decided, when it was asked."},"blueprint":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"description":"Null for a built-in, which has no versions.","type":["number","null"]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The fields the blueprint defines. Null when the run failed."},"offsets":{"description":"Where each value sits in the text, for a blueprint that asks.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"begin":{"type":"number"},"end":{"type":"number"}},"required":["begin","end"]}},"unmatched":{"description":"Fields where a value was read and did not fit, such as words where a number belongs or a choice off the list. Each is left empty. An empty field not named here was not on the document.","type":"array","items":{"type":"string"}},"error":{"description":"Why the run gave nothing back.","type":["string","null"]}},"required":["name","version","result","error"]},{"type":"null"}],"description":"The blueprint this was read with, and what came out of it."},"tags":{"type":"array","items":{"type":"string"}},"tagRefs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The same tags with their ids, which a tag route takes."},"recordStatus":{"anyOf":[{"type":"string","enum":["processed","reviewed","archived"]},{"type":"null"}],"description":"Where a read document stands: reviewedAt and archivedAt in one word. Null until it has been read."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."},"setId":{"description":"The upload this came out of: a ZIP, a split PDF or a batch of addresses.","type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}],"description":"Values the workspace custom field rules read out of the text."},"enrichment":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","DONE","FAILED"]},"steps":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"failed":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}}},"required":["status","steps","failed"]},{"type":"null"}],"description":"Work still running after the first answer."},"extraction":{"anyOf":[{"type":"object","properties":{"fields":{"type":"object","properties":{"documentType":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"merchantName":{"type":["string","null"]},"merchantAddress":{"type":["string","null"]},"merchantPhone":{"type":["string","null"]},"merchantWebsite":{"type":["string","null"]},"merchantTaxId":{"type":["string","null"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"time":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG","CUC","HRK","SLL","ZWL","XDR","XSU"]},{"type":"null"}]},"currencyGuessed":{"default":false,"type":"boolean"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxLines":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"code":{"type":["string","null"]},"totalInclusive":{"type":["boolean","null"]}},"required":["amountMinor"]}},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"cardBrand":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"receiptNumber":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"poNumber":{"type":["string","null"]},"lineItems":{"default":[],"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"id":{"type":["string","null"]},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["room","tax","parking","service","fee","delivery","product","food","alcohol","tobacco","transportation","fuel","refund","discount","payment","giftcard","donation","toll","lottery"]},{"type":"null"}]},"fullDescription":{"type":["string","null"]},"normalizedDescription":{"type":["string","null"]},"section":{"type":["string","null"]},"reference":{"type":["string","null"]},"upc":{"type":["string","null"]},"hsn":{"type":["string","null"]},"lot":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unitOfMeasure":{"type":["string","null"]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountRatePct":{"type":["number","null"]},"discountPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxRatePct":{"type":["number","null"]},"taxCode":{"type":["string","null"]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"grossTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"netTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"category":{"type":["string","null"]},"customCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countryOfOrigin":{"type":["string","null"]},"manufacturer":{"type":["string","null"]},"weight":{"type":["string","null"]},"brand":{"type":["string","null"]},"hsaFsaEligible":{"type":["boolean","null"]},"productInfo":{"anyOf":[{"type":"object","properties":{"expandedDescription":{"type":["string","null"]},"brand":{"type":["string","null"]},"categoryPath":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},{"type":"null"}]}},"required":["description","amountMinor"]}},"suggestedCategory":{"type":["string","null"]},"documentTitle":{"type":["string","null"]},"documentReferenceNumber":{"type":["string","null"]},"isDocument":{"type":["boolean","null"]},"isTransaction":{"type":["boolean","null"]},"isMoneyIn":{"type":["boolean","null"]},"accountingEntryType":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}]},"vendor":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"vendors":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}}},{"type":"null"}]},"bankBreakdown":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}}},{"type":"null"}]},"billTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"vatNumber":{"type":["string","null"]},"regNumber":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"email":{"type":["string","null"]}}},{"type":"null"}]},"shipTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"insuranceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cashbackMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"roundingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"finalBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"previousBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"totalQuantity":{"type":["number","null"]},"totalWeight":{"type":["string","null"]},"payment":{"anyOf":[{"type":"object","properties":{"cardNumber":{"type":["string","null"]},"displayName":{"type":["string","null"]},"terms":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["none","visa","master_card","cash","american_express","interac","other","maestro","discover","bancontact","girocard","applepay","paypal","bancomat","giftcard","card","check","bankaxept","bank-to-bank_transfer_bacs","octopus","pix","jcb","waon","mada","wechat","alipay","unionpay","googlepay","rupay","bpay","shopeepay","mir","giropay","food_stamp","diners_club","paypay"]},{"type":"null"}]}}},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"shipDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliveryDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"exchangeRate":{"type":["number","null"]},"countryCode":{"type":["string","null"]},"deliveryNoteNumber":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"trackingNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"incoterms":{"type":["string","null"]},"weights":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"licensePlateNumber":{"type":["string","null"]},"vinNumber":{"type":["string","null"]},"guestCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"serverName":{"type":["string","null"]},"storeNumber":{"type":["string","null"]},"vendingPerson":{"type":["string","null"]},"vendingPersonNumber":{"type":["string","null"]},"customerAccountNumber":{"type":["string","null"]},"category":{"type":["string","null"]},"defaultCategory":{"type":["string","null"]},"barcodes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"type":{"type":"string","enum":["QR_CODE","PDF417","EAN_13","EAN_8","UPC_A","UPC_E","CODE_128","CODE_39","ITF","DATA_MATRIX","AZTEC","OTHER"]},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"boundingRegion":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]}},"required":["data","type","page"]}},{"type":"null"}]},"paymentLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string","enum":["text","hyperlink","qr_code","barcode"]}},"required":["url","source"]}},{"type":"null"}]},"folio":{"anyOf":[{"type":"object","properties":{"arrivalDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"departureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roomNumber":{"type":["string","null"]},"guestName":{"type":["string","null"]},"nights":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"confirmationNumber":{"type":["string","null"]}}},{"type":"null"}]},"enrichedFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"check":{"anyOf":[{"type":"object","properties":{"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountText":{"type":["string","null"]},"amountsAgree":{"type":["boolean","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"checkNumber":{"type":["string","null"]},"checkType":{"anyOf":[{"type":"string","enum":["bank_draft","bill_pay_draft","business_check","cashiers_check","government_check","money_order","personal_check","starter_check","teller_check"]},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"memo":{"type":["string","null"]},"payerName":{"type":["string","null"]},"payerAddress":{"type":["string","null"]},"receiverName":{"type":["string","null"]},"receiverAddress":{"type":["string","null"]},"isSigned":{"type":["boolean","null"]},"endorsement":{"anyOf":[{"type":"object","properties":{"isEndorsed":{"type":["boolean","null"]},"isSigned":{"type":["boolean","null"]},"mobileOrRemoteDeposit":{"anyOf":[{"type":"object","properties":{"checkbox":{"type":["boolean","null"]},"instructions":{"type":["boolean","null"]}}},{"type":"null"}]},"isMobileOrRemoteDepositOnly":{"type":["boolean","null"]}}},{"type":"null"}]},"micr":{"anyOf":[{"type":"object","properties":{"routingNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"serialNumber":{"type":["string","null"]},"raw":{"type":["string","null"]},"branch":{"type":["string","null"]},"institution":{"type":["string","null"]},"transactionCode":{"type":["string","null"]}}},{"type":"null"}]},"fractionalRoutingNumber":{"type":["string","null"]},"routingFromFractional":{"type":["string","null"]},"voidTerms":{"type":["string","null"]}}},{"type":"null"}]},"statement":{"anyOf":[{"type":"object","properties":{"accountHolderName":{"type":["string","null"]},"accountHolderAddress":{"type":["string","null"]},"accountType":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"bankWebsite":{"type":["string","null"]},"bankVatNumber":{"type":["string","null"]},"accountVatNumber":{"type":["string","null"]},"periodStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementNumber":{"type":["string","null"]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"minimumDueMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"routingNumber":{"type":["string","null"]},"swift":{"type":["string","null"]},"iban":{"type":["string","null"]},"accounts":{"default":[],"type":"array","items":{"type":"object","properties":{"number":{"type":["string","null"]},"ibanNumber":{"type":["string","null"]},"accountType":{"type":["string","null"]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"summaries":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["name"]}},"transactions":{"default":[],"type":"array","items":{"type":"object","properties":{"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"postedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"vendor":{"type":["string","null"]},"transactionId":{"type":["string","null"]},"debitAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"creditAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cardNumber":{"type":["string","null"]},"text":{"type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["order"]}}}}},"balancesAgree":{"type":["boolean","null"]}}},{"type":"null"}]},"taxForm":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["W2","W9","W8BEN_E"]},"w2":{"anyOf":[{"type":"object","properties":{"employeeSsn":{"type":["string","null"]},"ein":{"type":["string","null"]},"employerName":{"type":["string","null"]},"employerAddress":{"type":["string","null"]},"controlNumber":{"type":["string","null"]},"employeeName":{"type":["string","null"]},"employeeAddress":{"type":["string","null"]},"wagesOtherComps":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"federalIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"allocatedTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"advanceEicPayment":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dependentCareBenefits":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"nonQualifiedPlans":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"box12":{"default":[],"type":"array","items":{"type":"object","properties":{"box":{"type":"string"},"code":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["box","code"]}},"is13a":{"type":["boolean","null"]},"is13b":{"type":["boolean","null"]},"is13c":{"type":["boolean","null"]},"box14Other":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["label"]}},"stateLines":{"default":[],"type":"array","items":{"type":"object","properties":{"state":{"type":["string","null"]},"employerStateId":{"type":["string","null"]},"stateWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"stateIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localityName":{"type":["string","null"]}}}},"taxYear":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"w9":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"businessName":{"type":["string","null"]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"individual":{"type":["boolean","null"]},"cCorp":{"type":["boolean","null"]},"sCorp":{"type":["boolean","null"]},"partnership":{"type":["boolean","null"]},"trustEstate":{"type":["boolean","null"]},"llc":{"type":["boolean","null"]},"llcType":{"type":["string","null"]},"other":{"type":["boolean","null"]},"otherDescription":{"type":["string","null"]},"exemptPayeeCode":{"type":["string","null"]},"exemption":{"type":["string","null"]},"ssn":{"type":["string","null"]},"ein":{"type":["string","null"]},"accountNumbers":{"type":["string","null"]},"requester":{"type":["string","null"]},"signature":{"type":["boolean","null"]},"signatureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}},{"type":"null"}]},"w8BenE":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","boolean","null"]}},{"type":"null"}]}},"required":["kind"]},{"type":"null"}]},"itinerary":{"anyOf":[{"type":"object","properties":{"travelerName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"returnsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"segments":{"default":[],"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]}}}},{"type":"null"}]},"fieldConfidence":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fieldBoxes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"page":{"type":"number"},"box":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4}},"required":["page","box"]}}},"description":"What was read, as the extraction contract types it. fieldConfidence holds per-field confidence, 0..1."},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["tax_rate_mismatch","item_counts_mismatch","totals_mismatch","line_item_amount_mismatch","line_item_repeats","barcode_decoding_issue","barcode_code_missing_in_ocr","logo_vendor_mismatch","malware","weekend_transaction","time_and_currency_mismatch","exif_creation_modified_date_mismatch","missing_date","suspicious_document_aspect_ratio","generic_placeholder_content"]},"message":{"type":"string"},"page":{"type":["number","null"]}},"required":["code","message"]},"description":"Integrity findings. A caller without expenses.read_all sees the arithmetic and dates only."}},"required":["fields","confidence","flags","warnings"]},{"type":"null"}]},"fraud":{"anyOf":[{"type":"object","properties":{"version":{"type":"string"},"score":{"type":"number","description":"0 to 1, from the signals that fired. Evidence, never a verdict."},"color":{"type":"string","enum":["green","yellow","red"],"description":"Under the workspace yellow threshold is green. Over its red threshold is red."},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"description":"Signals that fired, most important first."},"details":{"type":"object","propertyNames":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"additionalProperties":{"type":"object","properties":{"description":{"type":"string"},"confidence":{"type":"number","description":"How sure the detector is of what it saw, 0 to 1. Not how likely fraud is."},"reasons":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Stable."},"description":{"type":"string","description":"Written for a person."},"field":{"description":"Where it was read: exif:Software, totalMinor.","type":["string","null"]},"value":{"type":["string","null"]},"page":{"description":"Zero-based.","type":["number","null"]},"score":{"type":["number","null"]},"box":{"description":"Where on the page, as fractions of its size: x, y, width, height.","anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]}},"required":["name","description"]}}},"required":["description","confidence","reasons"]},"description":"By signal: a description, a confidence and typed reasons."},"attribution":{"description":"One sentence naming the strongest evidence.","type":["string","null"]},"decision":{"type":"string","enum":["clear","review","fraud","not_fraud","unknown"],"description":"clear or review until a person decides. Only a person can say fraud."},"review":{"anyOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["FRAUD","NOT_FRAUD","UNKNOWN"]},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},"note":{"type":["string","null"]},"reviewedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"reviewedAt":{"type":"string"}},"required":["decision","types","note","reviewedBy","reviewedAt"]},{"type":"null"}]},"deviceId":{"description":"The id the client sent for its device, when it sent one.","type":["string","null"]},"submissions":{"anyOf":[{"type":"object","properties":{"lastMinutes":{"type":"number"},"lastDay":{"type":"number"},"lastWeek":{"type":"number"},"last2Weeks":{"type":"number"},"lastMonth":{"type":"number"}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]},{"type":"null"}],"description":"Documents from this uploader in this workspace, by window."},"deviceProfiles":{"type":"array","items":{"type":"object","properties":{"deviceId":{"type":"string"},"profileId":{"type":"string"},"documentCount":{"type":"number"}},"required":["deviceId","profileId","documentCount"]},"description":"Over 30 days, inside this workspace only."},"digitalTamperingFields":{"type":"array","items":{"type":"string"}},"handwriting":{"type":"object","properties":{"handwrittenFields":{"type":"array","items":{"type":"string"}},"fullyHandwrittenFields":{"type":"array","items":{"type":"string"}},"handwrittenTamperedFields":{"type":"array","items":{"type":"string"}},"handwritingDetected":{"type":["boolean","null"]},"handwritingTamperingPresent":{"type":["boolean","null"]}},"required":["handwrittenFields","fullyHandwrittenFields","handwrittenTamperedFields","handwritingDetected","handwritingTamperingPresent"],"description":"What Claude saw written by hand, in dot notation, when a key is set and the handwriting signal is on. With no key, the lists are empty and the flags null: skipped says why."},"notADocument":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"digitalBackground":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"fraudulentPdf":{"anyOf":[{"type":"object","properties":{"fraudulentPdfCreator":{"type":["number","null"]},"textOverlay":{"type":["number","null"]},"fontMismatch":{"type":["number","null"]},"hasDigitalSignature":{"type":["boolean","null"]},"pdfModified":{"type":["number","null"]},"incrementalUpdates":{"type":["number","null"]},"incrementalChanges":{"type":"array","items":{"type":"string"}},"incrementalEdits":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["page","before","after"]}},"signatureCreationTools":{"type":"array","items":{"type":"string"}},"dateInversion":{"type":["number","null"]},"producerContentMismatch":{"type":["number","null"]},"writerMismatch":{"type":["number","null"]},"nullMetadata":{"type":["number","null"]},"xmpInfoMismatch":{"type":["number","null"]},"futureMetadataDate":{"type":["number","null"]},"rasterProfileMismatch":{"type":["number","null"]},"uncompressedRaster":{"type":["number","null"]},"splicedPage":{"type":["number","null"]},"splicedPageNumber":{"type":["number","null"]},"valueFontSplice":{"type":["number","null"]},"valueFontSplicePage":{"type":["number","null"]},"headlessDesktopRender":{"type":["number","null"]},"headlessRenderPlatform":{"type":["string","null"]},"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["fraudulentPdfCreator","textOverlay","fontMismatch","hasDigitalSignature","pdfModified","incrementalUpdates","incrementalChanges","incrementalEdits","signatureCreationTools","dateInversion","producerContentMismatch","writerMismatch","nullMetadata","xmpInfoMismatch","futureMetadataDate","rasterProfileMismatch","uncompressedRaster","splicedPage","splicedPageNumber","valueFontSplice","valueFontSplicePage","headlessDesktopRender","headlessRenderPlatform","doubleJpeg","firstQuantizationQuality","scrubbedProvenance","score"],"description":"Every key is always reported, so a check nothing could answer is null rather than missing."},{"type":"null"}]},"fraudulentImage":{"anyOf":[{"type":"object","properties":{"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"editorSignature":{"type":["number","null"]},"editorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"editorSignatureValue":{"type":["string","null"]},"generatorSignature":{"type":["number","null"]},"generatorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"generatorSignatureValue":{"type":["string","null"]},"generatorWriterProfile":{"type":["number","null"]},"generatorWriterProfileValue":{"type":["string","null"]},"syntheticRaster":{"type":["number","null"]},"syntheticRasterFingerprints":{"type":"array","items":{"type":"string"}},"unprofiledPng":{"type":["number","null"]},"unprofiledWebp":{"type":["number","null"]},"source":{"anyOf":[{"type":"string","enum":["original","render"]},{"type":"null"}]},"sourceFormats":{"type":"array","items":{"type":"string"}},"unreadableSource":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["doubleJpeg","firstQuantizationQuality","scrubbedProvenance","editorSignature","editorSignatureField","editorSignatureValue","generatorSignature","generatorSignatureField","generatorSignatureValue","generatorWriterProfile","generatorWriterProfileValue","syntheticRaster","syntheticRasterFingerprints","unprofiledPng","unprofiledWebp","source","sourceFormats","unreadableSource","score"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}]},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Value null means nothing could say: no pixel model runs, only metadata can answer."},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]}},"required":["index","isBlurry","isLcd","screenshot","aiGenerated","glare"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"reason":{"type":"string"}},"required":["check","reason"]},"description":"Checks that could not run on this file, so a clean result is not read as more than it is."}},"required":["version","score","color","types","details","attribution","decision","review","deviceId","submissions","deviceProfiles","digitalTamperingFields","handwriting","notADocument","digitalBackground","fraudulentPdf","fraudulentImage","pages","skipped"],"description":"Evidence for a reviewer. Null until inspected, and for a caller without expenses.read_all."},{"type":"null"}]},"sealed":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]},"masked":{"type":"string","description":"All but the last few characters are stars. Punctuation stays where it was."},"field":{"type":["string","null"]},"page":{"type":"number"}},"required":["kind","masked","field","page"]},"description":"Bank and tax numbers read from this document, as masks. POST /v1/documents/{id}/reveal opens them."},"updatedAt":{"type":"string"},"extractor":{"description":"What read it: rules, claude, a blueprint, business-card, or none.","type":["string","null"]},"ocrText":{"description":"Everything read off the page. Card, bank and tax numbers are masked.","type":["string","null"]},"pdfUrl":{"description":"The PDF as uploaded, signed for 15 minutes. Null for an image, and for a PDF that prints a number only a reveal hands out.","type":["string","null"]},"meta":{"type":"object","properties":{"totalPages":{"type":"number"},"processedPages":{"type":"number"},"ocrScore":{"description":"The average character confidence of the reading, which doubles as a measure of the image.","type":["number","null"]},"originalFileName":{"type":["string","null"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"language":{"description":"BCP-47.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]},"description":"Every language found, best first."},"deviceId":{"type":["string","null"]},"deviceUserUuid":{"description":"The signed-in person the device was capturing for. Null when no device was named.","type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"sourceDocuments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Each file as submitted: name, type, size in KB, width, height and EXIF."},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}],"description":"Who uploaded it."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."}},"required":["totalPages","processedPages","ocrScore","originalFileName","source","language","languages","deviceId","deviceUserUuid","latitude","longitude","sourceDocuments","owner","duplicates"]},"reviewedAt":{"description":"A person checked what was read.","type":["string","null"]},"approvedAt":{"description":"A developer's own approved flag. An expense's approval is a different thing.","type":["string","null"]},"object":{"description":"Set on the answer to a ZIP, which holds kind, documentIds and refused instead of a document.","type":"string","const":"document_set"},"kind":{"type":"string"},"documentIds":{"type":"array","items":{"type":"string"}},"refused":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":"string"}},"required":["name","reason"]}}},"required":["id","status"]},"InboundEmailPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"string"},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["RECEIVED","PROCESSED","NO_ATTACHMENT","UNKNOWN_SENDER","OVER_LIMIT","REJECTED","FAILED"]},"detail":{"type":["string","null"]},"documentCount":{"type":"number"},"hasAttachment":{"type":"boolean"},"refusedFiles":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":"string"}},"required":["name","reason"]}},"receivedAt":{"type":"string"}},"required":["id","from","subject","status","detail","documentCount","hasAttachment","refusedFiles","receivedAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExpenseDuplicateGroup":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string"},"status":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},"kind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"merchantName":{"type":["string","null"]},"tripTitle":{"description":"For a trip, what to call it in a list.","type":["string","null"]},"description":{"type":["string","null"]},"date":{"type":"string"},"currency":{"type":"string"},"amountMinor":{"type":"number"},"baseAmountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"alsoCategories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Further categories it can be found under. Its money stays in category."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]}},"required":["id","name","code"]},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"moneyFlow":{"type":"string","enum":["IN","OUT"],"description":"Which way the money went."},"invoiceNumber":{"type":["string","null"]},"matched":{"type":"boolean","description":"A card charge has been matched to it."},"connectedApps":{"type":"array","items":{"type":"string"},"description":"Connected services it has been posted to."},"reportId":{"type":["string","null"]},"externalId":{"description":"A developer's own reference, exactly as sent.","type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["info","warn","block"]},"by":{"description":"Who put it there, where that decides who may take it off.","type":"string"}},"required":["code","message","severity"]}},"reviewFields":{"type":"array","items":{"type":"string"}},"thumbnailUrl":{"type":["string","null"]},"documentId":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":["string","null"]}},"required":["id","name","color"]}},"attendeeCount":{"type":"number"},"fxRate":{"type":"number","description":"What one unit of the expense currency is worth in the base currency. Zero means no rate is available yet, so baseAmountMinor is zero too and the expense is held in review."},"held":{"type":"boolean","description":"Held back from its report until someone releases it."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"notes":{"type":["string","null"]},"subtotalMinor":{"type":["number","null"]},"tipMinor":{"type":["number","null"]},"discountMinor":{"type":["number","null"]},"shippingMinor":{"type":["number","null"]},"paymentAccountId":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"poNumber":{"description":"The buyer's purchase order number, as an invoice prints it.","type":["string","null"]},"dueDate":{"description":"When an invoice falls due.","type":["string","null"]},"mcc":{"description":"The merchant category code a card network gave the merchant, four digits.","type":["string","null"]},"taxDeductible":{"type":"boolean"},"quantity":{"type":["number","null"]},"rateMinor":{"type":["number","null"]},"unit":{"type":["string","null"]},"trip":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"vehicleId":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"required":["name"]}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"editedFields":{"type":"array","items":{"type":"string"}},"duplicateOfId":{"type":["string","null"]},"duplicateReview":{"anyOf":[{"type":"object","properties":{"outcome":{"type":"string","enum":["DISMISSED","KEPT"]},"reason":{"type":"string"},"engine":{"type":"string","enum":["rules","claude"]},"at":{"type":"string"}},"required":["outcome","reason","engine","at"]},{"type":"null"}],"description":"What the second look at a flagged copy decided, and why."},"canSettleDuplicate":{"type":"boolean","description":"Whether the caller can answer the duplicate question on this expense."},"splitParentId":{"type":["string","null"]},"access":{"type":"object","properties":{"canEdit":{"type":"boolean"},"limited":{"type":"boolean","description":"Out for approval: only the amount, description, merchant, date, category, tags and attendees can change."},"reason":{"description":"Why it cannot be edited, or how far it can, in words for the person looking at it.","type":["string","null"]},"amountLocked":{"type":"boolean","description":"The amount is a card's own figure."},"canDelete":{"type":"boolean"},"canRestore":{"type":"boolean"},"restoreBlocked":{"description":"Why it cannot be restored: split, or merged, for good.","type":["string","null"]},"canSplit":{"type":"boolean"},"canMove":{"type":"boolean"}},"required":["canEdit","limited","reason","amountLocked","canDelete","canRestore","restoreBlocked","canSplit","canMove"],"description":"What the caller may do with it."},"splitInto":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"amountMinor":{"type":"number"}},"required":["id","reference","amountMinor"]},"description":"This expense was divided: its parts now count in its place."},"mergedIntoId":{"description":"A merge absorbed this expense. Where it went.","type":["string","null"]},"report":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"}},"required":["id","title","status"]},{"type":"null"}],"description":"The report this expense is on, named even where the caller could not list it."},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"type":["number","null"]},"amountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"categoryId":{"type":["string","null"]}},"required":["id","position","description","sku","quantity","unitPriceMinor","amountMinor","taxMinor","categoryId"]}},"documentIds":{"type":"array","items":{"type":"string"}}},"required":["id","number","reference","status","kind","merchantName","tripTitle","description","date","currency","amountMinor","baseAmountMinor","taxMinor","category","alsoCategories","project","client","owner","moneyFlow","invoiceNumber","matched","connectedApps","reportId","externalId","billable","reimbursable","paymentType","confidence","flags","reviewFields","thumbnailUrl","documentId","tags","attendeeCount","fxRate","held","createdAt","updatedAt","notes","subtotalMinor","tipMinor","discountMinor","shippingMinor","paymentAccountId","cardLast4","poNumber","dueDate","mcc","taxDeductible","quantity","rateMinor","unit","trip","vehicleId","attendees","customFields","editedFields","duplicateOfId","duplicateReview","canSettleDuplicate","splitParentId","access","splitInto","mergedIntoId","report","lines","documentIds"]}},"hidden":{"type":"number","description":"Copies in the group the caller cannot read."}},"required":["data","hidden"]},"WorkflowRun":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"version":{"type":"number"},"status":{"type":"string","enum":["RUNNING","PAUSED","COMPLETED","FAILED","CANCELLED"]},"trigger":{"type":"string","enum":["API","MANUAL","SCHEDULE","GMAIL","GOOGLE_DRIVE","DROPBOX","EMAIL"]},"startNodeId":{"type":"string"},"documents":{"type":"number"},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"nodeId":{"type":"string"},"type":{"type":"string","enum":["api_import","document_aggregator","google_drive_import","gmail_input","dropbox_import","email_collector","ai_agent","convert_csv","convert_excel","decision","document_classifier","email_approval","extract_data","extract_data_set","pdf_splitter","split_collector","business_insights","email_file","google_drive","dropbox","google_sheets","xero_export"]},"label":{"type":"string"},"status":{"type":"string","enum":["PENDING","RUNNING","WAITING","DONE","SKIPPED","FAILED"]},"message":{"type":["string","null"]},"documents":{"type":"number"},"files":{"type":"array","items":{"type":"object","properties":{"exportJobId":{"type":"string"},"filename":{"type":"string"},"rows":{"type":"number"},"url":{"description":"A signed link, or null once the file has expired.","type":["string","null"]}},"required":["exportJobId","filename","rows","url"]}},"table":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"type":["string","number","null"]}}},"totalRows":{"type":"number"}},"required":["title","columns","rows","totalRows"]},{"type":"null"}]},"approval":{"anyOf":[{"type":"object","properties":{"recipients":{"type":"array","items":{"type":"string"}},"expiresAt":{"type":"string"},"decision":{"anyOf":[{"type":"string","enum":["approve","reject"]},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]}},"required":["recipients","expiresAt","decision","decidedBy","decidedAt"]},{"type":"null"}]},"startedAt":{"type":["string","null"]},"finishedAt":{"type":["string","null"]}},"required":["id","nodeId","type","label","status","message","documents","files","table","approval","startedAt","finishedAt"]}}},"required":["id","workflowId","version","status","trigger","startNodeId","documents","error","createdAt","finishedAt","steps"]},"WorkflowRunSummary":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"version":{"type":"number"},"status":{"type":"string","enum":["RUNNING","PAUSED","COMPLETED","FAILED","CANCELLED"]},"trigger":{"type":"string","enum":["API","MANUAL","SCHEDULE","GMAIL","GOOGLE_DRIVE","DROPBOX","EMAIL"]},"startNodeId":{"type":"string"},"documents":{"type":"number"},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","workflowId","version","status","trigger","startNodeId","documents","error","createdAt","finishedAt"]},"WorkflowRunPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"version":{"type":"number"},"status":{"type":"string","enum":["RUNNING","PAUSED","COMPLETED","FAILED","CANCELLED"]},"trigger":{"type":"string","enum":["API","MANUAL","SCHEDULE","GMAIL","GOOGLE_DRIVE","DROPBOX","EMAIL"]},"startNodeId":{"type":"string"},"documents":{"type":"number"},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","workflowId","version","status","trigger","startNodeId","documents","error","createdAt","finishedAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable. Safe to branch on."},"message":{"type":"string","description":"Written for a person."},"details":{},"requestId":{"description":"Quote this when you contact support.","type":"string"}},"required":["code","message"]}},"required":["error"]},"Attachment":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string","description":"A signed link that lasts 15 minutes."}},"required":["id","filename","contentType","sizeBytes","url"]},"UploadTicket":{"type":"object","properties":{"uploadId":{"type":"string"},"method":{"type":"string","const":"PUT"},"url":{"type":"string","description":"Send exactly sizeBytes bytes here, with these headers. It goes straight to storage."},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The signature covers these, so send them exactly."},"expiresAt":{"type":"string","description":"When the URL stops working. If a PUT fails, ask for a new ticket and try once more."}},"required":["uploadId","method","url","headers","expiresAt"]},"AnalyticsSummary":{"type":"object","properties":{"totalMinor":{"type":"number"},"count":{"type":"number"},"averageMinor":{"type":"number"},"unconverted":{"type":"number","description":"Expenses with no exchange rate yet. They are not in these totals."},"reimbursableMinor":{"type":"number"},"billableMinor":{"type":"number"},"previous":{"type":"object","properties":{"totalMinor":{"type":"number"},"count":{"type":"number"},"averageMinor":{"type":"number"}},"required":["totalMinor","count","averageMinor"]},"changePct":{"type":["number","null"]},"from":{"type":"string"},"to":{"type":"string"},"previousFrom":{"type":"string"},"previousTo":{"type":"string"},"currency":{"type":"string","description":"Every amount here is in this currency: the workspace's base, or the one `groupCurrency` asked for."},"convertedFrom":{"description":"Set when `groupCurrency` converted the amounts: the currency they were in, at the latest rate.","type":["string","null"]}},"required":["totalMinor","count","averageMinor","unconverted","reimbursableMinor","billableMinor","previous","changePct","from","to","previousFrom","previousTo","currency","convertedFrom"]},"Breakdown":{"type":"object","properties":{"dimension":{"type":"string","enum":["merchant","category","project","member","tag","department"]},"totalMinor":{"type":"number"},"previousTotalMinor":{"type":"number"},"averageMinor":{"type":"number","description":"What one row spends on average in this period, over every row and not only those within `limit`."},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"description":"The category, merchant, member, project, tag or department. Null is the row for expenses with none.","type":["string","null"]},"label":{"type":"string"},"totalMinor":{"type":"number"},"count":{"type":"number"},"previousMinor":{"type":"number"},"changePct":{"type":["number","null"]},"sharePct":{"type":"number","description":"Of the period's total, one decimal."}},"required":["id","label","totalMinor","count","previousMinor","changePct","sharePct"]}},"other":{"anyOf":[{"type":"object","properties":{"totalMinor":{"type":"number"},"count":{"type":"number"},"previousMinor":{"type":"number"}},"required":["totalMinor","count","previousMinor"]},{"type":"null"}],"description":"Everything past `limit`. Null when every row fits."},"overlapping":{"type":"boolean","description":"True for tags: one expense can carry several, so rows can add up to more than the total."},"from":{"type":"string"},"to":{"type":"string"},"previousFrom":{"type":"string"},"previousTo":{"type":"string"},"currency":{"type":"string","description":"Every amount here is in this currency: the workspace's base, or the one `groupCurrency` asked for."},"convertedFrom":{"description":"Set when `groupCurrency` converted the amounts: the currency they were in, at the latest rate.","type":["string","null"]}},"required":["dimension","totalMinor","previousTotalMinor","averageMinor","rows","other","overlapping","from","to","previousFrom","previousTo","currency","convertedFrom"]},"Trend":{"type":"object","properties":{"interval":{"type":"string","enum":["day","week","month","quarter","year","running"]},"points":{"type":"array","items":{"type":"object","properties":{"totalMinor":{"type":"number","description":"Added up from the start of the period when the interval is `running`, like `count` and `sharePct`."},"count":{"type":"number"},"sharePct":{"type":"number","description":"Of the period's total, one decimal."},"previousLabel":{"description":"The point at the same position in the previous period.","type":["string","null"]},"previousMinor":{"type":"number"},"start":{"type":"string","description":"The days this point covers, cut to the period at either end."},"end":{"type":"string"},"label":{"type":"string"},"shortLabel":{"type":"string"}},"required":["totalMinor","count","sharePct","previousLabel","previousMinor","start","end","label","shortLabel"]}},"totalMinor":{"type":"number"},"count":{"type":"number"},"averageMinor":{"type":"number","description":"What one point spends on average. For a running total, what each step adds on average."},"from":{"type":"string"},"to":{"type":"string"},"previousFrom":{"type":"string"},"previousTo":{"type":"string"},"currency":{"type":"string","description":"Every amount here is in this currency: the workspace's base, or the one `groupCurrency` asked for."},"convertedFrom":{"description":"Set when `groupCurrency` converted the amounts: the currency they were in, at the latest rate.","type":["string","null"]}},"required":["interval","points","totalMinor","count","averageMinor","from","to","previousFrom","previousTo","currency","convertedFrom"]},"Budget":{"type":"object","properties":{"id":{"type":"string"},"scope":{"type":"string","enum":["CATEGORY","TAG","MEMBER"]},"targetId":{"type":"string"},"targetName":{"type":"string"},"period":{"type":"string","enum":["MONTH","YEAR"]},"periodKey":{"type":"string","description":"2026-03 for a month, 2026 for a fiscal year."},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"currency":{"type":"string"},"totalMinor":{"type":["number","null"]},"perMemberMinor":{"type":["number","null"]},"thresholds":{"type":"array","items":{"type":"number"}},"total":{"anyOf":[{"type":"object","properties":{"limitMinor":{"type":"number"},"spentMinor":{"type":"number","description":"Approved or paid."},"pendingMinor":{"type":"number","description":"Not void or rejected, and not approved yet: what is on its way."},"remainingMinor":{"type":"number","description":"Below zero once the limit is passed."},"percentUsed":{"type":"number","description":"Of the limit, rounded down."}},"required":["limitMinor","spentMinor","pendingMinor","remainingMinor","percentUsed"]},{"type":"null"}],"description":"Everyone together. Null when the budget has no shared limit."},"mine":{"anyOf":[{"type":"object","properties":{"limitMinor":{"type":"number"},"spentMinor":{"type":"number","description":"Approved or paid."},"pendingMinor":{"type":"number","description":"Not void or rejected, and not approved yet: what is on its way."},"remainingMinor":{"type":"number","description":"Below zero once the limit is passed."},"percentUsed":{"type":"number","description":"Of the limit, rounded down."}},"required":["limitMinor","spentMinor","pendingMinor","remainingMinor","percentUsed"]},{"type":"null"}],"description":"The caller's own share. Null when they have no limit of their own here."}},"required":["id","scope","targetId","targetName","period","periodKey","periodStart","periodEnd","currency","totalMinor","perMemberMinor","thresholds","total","mine"]},"BudgetPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope":{"type":"string","enum":["CATEGORY","TAG","MEMBER"]},"targetId":{"type":"string"},"targetName":{"type":"string"},"period":{"type":"string","enum":["MONTH","YEAR"]},"periodKey":{"type":"string","description":"2026-03 for a month, 2026 for a fiscal year."},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"currency":{"type":"string"},"totalMinor":{"type":["number","null"]},"perMemberMinor":{"type":["number","null"]},"thresholds":{"type":"array","items":{"type":"number"}},"total":{"anyOf":[{"type":"object","properties":{"limitMinor":{"type":"number"},"spentMinor":{"type":"number","description":"Approved or paid."},"pendingMinor":{"type":"number","description":"Not void or rejected, and not approved yet: what is on its way."},"remainingMinor":{"type":"number","description":"Below zero once the limit is passed."},"percentUsed":{"type":"number","description":"Of the limit, rounded down."}},"required":["limitMinor","spentMinor","pendingMinor","remainingMinor","percentUsed"]},{"type":"null"}],"description":"Everyone together. Null when the budget has no shared limit."},"mine":{"anyOf":[{"type":"object","properties":{"limitMinor":{"type":"number"},"spentMinor":{"type":"number","description":"Approved or paid."},"pendingMinor":{"type":"number","description":"Not void or rejected, and not approved yet: what is on its way."},"remainingMinor":{"type":"number","description":"Below zero once the limit is passed."},"percentUsed":{"type":"number","description":"Of the limit, rounded down."}},"required":["limitMinor","spentMinor","pendingMinor","remainingMinor","percentUsed"]},{"type":"null"}],"description":"The caller's own share. Null when they have no limit of their own here."}},"required":["id","scope","targetId","targetName","period","periodKey","periodStart","periodEnd","currency","totalMinor","perMemberMinor","thresholds","total","mine"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"BulkDocumentResult":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number","description":"Not found, not the caller's to change, or backing an expense on a submitted report."},"nextCursor":{"description":"With a filter: send this back as cursor until it is null.","type":["string","null"]}},"required":["updated","skipped"]},"DocumentCount":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]},"TrashActionResult":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"},"more":{"type":"boolean","description":"With all: there is more to do. Call again."}},"required":["updated","skipped","more"]},"TrashedDocumentPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"title":{"type":["string","null"]},"originalFilename":{"type":["string","null"]},"sizeBytes":{"type":"number"},"thumbnailUrl":{"type":["string","null"]},"deletedAt":{"type":"string"},"purgeOn":{"type":"string","description":"YYYY-MM-DD. The day this document and its files are deleted for good."}},"required":["id","type","title","originalFilename","sizeBytes","thumbnailUrl","deletedAt","purgeOn"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"BulkExpenseResult":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"}},"required":["updated","skipped"]},"BulkReportResult":{"type":"object","properties":{"succeeded":{"type":"array","items":{"type":"string"}},"failed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":["string","null"]},"code":{"type":"string"},"message":{"type":"string"}},"required":["id","reference","code","message"]}}},"required":["succeeded","failed"]},"CatalogImportResult":{"type":"object","properties":{"created":{"type":"number"},"updated":{"type":"number"},"skipped":{"type":"number","description":"Rows that matched an existing record and changed nothing, or repeated an earlier row."},"errors":{"type":"array","items":{"type":"object","properties":{"line":{"type":"number"},"message":{"type":"string"}},"required":["line","message"]},"description":"Rows that could not be used. `line` counts from 1 and includes the header."},"removed":{"description":"A replace: categories the file left out and nothing used, now deleted.","type":"number"},"disabled":{"description":"A replace: categories the file left out that something still uses, now turned off.","type":"number"}},"required":["created","updated","skipped","errors"]},"Category":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":["string","null"]},"name":{"type":"string"},"glCode":{"type":["string","null"]},"taxLine":{"type":["string","null"]},"origin":{"type":"string","enum":["SYSTEM","CUSTOM","ACCOUNTING"],"description":"Where it came from: the workspace template, a person, or an import from the connected books."},"deductiblePct":{"type":"number"},"headerOnly":{"type":"boolean","description":"A heading over its subcategories. It groups the list and cannot be chosen on an expense."},"enabled":{"type":"boolean"},"system":{"type":"boolean"},"position":{"type":"number"},"expenseCount":{"type":"number","description":"A category on any expense cannot be deleted, only disabled."},"type":{"type":"string","enum":["EXPENSE","COGS","INCOME","REFUND"]},"payrollCode":{"description":"Null unless the caller manages settings or exports: payroll codes are not for everyone.","type":["string","null"]},"descriptionHint":{"description":"Shown under the description while someone fills in an expense.","type":["string","null"]},"approverId":{"description":"Sees any report carrying this category before the usual approvers.","type":["string","null"]},"approverName":{"type":["string","null"]},"commentRequired":{"type":"boolean","description":"An expense here needs a description, or it carries a finding on its report."},"maxExpenseMinor":{"description":"An expense here over this, in the workspace's currency, carries a finding on its report.","type":["number","null"]}},"required":["id","parentId","name","glCode","taxLine","origin","deductiblePct","headerOnly","enabled","system","position","expenseCount","type","payrollCode","descriptionHint","approverId","approverName","commentRequired","maxExpenseMinor"]},"CategoryPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":["string","null"]},"name":{"type":"string"},"glCode":{"type":["string","null"]},"taxLine":{"type":["string","null"]},"origin":{"type":"string","enum":["SYSTEM","CUSTOM","ACCOUNTING"],"description":"Where it came from: the workspace template, a person, or an import from the connected books."},"deductiblePct":{"type":"number"},"headerOnly":{"type":"boolean","description":"A heading over its subcategories. It groups the list and cannot be chosen on an expense."},"enabled":{"type":"boolean"},"system":{"type":"boolean"},"position":{"type":"number"},"expenseCount":{"type":"number","description":"A category on any expense cannot be deleted, only disabled."},"type":{"type":"string","enum":["EXPENSE","COGS","INCOME","REFUND"]},"payrollCode":{"description":"Null unless the caller manages settings or exports: payroll codes are not for everyone.","type":["string","null"]},"descriptionHint":{"description":"Shown under the description while someone fills in an expense.","type":["string","null"]},"approverId":{"description":"Sees any report carrying this category before the usual approvers.","type":["string","null"]},"approverName":{"type":["string","null"]},"commentRequired":{"type":"boolean","description":"An expense here needs a description, or it carries a finding on its report."},"maxExpenseMinor":{"description":"An expense here over this, in the workspace's currency, carries a finding on its report.","type":["number","null"]}},"required":["id","parentId","name","glCode","taxLine","origin","deductiblePct","headerOnly","enabled","system","position","expenseCount","type","payrollCode","descriptionHint","approverId","approverName","commentRequired","maxExpenseMinor"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"CommentPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"body":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string","description":"A signed link that lasts 15 minutes."}},"required":["id","filename","contentType","sizeBytes","url"]}},"editedAt":{"type":["string","null"]},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"system":{"description":"PaperTotal wrote this, about something that happened to the report.","type":"boolean"},"actedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}],"description":"The delegate who really wrote it, when that was not the author."},"mentions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]}},"createdAt":{"type":"string"}},"required":["id","body","attachments","editedAt","author","actedBy","mentions","createdAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"CreatedId":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"PostedComment":{"type":"object","properties":{"id":{"type":"string"},"body":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string","description":"A signed link that lasts 15 minutes."}},"required":["id","filename","contentType","sizeBytes","url"]}},"editedAt":{"type":["string","null"]},"author":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"system":{"description":"PaperTotal wrote this, about something that happened to the report.","type":"boolean"},"actedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}],"description":"The delegate who really wrote it, when that was not the author."},"mentions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]}},"createdAt":{"type":"string"},"unreachable":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"description":"Members the comment named who cannot read this, so were not mentioned or told."}},"required":["id","body","attachments","editedAt","author","actedBy","mentions","createdAt","unreachable"]},"MentionablePeople":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]}}},"required":["data"]},"Contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"Always something to show: the name, else the company, else the first address or number."},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"company":{"type":["string","null"]},"title":{"type":["string","null"]},"emails":{"type":"array","items":{"type":"string"}},"phones":{"type":"array","items":{"type":"string"}},"mobile":{"type":["string","null"]},"fax":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"city":{"type":["string","null"]},"region":{"type":["string","null"]},"postalCode":{"type":["string","null"]},"country":{"type":["string","null"]},"notes":{"type":["string","null"]},"editedFields":{"type":"array","items":{"type":"string"},"description":"Fields a person changed, which reading the card again leaves alone."},"documentId":{"type":["string","null"]},"logoUrl":{"description":"The logo cut from the card, signed for 15 minutes. It stays when the card is deleted.","type":["string","null"]},"faxes":{"type":"array","items":{"type":"string"},"description":"Every fax number on the card, the first being fax."},"cardImageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","firstName","lastName","company","title","emails","phones","mobile","fax","website","address","city","region","postalCode","country","notes","editedFields","documentId","logoUrl","faxes","cardImageUrl","thumbnailUrl","createdAt","updatedAt"]},"ContactPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"Always something to show: the name, else the company, else the first address or number."},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"company":{"type":["string","null"]},"title":{"type":["string","null"]},"emails":{"type":"array","items":{"type":"string"}},"phones":{"type":"array","items":{"type":"string"}},"mobile":{"type":["string","null"]},"fax":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"city":{"type":["string","null"]},"region":{"type":["string","null"]},"postalCode":{"type":["string","null"]},"country":{"type":["string","null"]},"notes":{"type":["string","null"]},"editedFields":{"type":"array","items":{"type":"string"},"description":"Fields a person changed, which reading the card again leaves alone."},"documentId":{"type":["string","null"]},"logoUrl":{"description":"The logo cut from the card, signed for 15 minutes. It stays when the card is deleted.","type":["string","null"]},"faxes":{"type":"array","items":{"type":"string"},"description":"Every fax number on the card, the first being fax."},"cardImageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","firstName","lastName","company","title","emails","phones","mobile","fax","website","address","city","region","postalCode","country","notes","editedFields","documentId","logoUrl","faxes","cardImageUrl","thumbnailUrl","createdAt","updatedAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"CustomField":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","SELECT","BOOLEAN"]},"options":{"type":"array","items":{"type":"string"}},"required":{"type":"boolean"},"position":{"type":"number"}},"required":["id","key","label","type","options","required","position"]},"CustomFieldPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","SELECT","BOOLEAN"]},"options":{"type":"array","items":{"type":"string"}},"required":{"type":"boolean"},"position":{"type":"number"}},"required":["id","key","label","type","options","required","position"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"DeviceBlock":{"type":"object","properties":{"id":{"type":"string"},"deviceId":{"type":"string"},"reason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","deviceId","reason","createdAt"]},"DeviceBlockPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"deviceId":{"type":"string"},"reason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","deviceId","reason","createdAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"DeviceBlockStatus":{"type":"object","properties":{"deviceId":{"type":"string"},"blocked":{"type":"boolean"},"block":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"deviceId":{"type":"string"},"reason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","deviceId","reason","createdAt"]},{"type":"null"}]}},"required":["deviceId","blocked","block"]},"Document":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"originalFilename":{"type":["string","null"]},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"pageCount":{"type":"number"},"externalId":{"type":["string","null"]},"folderId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"mailInBatchId":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"latitude":{"description":"Where the device said it was when the photo was taken.","type":["number","null"]},"longitude":{"type":["number","null"]},"locationAccuracyM":{"type":["number","null"]},"duplicateOfId":{"type":["string","null"]},"processingError":{"type":["string","null"]},"processingErrorCode":{"anyOf":[{"type":"string","enum":["FILE_ENCRYPTED"]},{"type":"null"}],"description":"Set when the failure is one the file's owner can fix. processingError says what to do."},"verification":{"type":"string"},"capturedAt":{"type":["string","null"]},"processedAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"uploadedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all."},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}],"description":"Null when the page is not one, and for a caller without expenses.read_all."},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all. Value null means nothing could say."},"language":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]}},"ocrScore":{"type":["number","null"]},"isFront":{"description":"A check: the front or the back.","type":["boolean","null"]},"tiffRejectScore":{"description":"A check: 0 is a clean clearing image and 1 is one a bank would send back.","type":["number","null"]},"tiffUpscaled":{"description":"A check: the photo was under 240 DPI, so the clearing image was enlarged.","type":["boolean","null"]}},"required":["index","url","thumbnailUrl","width","height","isBlurry","glare","isLcd","screenshot","aiGenerated","language","languages","ocrScore","isFront","tiffRejectScore","tiffUpscaled"]}},"classification":{"anyOf":[{"type":"object","properties":{"value":{"type":"string","description":"A document class, or one of the labels the caller named."},"score":{"type":"number","description":"0..1."},"engine":{"type":"string","enum":["rules","claude"]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["value","score","engine","scores"]},{"type":"null"}],"description":"What the classifier decided, when it was asked."},"blueprint":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"description":"Null for a built-in, which has no versions.","type":["number","null"]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The fields the blueprint defines. Null when the run failed."},"offsets":{"description":"Where each value sits in the text, for a blueprint that asks.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"begin":{"type":"number"},"end":{"type":"number"}},"required":["begin","end"]}},"unmatched":{"description":"Fields where a value was read and did not fit, such as words where a number belongs or a choice off the list. Each is left empty. An empty field not named here was not on the document.","type":"array","items":{"type":"string"}},"error":{"description":"Why the run gave nothing back.","type":["string","null"]}},"required":["name","version","result","error"]},{"type":"null"}],"description":"The blueprint this was read with, and what came out of it."},"tags":{"type":"array","items":{"type":"string"}},"tagRefs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The same tags with their ids, which a tag route takes."},"recordStatus":{"anyOf":[{"type":"string","enum":["processed","reviewed","archived"]},{"type":"null"}],"description":"Where a read document stands: reviewedAt and archivedAt in one word. Null until it has been read."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."},"setId":{"description":"The upload this came out of: a ZIP, a split PDF or a batch of addresses.","type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}],"description":"Values the workspace custom field rules read out of the text."},"enrichment":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","DONE","FAILED"]},"steps":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"failed":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}}},"required":["status","steps","failed"]},{"type":"null"}],"description":"Work still running after the first answer."},"extraction":{"anyOf":[{"type":"object","properties":{"fields":{"type":"object","properties":{"documentType":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"merchantName":{"type":["string","null"]},"merchantAddress":{"type":["string","null"]},"merchantPhone":{"type":["string","null"]},"merchantWebsite":{"type":["string","null"]},"merchantTaxId":{"type":["string","null"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"time":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG","CUC","HRK","SLL","ZWL","XDR","XSU"]},{"type":"null"}]},"currencyGuessed":{"default":false,"type":"boolean"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxLines":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"code":{"type":["string","null"]},"totalInclusive":{"type":["boolean","null"]}},"required":["amountMinor"]}},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"cardBrand":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"receiptNumber":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"poNumber":{"type":["string","null"]},"lineItems":{"default":[],"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"id":{"type":["string","null"]},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["room","tax","parking","service","fee","delivery","product","food","alcohol","tobacco","transportation","fuel","refund","discount","payment","giftcard","donation","toll","lottery"]},{"type":"null"}]},"fullDescription":{"type":["string","null"]},"normalizedDescription":{"type":["string","null"]},"section":{"type":["string","null"]},"reference":{"type":["string","null"]},"upc":{"type":["string","null"]},"hsn":{"type":["string","null"]},"lot":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unitOfMeasure":{"type":["string","null"]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountRatePct":{"type":["number","null"]},"discountPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxRatePct":{"type":["number","null"]},"taxCode":{"type":["string","null"]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"grossTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"netTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"category":{"type":["string","null"]},"customCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countryOfOrigin":{"type":["string","null"]},"manufacturer":{"type":["string","null"]},"weight":{"type":["string","null"]},"brand":{"type":["string","null"]},"hsaFsaEligible":{"type":["boolean","null"]},"productInfo":{"anyOf":[{"type":"object","properties":{"expandedDescription":{"type":["string","null"]},"brand":{"type":["string","null"]},"categoryPath":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},{"type":"null"}]}},"required":["description","amountMinor"]}},"suggestedCategory":{"type":["string","null"]},"documentTitle":{"type":["string","null"]},"documentReferenceNumber":{"type":["string","null"]},"isDocument":{"type":["boolean","null"]},"isTransaction":{"type":["boolean","null"]},"isMoneyIn":{"type":["boolean","null"]},"accountingEntryType":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}]},"vendor":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"vendors":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}}},{"type":"null"}]},"bankBreakdown":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}}},{"type":"null"}]},"billTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"vatNumber":{"type":["string","null"]},"regNumber":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"email":{"type":["string","null"]}}},{"type":"null"}]},"shipTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"insuranceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cashbackMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"roundingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"finalBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"previousBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"totalQuantity":{"type":["number","null"]},"totalWeight":{"type":["string","null"]},"payment":{"anyOf":[{"type":"object","properties":{"cardNumber":{"type":["string","null"]},"displayName":{"type":["string","null"]},"terms":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["none","visa","master_card","cash","american_express","interac","other","maestro","discover","bancontact","girocard","applepay","paypal","bancomat","giftcard","card","check","bankaxept","bank-to-bank_transfer_bacs","octopus","pix","jcb","waon","mada","wechat","alipay","unionpay","googlepay","rupay","bpay","shopeepay","mir","giropay","food_stamp","diners_club","paypay"]},{"type":"null"}]}}},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"shipDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliveryDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"exchangeRate":{"type":["number","null"]},"countryCode":{"type":["string","null"]},"deliveryNoteNumber":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"trackingNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"incoterms":{"type":["string","null"]},"weights":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"licensePlateNumber":{"type":["string","null"]},"vinNumber":{"type":["string","null"]},"guestCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"serverName":{"type":["string","null"]},"storeNumber":{"type":["string","null"]},"vendingPerson":{"type":["string","null"]},"vendingPersonNumber":{"type":["string","null"]},"customerAccountNumber":{"type":["string","null"]},"category":{"type":["string","null"]},"defaultCategory":{"type":["string","null"]},"barcodes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"type":{"type":"string","enum":["QR_CODE","PDF417","EAN_13","EAN_8","UPC_A","UPC_E","CODE_128","CODE_39","ITF","DATA_MATRIX","AZTEC","OTHER"]},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"boundingRegion":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]}},"required":["data","type","page"]}},{"type":"null"}]},"paymentLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string","enum":["text","hyperlink","qr_code","barcode"]}},"required":["url","source"]}},{"type":"null"}]},"folio":{"anyOf":[{"type":"object","properties":{"arrivalDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"departureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roomNumber":{"type":["string","null"]},"guestName":{"type":["string","null"]},"nights":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"confirmationNumber":{"type":["string","null"]}}},{"type":"null"}]},"enrichedFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"check":{"anyOf":[{"type":"object","properties":{"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountText":{"type":["string","null"]},"amountsAgree":{"type":["boolean","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"checkNumber":{"type":["string","null"]},"checkType":{"anyOf":[{"type":"string","enum":["bank_draft","bill_pay_draft","business_check","cashiers_check","government_check","money_order","personal_check","starter_check","teller_check"]},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"memo":{"type":["string","null"]},"payerName":{"type":["string","null"]},"payerAddress":{"type":["string","null"]},"receiverName":{"type":["string","null"]},"receiverAddress":{"type":["string","null"]},"isSigned":{"type":["boolean","null"]},"endorsement":{"anyOf":[{"type":"object","properties":{"isEndorsed":{"type":["boolean","null"]},"isSigned":{"type":["boolean","null"]},"mobileOrRemoteDeposit":{"anyOf":[{"type":"object","properties":{"checkbox":{"type":["boolean","null"]},"instructions":{"type":["boolean","null"]}}},{"type":"null"}]},"isMobileOrRemoteDepositOnly":{"type":["boolean","null"]}}},{"type":"null"}]},"micr":{"anyOf":[{"type":"object","properties":{"routingNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"serialNumber":{"type":["string","null"]},"raw":{"type":["string","null"]},"branch":{"type":["string","null"]},"institution":{"type":["string","null"]},"transactionCode":{"type":["string","null"]}}},{"type":"null"}]},"fractionalRoutingNumber":{"type":["string","null"]},"routingFromFractional":{"type":["string","null"]},"voidTerms":{"type":["string","null"]}}},{"type":"null"}]},"statement":{"anyOf":[{"type":"object","properties":{"accountHolderName":{"type":["string","null"]},"accountHolderAddress":{"type":["string","null"]},"accountType":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"bankWebsite":{"type":["string","null"]},"bankVatNumber":{"type":["string","null"]},"accountVatNumber":{"type":["string","null"]},"periodStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementNumber":{"type":["string","null"]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"minimumDueMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"routingNumber":{"type":["string","null"]},"swift":{"type":["string","null"]},"iban":{"type":["string","null"]},"accounts":{"default":[],"type":"array","items":{"type":"object","properties":{"number":{"type":["string","null"]},"ibanNumber":{"type":["string","null"]},"accountType":{"type":["string","null"]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"summaries":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["name"]}},"transactions":{"default":[],"type":"array","items":{"type":"object","properties":{"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"postedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"vendor":{"type":["string","null"]},"transactionId":{"type":["string","null"]},"debitAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"creditAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cardNumber":{"type":["string","null"]},"text":{"type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["order"]}}}}},"balancesAgree":{"type":["boolean","null"]}}},{"type":"null"}]},"taxForm":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["W2","W9","W8BEN_E"]},"w2":{"anyOf":[{"type":"object","properties":{"employeeSsn":{"type":["string","null"]},"ein":{"type":["string","null"]},"employerName":{"type":["string","null"]},"employerAddress":{"type":["string","null"]},"controlNumber":{"type":["string","null"]},"employeeName":{"type":["string","null"]},"employeeAddress":{"type":["string","null"]},"wagesOtherComps":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"federalIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"allocatedTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"advanceEicPayment":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dependentCareBenefits":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"nonQualifiedPlans":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"box12":{"default":[],"type":"array","items":{"type":"object","properties":{"box":{"type":"string"},"code":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["box","code"]}},"is13a":{"type":["boolean","null"]},"is13b":{"type":["boolean","null"]},"is13c":{"type":["boolean","null"]},"box14Other":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["label"]}},"stateLines":{"default":[],"type":"array","items":{"type":"object","properties":{"state":{"type":["string","null"]},"employerStateId":{"type":["string","null"]},"stateWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"stateIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localityName":{"type":["string","null"]}}}},"taxYear":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"w9":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"businessName":{"type":["string","null"]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"individual":{"type":["boolean","null"]},"cCorp":{"type":["boolean","null"]},"sCorp":{"type":["boolean","null"]},"partnership":{"type":["boolean","null"]},"trustEstate":{"type":["boolean","null"]},"llc":{"type":["boolean","null"]},"llcType":{"type":["string","null"]},"other":{"type":["boolean","null"]},"otherDescription":{"type":["string","null"]},"exemptPayeeCode":{"type":["string","null"]},"exemption":{"type":["string","null"]},"ssn":{"type":["string","null"]},"ein":{"type":["string","null"]},"accountNumbers":{"type":["string","null"]},"requester":{"type":["string","null"]},"signature":{"type":["boolean","null"]},"signatureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}},{"type":"null"}]},"w8BenE":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","boolean","null"]}},{"type":"null"}]}},"required":["kind"]},{"type":"null"}]},"itinerary":{"anyOf":[{"type":"object","properties":{"travelerName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"returnsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"segments":{"default":[],"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]}}}},{"type":"null"}]},"fieldConfidence":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fieldBoxes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"page":{"type":"number"},"box":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4}},"required":["page","box"]}}},"description":"What was read, as the extraction contract types it. fieldConfidence holds per-field confidence, 0..1."},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["tax_rate_mismatch","item_counts_mismatch","totals_mismatch","line_item_amount_mismatch","line_item_repeats","barcode_decoding_issue","barcode_code_missing_in_ocr","logo_vendor_mismatch","malware","weekend_transaction","time_and_currency_mismatch","exif_creation_modified_date_mismatch","missing_date","suspicious_document_aspect_ratio","generic_placeholder_content"]},"message":{"type":"string"},"page":{"type":["number","null"]}},"required":["code","message"]},"description":"Integrity findings. A caller without expenses.read_all sees the arithmetic and dates only."}},"required":["fields","confidence","flags","warnings"]},{"type":"null"}]},"fraud":{"anyOf":[{"type":"object","properties":{"version":{"type":"string"},"score":{"type":"number","description":"0 to 1, from the signals that fired. Evidence, never a verdict."},"color":{"type":"string","enum":["green","yellow","red"],"description":"Under the workspace yellow threshold is green. Over its red threshold is red."},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"description":"Signals that fired, most important first."},"details":{"type":"object","propertyNames":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"additionalProperties":{"type":"object","properties":{"description":{"type":"string"},"confidence":{"type":"number","description":"How sure the detector is of what it saw, 0 to 1. Not how likely fraud is."},"reasons":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Stable."},"description":{"type":"string","description":"Written for a person."},"field":{"description":"Where it was read: exif:Software, totalMinor.","type":["string","null"]},"value":{"type":["string","null"]},"page":{"description":"Zero-based.","type":["number","null"]},"score":{"type":["number","null"]},"box":{"description":"Where on the page, as fractions of its size: x, y, width, height.","anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]}},"required":["name","description"]}}},"required":["description","confidence","reasons"]},"description":"By signal: a description, a confidence and typed reasons."},"attribution":{"description":"One sentence naming the strongest evidence.","type":["string","null"]},"decision":{"type":"string","enum":["clear","review","fraud","not_fraud","unknown"],"description":"clear or review until a person decides. Only a person can say fraud."},"review":{"anyOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["FRAUD","NOT_FRAUD","UNKNOWN"]},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},"note":{"type":["string","null"]},"reviewedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"reviewedAt":{"type":"string"}},"required":["decision","types","note","reviewedBy","reviewedAt"]},{"type":"null"}]},"deviceId":{"description":"The id the client sent for its device, when it sent one.","type":["string","null"]},"submissions":{"anyOf":[{"type":"object","properties":{"lastMinutes":{"type":"number"},"lastDay":{"type":"number"},"lastWeek":{"type":"number"},"last2Weeks":{"type":"number"},"lastMonth":{"type":"number"}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]},{"type":"null"}],"description":"Documents from this uploader in this workspace, by window."},"deviceProfiles":{"type":"array","items":{"type":"object","properties":{"deviceId":{"type":"string"},"profileId":{"type":"string"},"documentCount":{"type":"number"}},"required":["deviceId","profileId","documentCount"]},"description":"Over 30 days, inside this workspace only."},"digitalTamperingFields":{"type":"array","items":{"type":"string"}},"handwriting":{"type":"object","properties":{"handwrittenFields":{"type":"array","items":{"type":"string"}},"fullyHandwrittenFields":{"type":"array","items":{"type":"string"}},"handwrittenTamperedFields":{"type":"array","items":{"type":"string"}},"handwritingDetected":{"type":["boolean","null"]},"handwritingTamperingPresent":{"type":["boolean","null"]}},"required":["handwrittenFields","fullyHandwrittenFields","handwrittenTamperedFields","handwritingDetected","handwritingTamperingPresent"],"description":"What Claude saw written by hand, in dot notation, when a key is set and the handwriting signal is on. With no key, the lists are empty and the flags null: skipped says why."},"notADocument":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"digitalBackground":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"fraudulentPdf":{"anyOf":[{"type":"object","properties":{"fraudulentPdfCreator":{"type":["number","null"]},"textOverlay":{"type":["number","null"]},"fontMismatch":{"type":["number","null"]},"hasDigitalSignature":{"type":["boolean","null"]},"pdfModified":{"type":["number","null"]},"incrementalUpdates":{"type":["number","null"]},"incrementalChanges":{"type":"array","items":{"type":"string"}},"incrementalEdits":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["page","before","after"]}},"signatureCreationTools":{"type":"array","items":{"type":"string"}},"dateInversion":{"type":["number","null"]},"producerContentMismatch":{"type":["number","null"]},"writerMismatch":{"type":["number","null"]},"nullMetadata":{"type":["number","null"]},"xmpInfoMismatch":{"type":["number","null"]},"futureMetadataDate":{"type":["number","null"]},"rasterProfileMismatch":{"type":["number","null"]},"uncompressedRaster":{"type":["number","null"]},"splicedPage":{"type":["number","null"]},"splicedPageNumber":{"type":["number","null"]},"valueFontSplice":{"type":["number","null"]},"valueFontSplicePage":{"type":["number","null"]},"headlessDesktopRender":{"type":["number","null"]},"headlessRenderPlatform":{"type":["string","null"]},"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["fraudulentPdfCreator","textOverlay","fontMismatch","hasDigitalSignature","pdfModified","incrementalUpdates","incrementalChanges","incrementalEdits","signatureCreationTools","dateInversion","producerContentMismatch","writerMismatch","nullMetadata","xmpInfoMismatch","futureMetadataDate","rasterProfileMismatch","uncompressedRaster","splicedPage","splicedPageNumber","valueFontSplice","valueFontSplicePage","headlessDesktopRender","headlessRenderPlatform","doubleJpeg","firstQuantizationQuality","scrubbedProvenance","score"],"description":"Every key is always reported, so a check nothing could answer is null rather than missing."},{"type":"null"}]},"fraudulentImage":{"anyOf":[{"type":"object","properties":{"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"editorSignature":{"type":["number","null"]},"editorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"editorSignatureValue":{"type":["string","null"]},"generatorSignature":{"type":["number","null"]},"generatorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"generatorSignatureValue":{"type":["string","null"]},"generatorWriterProfile":{"type":["number","null"]},"generatorWriterProfileValue":{"type":["string","null"]},"syntheticRaster":{"type":["number","null"]},"syntheticRasterFingerprints":{"type":"array","items":{"type":"string"}},"unprofiledPng":{"type":["number","null"]},"unprofiledWebp":{"type":["number","null"]},"source":{"anyOf":[{"type":"string","enum":["original","render"]},{"type":"null"}]},"sourceFormats":{"type":"array","items":{"type":"string"}},"unreadableSource":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["doubleJpeg","firstQuantizationQuality","scrubbedProvenance","editorSignature","editorSignatureField","editorSignatureValue","generatorSignature","generatorSignatureField","generatorSignatureValue","generatorWriterProfile","generatorWriterProfileValue","syntheticRaster","syntheticRasterFingerprints","unprofiledPng","unprofiledWebp","source","sourceFormats","unreadableSource","score"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}]},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Value null means nothing could say: no pixel model runs, only metadata can answer."},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]}},"required":["index","isBlurry","isLcd","screenshot","aiGenerated","glare"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"reason":{"type":"string"}},"required":["check","reason"]},"description":"Checks that could not run on this file, so a clean result is not read as more than it is."}},"required":["version","score","color","types","details","attribution","decision","review","deviceId","submissions","deviceProfiles","digitalTamperingFields","handwriting","notADocument","digitalBackground","fraudulentPdf","fraudulentImage","pages","skipped"],"description":"Evidence for a reviewer. Null until inspected, and for a caller without expenses.read_all."},{"type":"null"}]},"sealed":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]},"masked":{"type":"string","description":"All but the last few characters are stars. Punctuation stays where it was."},"field":{"type":["string","null"]},"page":{"type":"number"}},"required":["kind","masked","field","page"]},"description":"Bank and tax numbers read from this document, as masks. POST /v1/documents/{id}/reveal opens them."},"updatedAt":{"type":"string"},"extractor":{"description":"What read it: rules, claude, a blueprint, business-card, or none.","type":["string","null"]},"ocrText":{"description":"Everything read off the page. Card, bank and tax numbers are masked.","type":["string","null"]},"pdfUrl":{"description":"The PDF as uploaded, signed for 15 minutes. Null for an image, and for a PDF that prints a number only a reveal hands out.","type":["string","null"]},"meta":{"type":"object","properties":{"totalPages":{"type":"number"},"processedPages":{"type":"number"},"ocrScore":{"description":"The average character confidence of the reading, which doubles as a measure of the image.","type":["number","null"]},"originalFileName":{"type":["string","null"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"language":{"description":"BCP-47.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]},"description":"Every language found, best first."},"deviceId":{"type":["string","null"]},"deviceUserUuid":{"description":"The signed-in person the device was capturing for. Null when no device was named.","type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"sourceDocuments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Each file as submitted: name, type, size in KB, width, height and EXIF."},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}],"description":"Who uploaded it."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."}},"required":["totalPages","processedPages","ocrScore","originalFileName","source","language","languages","deviceId","deviceUserUuid","latitude","longitude","sourceDocuments","owner","duplicates"]},"reviewedAt":{"description":"A person checked what was read.","type":["string","null"]},"approvedAt":{"description":"A developer's own approved flag. An expense's approval is a different thing.","type":["string","null"]}},"required":["id","type","source","status","originalFilename","mimeType","sizeBytes","pageCount","externalId","folderId","expenseId","mailInBatchId","title","notes","latitude","longitude","locationAccuracyM","duplicateOfId","processingError","processingErrorCode","verification","capturedAt","processedAt","viewedAt","archivedAt","createdAt","uploadedBy","pages","classification","blueprint","tags","tagRefs","recordStatus","duplicates","setId","customFields","enrichment","extraction","fraud","sealed","updatedAt","extractor","ocrText","pdfUrl","meta","reviewedAt","approvedAt"]},"DocumentOriginal":{"type":"object","properties":{"url":{"type":"string","description":"Signed for 15 minutes. Opening it downloads the file as uploaded."},"filename":{"type":"string"},"mimeType":{"type":"string"}},"required":["url","filename","mimeType"]},"RevealedDocument":{"type":"object","properties":{"documentId":{"type":"string"},"values":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]},"masked":{"type":"string","description":"All but the last few characters are stars. Punctuation stays where it was."},"field":{"type":["string","null"]},"page":{"type":"number"},"id":{"type":"string"},"value":{"type":"string","description":"The whole number. Never log or store this."}},"required":["kind","masked","field","page","id","value"]}},"original":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","description":"Signed for 15 minutes."},"filename":{"type":"string"},"mimeType":{"type":"string"}},"required":["url","filename","mimeType"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"tiffUrl":{"description":"A check only: 240 DPI bitonal G4. It prints the MICR line, so it is handed out here and nowhere else.","type":["string","null"]}},"required":["index","tiffUrl"]}}},"required":["documentId","values","original","pages"]},"CheckWithDocument":{"type":"object","properties":{"check":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"originalFilename":{"type":["string","null"]},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"pageCount":{"type":"number"},"externalId":{"type":["string","null"]},"folderId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"mailInBatchId":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"latitude":{"description":"Where the device said it was when the photo was taken.","type":["number","null"]},"longitude":{"type":["number","null"]},"locationAccuracyM":{"type":["number","null"]},"duplicateOfId":{"type":["string","null"]},"processingError":{"type":["string","null"]},"processingErrorCode":{"anyOf":[{"type":"string","enum":["FILE_ENCRYPTED"]},{"type":"null"}],"description":"Set when the failure is one the file's owner can fix. processingError says what to do."},"verification":{"type":"string"},"capturedAt":{"type":["string","null"]},"processedAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"uploadedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all."},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}],"description":"Null when the page is not one, and for a caller without expenses.read_all."},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all. Value null means nothing could say."},"language":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]}},"ocrScore":{"type":["number","null"]},"isFront":{"description":"A check: the front or the back.","type":["boolean","null"]},"tiffRejectScore":{"description":"A check: 0 is a clean clearing image and 1 is one a bank would send back.","type":["number","null"]},"tiffUpscaled":{"description":"A check: the photo was under 240 DPI, so the clearing image was enlarged.","type":["boolean","null"]}},"required":["index","url","thumbnailUrl","width","height","isBlurry","glare","isLcd","screenshot","aiGenerated","language","languages","ocrScore","isFront","tiffRejectScore","tiffUpscaled"]}},"classification":{"anyOf":[{"type":"object","properties":{"value":{"type":"string","description":"A document class, or one of the labels the caller named."},"score":{"type":"number","description":"0..1."},"engine":{"type":"string","enum":["rules","claude"]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["value","score","engine","scores"]},{"type":"null"}],"description":"What the classifier decided, when it was asked."},"blueprint":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"description":"Null for a built-in, which has no versions.","type":["number","null"]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The fields the blueprint defines. Null when the run failed."},"offsets":{"description":"Where each value sits in the text, for a blueprint that asks.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"begin":{"type":"number"},"end":{"type":"number"}},"required":["begin","end"]}},"unmatched":{"description":"Fields where a value was read and did not fit, such as words where a number belongs or a choice off the list. Each is left empty. An empty field not named here was not on the document.","type":"array","items":{"type":"string"}},"error":{"description":"Why the run gave nothing back.","type":["string","null"]}},"required":["name","version","result","error"]},{"type":"null"}],"description":"The blueprint this was read with, and what came out of it."},"tags":{"type":"array","items":{"type":"string"}},"tagRefs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The same tags with their ids, which a tag route takes."},"recordStatus":{"anyOf":[{"type":"string","enum":["processed","reviewed","archived"]},{"type":"null"}],"description":"Where a read document stands: reviewedAt and archivedAt in one word. Null until it has been read."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."},"setId":{"description":"The upload this came out of: a ZIP, a split PDF or a batch of addresses.","type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}],"description":"Values the workspace custom field rules read out of the text."},"enrichment":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","DONE","FAILED"]},"steps":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"failed":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}}},"required":["status","steps","failed"]},{"type":"null"}],"description":"Work still running after the first answer."},"extraction":{"anyOf":[{"type":"object","properties":{"fields":{"type":"object","properties":{"documentType":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"merchantName":{"type":["string","null"]},"merchantAddress":{"type":["string","null"]},"merchantPhone":{"type":["string","null"]},"merchantWebsite":{"type":["string","null"]},"merchantTaxId":{"type":["string","null"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"time":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG","CUC","HRK","SLL","ZWL","XDR","XSU"]},{"type":"null"}]},"currencyGuessed":{"default":false,"type":"boolean"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxLines":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"code":{"type":["string","null"]},"totalInclusive":{"type":["boolean","null"]}},"required":["amountMinor"]}},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"cardBrand":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"receiptNumber":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"poNumber":{"type":["string","null"]},"lineItems":{"default":[],"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"id":{"type":["string","null"]},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["room","tax","parking","service","fee","delivery","product","food","alcohol","tobacco","transportation","fuel","refund","discount","payment","giftcard","donation","toll","lottery"]},{"type":"null"}]},"fullDescription":{"type":["string","null"]},"normalizedDescription":{"type":["string","null"]},"section":{"type":["string","null"]},"reference":{"type":["string","null"]},"upc":{"type":["string","null"]},"hsn":{"type":["string","null"]},"lot":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unitOfMeasure":{"type":["string","null"]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountRatePct":{"type":["number","null"]},"discountPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxRatePct":{"type":["number","null"]},"taxCode":{"type":["string","null"]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"grossTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"netTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"category":{"type":["string","null"]},"customCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countryOfOrigin":{"type":["string","null"]},"manufacturer":{"type":["string","null"]},"weight":{"type":["string","null"]},"brand":{"type":["string","null"]},"hsaFsaEligible":{"type":["boolean","null"]},"productInfo":{"anyOf":[{"type":"object","properties":{"expandedDescription":{"type":["string","null"]},"brand":{"type":["string","null"]},"categoryPath":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},{"type":"null"}]}},"required":["description","amountMinor"]}},"suggestedCategory":{"type":["string","null"]},"documentTitle":{"type":["string","null"]},"documentReferenceNumber":{"type":["string","null"]},"isDocument":{"type":["boolean","null"]},"isTransaction":{"type":["boolean","null"]},"isMoneyIn":{"type":["boolean","null"]},"accountingEntryType":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}]},"vendor":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"vendors":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}}},{"type":"null"}]},"bankBreakdown":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}}},{"type":"null"}]},"billTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"vatNumber":{"type":["string","null"]},"regNumber":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"email":{"type":["string","null"]}}},{"type":"null"}]},"shipTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"insuranceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cashbackMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"roundingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"finalBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"previousBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"totalQuantity":{"type":["number","null"]},"totalWeight":{"type":["string","null"]},"payment":{"anyOf":[{"type":"object","properties":{"cardNumber":{"type":["string","null"]},"displayName":{"type":["string","null"]},"terms":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["none","visa","master_card","cash","american_express","interac","other","maestro","discover","bancontact","girocard","applepay","paypal","bancomat","giftcard","card","check","bankaxept","bank-to-bank_transfer_bacs","octopus","pix","jcb","waon","mada","wechat","alipay","unionpay","googlepay","rupay","bpay","shopeepay","mir","giropay","food_stamp","diners_club","paypay"]},{"type":"null"}]}}},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"shipDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliveryDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"exchangeRate":{"type":["number","null"]},"countryCode":{"type":["string","null"]},"deliveryNoteNumber":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"trackingNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"incoterms":{"type":["string","null"]},"weights":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"licensePlateNumber":{"type":["string","null"]},"vinNumber":{"type":["string","null"]},"guestCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"serverName":{"type":["string","null"]},"storeNumber":{"type":["string","null"]},"vendingPerson":{"type":["string","null"]},"vendingPersonNumber":{"type":["string","null"]},"customerAccountNumber":{"type":["string","null"]},"category":{"type":["string","null"]},"defaultCategory":{"type":["string","null"]},"barcodes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"type":{"type":"string","enum":["QR_CODE","PDF417","EAN_13","EAN_8","UPC_A","UPC_E","CODE_128","CODE_39","ITF","DATA_MATRIX","AZTEC","OTHER"]},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"boundingRegion":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]}},"required":["data","type","page"]}},{"type":"null"}]},"paymentLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string","enum":["text","hyperlink","qr_code","barcode"]}},"required":["url","source"]}},{"type":"null"}]},"folio":{"anyOf":[{"type":"object","properties":{"arrivalDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"departureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roomNumber":{"type":["string","null"]},"guestName":{"type":["string","null"]},"nights":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"confirmationNumber":{"type":["string","null"]}}},{"type":"null"}]},"enrichedFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"check":{"anyOf":[{"type":"object","properties":{"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountText":{"type":["string","null"]},"amountsAgree":{"type":["boolean","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"checkNumber":{"type":["string","null"]},"checkType":{"anyOf":[{"type":"string","enum":["bank_draft","bill_pay_draft","business_check","cashiers_check","government_check","money_order","personal_check","starter_check","teller_check"]},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"memo":{"type":["string","null"]},"payerName":{"type":["string","null"]},"payerAddress":{"type":["string","null"]},"receiverName":{"type":["string","null"]},"receiverAddress":{"type":["string","null"]},"isSigned":{"type":["boolean","null"]},"endorsement":{"anyOf":[{"type":"object","properties":{"isEndorsed":{"type":["boolean","null"]},"isSigned":{"type":["boolean","null"]},"mobileOrRemoteDeposit":{"anyOf":[{"type":"object","properties":{"checkbox":{"type":["boolean","null"]},"instructions":{"type":["boolean","null"]}}},{"type":"null"}]},"isMobileOrRemoteDepositOnly":{"type":["boolean","null"]}}},{"type":"null"}]},"micr":{"anyOf":[{"type":"object","properties":{"routingNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"serialNumber":{"type":["string","null"]},"raw":{"type":["string","null"]},"branch":{"type":["string","null"]},"institution":{"type":["string","null"]},"transactionCode":{"type":["string","null"]}}},{"type":"null"}]},"fractionalRoutingNumber":{"type":["string","null"]},"routingFromFractional":{"type":["string","null"]},"voidTerms":{"type":["string","null"]}}},{"type":"null"}]},"statement":{"anyOf":[{"type":"object","properties":{"accountHolderName":{"type":["string","null"]},"accountHolderAddress":{"type":["string","null"]},"accountType":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"bankWebsite":{"type":["string","null"]},"bankVatNumber":{"type":["string","null"]},"accountVatNumber":{"type":["string","null"]},"periodStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementNumber":{"type":["string","null"]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"minimumDueMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"routingNumber":{"type":["string","null"]},"swift":{"type":["string","null"]},"iban":{"type":["string","null"]},"accounts":{"default":[],"type":"array","items":{"type":"object","properties":{"number":{"type":["string","null"]},"ibanNumber":{"type":["string","null"]},"accountType":{"type":["string","null"]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"summaries":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["name"]}},"transactions":{"default":[],"type":"array","items":{"type":"object","properties":{"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"postedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"vendor":{"type":["string","null"]},"transactionId":{"type":["string","null"]},"debitAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"creditAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cardNumber":{"type":["string","null"]},"text":{"type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["order"]}}}}},"balancesAgree":{"type":["boolean","null"]}}},{"type":"null"}]},"taxForm":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["W2","W9","W8BEN_E"]},"w2":{"anyOf":[{"type":"object","properties":{"employeeSsn":{"type":["string","null"]},"ein":{"type":["string","null"]},"employerName":{"type":["string","null"]},"employerAddress":{"type":["string","null"]},"controlNumber":{"type":["string","null"]},"employeeName":{"type":["string","null"]},"employeeAddress":{"type":["string","null"]},"wagesOtherComps":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"federalIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"allocatedTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"advanceEicPayment":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dependentCareBenefits":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"nonQualifiedPlans":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"box12":{"default":[],"type":"array","items":{"type":"object","properties":{"box":{"type":"string"},"code":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["box","code"]}},"is13a":{"type":["boolean","null"]},"is13b":{"type":["boolean","null"]},"is13c":{"type":["boolean","null"]},"box14Other":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["label"]}},"stateLines":{"default":[],"type":"array","items":{"type":"object","properties":{"state":{"type":["string","null"]},"employerStateId":{"type":["string","null"]},"stateWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"stateIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localityName":{"type":["string","null"]}}}},"taxYear":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"w9":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"businessName":{"type":["string","null"]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"individual":{"type":["boolean","null"]},"cCorp":{"type":["boolean","null"]},"sCorp":{"type":["boolean","null"]},"partnership":{"type":["boolean","null"]},"trustEstate":{"type":["boolean","null"]},"llc":{"type":["boolean","null"]},"llcType":{"type":["string","null"]},"other":{"type":["boolean","null"]},"otherDescription":{"type":["string","null"]},"exemptPayeeCode":{"type":["string","null"]},"exemption":{"type":["string","null"]},"ssn":{"type":["string","null"]},"ein":{"type":["string","null"]},"accountNumbers":{"type":["string","null"]},"requester":{"type":["string","null"]},"signature":{"type":["boolean","null"]},"signatureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}},{"type":"null"}]},"w8BenE":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","boolean","null"]}},{"type":"null"}]}},"required":["kind"]},{"type":"null"}]},"itinerary":{"anyOf":[{"type":"object","properties":{"travelerName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"returnsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"segments":{"default":[],"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]}}}},{"type":"null"}]},"fieldConfidence":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fieldBoxes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"page":{"type":"number"},"box":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4}},"required":["page","box"]}}},"description":"What was read, as the extraction contract types it. fieldConfidence holds per-field confidence, 0..1."},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["tax_rate_mismatch","item_counts_mismatch","totals_mismatch","line_item_amount_mismatch","line_item_repeats","barcode_decoding_issue","barcode_code_missing_in_ocr","logo_vendor_mismatch","malware","weekend_transaction","time_and_currency_mismatch","exif_creation_modified_date_mismatch","missing_date","suspicious_document_aspect_ratio","generic_placeholder_content"]},"message":{"type":"string"},"page":{"type":["number","null"]}},"required":["code","message"]},"description":"Integrity findings. A caller without expenses.read_all sees the arithmetic and dates only."}},"required":["fields","confidence","flags","warnings"]},{"type":"null"}]},"fraud":{"anyOf":[{"type":"object","properties":{"version":{"type":"string"},"score":{"type":"number","description":"0 to 1, from the signals that fired. Evidence, never a verdict."},"color":{"type":"string","enum":["green","yellow","red"],"description":"Under the workspace yellow threshold is green. Over its red threshold is red."},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"description":"Signals that fired, most important first."},"details":{"type":"object","propertyNames":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"additionalProperties":{"type":"object","properties":{"description":{"type":"string"},"confidence":{"type":"number","description":"How sure the detector is of what it saw, 0 to 1. Not how likely fraud is."},"reasons":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Stable."},"description":{"type":"string","description":"Written for a person."},"field":{"description":"Where it was read: exif:Software, totalMinor.","type":["string","null"]},"value":{"type":["string","null"]},"page":{"description":"Zero-based.","type":["number","null"]},"score":{"type":["number","null"]},"box":{"description":"Where on the page, as fractions of its size: x, y, width, height.","anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]}},"required":["name","description"]}}},"required":["description","confidence","reasons"]},"description":"By signal: a description, a confidence and typed reasons."},"attribution":{"description":"One sentence naming the strongest evidence.","type":["string","null"]},"decision":{"type":"string","enum":["clear","review","fraud","not_fraud","unknown"],"description":"clear or review until a person decides. Only a person can say fraud."},"review":{"anyOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["FRAUD","NOT_FRAUD","UNKNOWN"]},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},"note":{"type":["string","null"]},"reviewedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"reviewedAt":{"type":"string"}},"required":["decision","types","note","reviewedBy","reviewedAt"]},{"type":"null"}]},"deviceId":{"description":"The id the client sent for its device, when it sent one.","type":["string","null"]},"submissions":{"anyOf":[{"type":"object","properties":{"lastMinutes":{"type":"number"},"lastDay":{"type":"number"},"lastWeek":{"type":"number"},"last2Weeks":{"type":"number"},"lastMonth":{"type":"number"}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]},{"type":"null"}],"description":"Documents from this uploader in this workspace, by window."},"deviceProfiles":{"type":"array","items":{"type":"object","properties":{"deviceId":{"type":"string"},"profileId":{"type":"string"},"documentCount":{"type":"number"}},"required":["deviceId","profileId","documentCount"]},"description":"Over 30 days, inside this workspace only."},"digitalTamperingFields":{"type":"array","items":{"type":"string"}},"handwriting":{"type":"object","properties":{"handwrittenFields":{"type":"array","items":{"type":"string"}},"fullyHandwrittenFields":{"type":"array","items":{"type":"string"}},"handwrittenTamperedFields":{"type":"array","items":{"type":"string"}},"handwritingDetected":{"type":["boolean","null"]},"handwritingTamperingPresent":{"type":["boolean","null"]}},"required":["handwrittenFields","fullyHandwrittenFields","handwrittenTamperedFields","handwritingDetected","handwritingTamperingPresent"],"description":"What Claude saw written by hand, in dot notation, when a key is set and the handwriting signal is on. With no key, the lists are empty and the flags null: skipped says why."},"notADocument":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"digitalBackground":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"fraudulentPdf":{"anyOf":[{"type":"object","properties":{"fraudulentPdfCreator":{"type":["number","null"]},"textOverlay":{"type":["number","null"]},"fontMismatch":{"type":["number","null"]},"hasDigitalSignature":{"type":["boolean","null"]},"pdfModified":{"type":["number","null"]},"incrementalUpdates":{"type":["number","null"]},"incrementalChanges":{"type":"array","items":{"type":"string"}},"incrementalEdits":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["page","before","after"]}},"signatureCreationTools":{"type":"array","items":{"type":"string"}},"dateInversion":{"type":["number","null"]},"producerContentMismatch":{"type":["number","null"]},"writerMismatch":{"type":["number","null"]},"nullMetadata":{"type":["number","null"]},"xmpInfoMismatch":{"type":["number","null"]},"futureMetadataDate":{"type":["number","null"]},"rasterProfileMismatch":{"type":["number","null"]},"uncompressedRaster":{"type":["number","null"]},"splicedPage":{"type":["number","null"]},"splicedPageNumber":{"type":["number","null"]},"valueFontSplice":{"type":["number","null"]},"valueFontSplicePage":{"type":["number","null"]},"headlessDesktopRender":{"type":["number","null"]},"headlessRenderPlatform":{"type":["string","null"]},"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["fraudulentPdfCreator","textOverlay","fontMismatch","hasDigitalSignature","pdfModified","incrementalUpdates","incrementalChanges","incrementalEdits","signatureCreationTools","dateInversion","producerContentMismatch","writerMismatch","nullMetadata","xmpInfoMismatch","futureMetadataDate","rasterProfileMismatch","uncompressedRaster","splicedPage","splicedPageNumber","valueFontSplice","valueFontSplicePage","headlessDesktopRender","headlessRenderPlatform","doubleJpeg","firstQuantizationQuality","scrubbedProvenance","score"],"description":"Every key is always reported, so a check nothing could answer is null rather than missing."},{"type":"null"}]},"fraudulentImage":{"anyOf":[{"type":"object","properties":{"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"editorSignature":{"type":["number","null"]},"editorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"editorSignatureValue":{"type":["string","null"]},"generatorSignature":{"type":["number","null"]},"generatorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"generatorSignatureValue":{"type":["string","null"]},"generatorWriterProfile":{"type":["number","null"]},"generatorWriterProfileValue":{"type":["string","null"]},"syntheticRaster":{"type":["number","null"]},"syntheticRasterFingerprints":{"type":"array","items":{"type":"string"}},"unprofiledPng":{"type":["number","null"]},"unprofiledWebp":{"type":["number","null"]},"source":{"anyOf":[{"type":"string","enum":["original","render"]},{"type":"null"}]},"sourceFormats":{"type":"array","items":{"type":"string"}},"unreadableSource":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["doubleJpeg","firstQuantizationQuality","scrubbedProvenance","editorSignature","editorSignatureField","editorSignatureValue","generatorSignature","generatorSignatureField","generatorSignatureValue","generatorWriterProfile","generatorWriterProfileValue","syntheticRaster","syntheticRasterFingerprints","unprofiledPng","unprofiledWebp","source","sourceFormats","unreadableSource","score"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}]},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Value null means nothing could say: no pixel model runs, only metadata can answer."},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]}},"required":["index","isBlurry","isLcd","screenshot","aiGenerated","glare"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"reason":{"type":"string"}},"required":["check","reason"]},"description":"Checks that could not run on this file, so a clean result is not read as more than it is."}},"required":["version","score","color","types","details","attribution","decision","review","deviceId","submissions","deviceProfiles","digitalTamperingFields","handwriting","notADocument","digitalBackground","fraudulentPdf","fraudulentImage","pages","skipped"],"description":"Evidence for a reviewer. Null until inspected, and for a caller without expenses.read_all."},{"type":"null"}]},"sealed":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]},"masked":{"type":"string","description":"All but the last few characters are stars. Punctuation stays where it was."},"field":{"type":["string","null"]},"page":{"type":"number"}},"required":["kind","masked","field","page"]},"description":"Bank and tax numbers read from this document, as masks. POST /v1/documents/{id}/reveal opens them."},"updatedAt":{"type":"string"},"extractor":{"description":"What read it: rules, claude, a blueprint, business-card, or none.","type":["string","null"]},"ocrText":{"description":"Everything read off the page. Card, bank and tax numbers are masked.","type":["string","null"]},"pdfUrl":{"description":"The PDF as uploaded, signed for 15 minutes. Null for an image, and for a PDF that prints a number only a reveal hands out.","type":["string","null"]},"meta":{"type":"object","properties":{"totalPages":{"type":"number"},"processedPages":{"type":"number"},"ocrScore":{"description":"The average character confidence of the reading, which doubles as a measure of the image.","type":["number","null"]},"originalFileName":{"type":["string","null"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"language":{"description":"BCP-47.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]},"description":"Every language found, best first."},"deviceId":{"type":["string","null"]},"deviceUserUuid":{"description":"The signed-in person the device was capturing for. Null when no device was named.","type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"sourceDocuments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Each file as submitted: name, type, size in KB, width, height and EXIF."},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}],"description":"Who uploaded it."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."}},"required":["totalPages","processedPages","ocrScore","originalFileName","source","language","languages","deviceId","deviceUserUuid","latitude","longitude","sourceDocuments","owner","duplicates"]},"reviewedAt":{"description":"A person checked what was read.","type":["string","null"]},"approvedAt":{"description":"A developer's own approved flag. An expense's approval is a different thing.","type":["string","null"]}},"required":["id","type","source","status","originalFilename","mimeType","sizeBytes","pageCount","externalId","folderId","expenseId","mailInBatchId","title","notes","latitude","longitude","locationAccuracyM","duplicateOfId","processingError","processingErrorCode","verification","capturedAt","processedAt","viewedAt","archivedAt","createdAt","uploadedBy","pages","classification","blueprint","tags","tagRefs","recordStatus","duplicates","setId","customFields","enrichment","extraction","fraud","sealed","updatedAt","extractor","ocrText","pdfUrl","meta","reviewedAt","approvedAt"]},"document":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"status":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"originalFilename":{"type":["string","null"]},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"pageCount":{"type":"number"},"externalId":{"type":["string","null"]},"folderId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"mailInBatchId":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"latitude":{"description":"Where the device said it was when the photo was taken.","type":["number","null"]},"longitude":{"type":["number","null"]},"locationAccuracyM":{"type":["number","null"]},"duplicateOfId":{"type":["string","null"]},"processingError":{"type":["string","null"]},"processingErrorCode":{"anyOf":[{"type":"string","enum":["FILE_ENCRYPTED"]},{"type":"null"}],"description":"Set when the failure is one the file's owner can fix. processingError says what to do."},"verification":{"type":"string"},"capturedAt":{"type":["string","null"]},"processedAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"uploadedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all."},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}],"description":"Null when the page is not one, and for a caller without expenses.read_all."},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all. Value null means nothing could say."},"language":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]}},"ocrScore":{"type":["number","null"]},"isFront":{"description":"A check: the front or the back.","type":["boolean","null"]},"tiffRejectScore":{"description":"A check: 0 is a clean clearing image and 1 is one a bank would send back.","type":["number","null"]},"tiffUpscaled":{"description":"A check: the photo was under 240 DPI, so the clearing image was enlarged.","type":["boolean","null"]}},"required":["index","url","thumbnailUrl","width","height","isBlurry","glare","isLcd","screenshot","aiGenerated","language","languages","ocrScore","isFront","tiffRejectScore","tiffUpscaled"]}},"classification":{"anyOf":[{"type":"object","properties":{"value":{"type":"string","description":"A document class, or one of the labels the caller named."},"score":{"type":"number","description":"0..1."},"engine":{"type":"string","enum":["rules","claude"]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["value","score","engine","scores"]},{"type":"null"}],"description":"What the classifier decided, when it was asked."},"blueprint":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"description":"Null for a built-in, which has no versions.","type":["number","null"]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The fields the blueprint defines. Null when the run failed."},"offsets":{"description":"Where each value sits in the text, for a blueprint that asks.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"begin":{"type":"number"},"end":{"type":"number"}},"required":["begin","end"]}},"unmatched":{"description":"Fields where a value was read and did not fit, such as words where a number belongs or a choice off the list. Each is left empty. An empty field not named here was not on the document.","type":"array","items":{"type":"string"}},"error":{"description":"Why the run gave nothing back.","type":["string","null"]}},"required":["name","version","result","error"]},{"type":"null"}],"description":"The blueprint this was read with, and what came out of it."},"tags":{"type":"array","items":{"type":"string"}},"tagRefs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The same tags with their ids, which a tag route takes."},"recordStatus":{"anyOf":[{"type":"string","enum":["processed","reviewed","archived"]},{"type":"null"}],"description":"Where a read document stands: reviewedAt and archivedAt in one word. Null until it has been read."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."},"setId":{"description":"The upload this came out of: a ZIP, a split PDF or a batch of addresses.","type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}],"description":"Values the workspace custom field rules read out of the text."},"enrichment":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","DONE","FAILED"]},"steps":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"failed":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}}},"required":["status","steps","failed"]},{"type":"null"}],"description":"Work still running after the first answer."},"extraction":{"anyOf":[{"type":"object","properties":{"fields":{"type":"object","properties":{"documentType":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"merchantName":{"type":["string","null"]},"merchantAddress":{"type":["string","null"]},"merchantPhone":{"type":["string","null"]},"merchantWebsite":{"type":["string","null"]},"merchantTaxId":{"type":["string","null"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"time":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG","CUC","HRK","SLL","ZWL","XDR","XSU"]},{"type":"null"}]},"currencyGuessed":{"default":false,"type":"boolean"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxLines":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"code":{"type":["string","null"]},"totalInclusive":{"type":["boolean","null"]}},"required":["amountMinor"]}},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"cardBrand":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"receiptNumber":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"poNumber":{"type":["string","null"]},"lineItems":{"default":[],"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"id":{"type":["string","null"]},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["room","tax","parking","service","fee","delivery","product","food","alcohol","tobacco","transportation","fuel","refund","discount","payment","giftcard","donation","toll","lottery"]},{"type":"null"}]},"fullDescription":{"type":["string","null"]},"normalizedDescription":{"type":["string","null"]},"section":{"type":["string","null"]},"reference":{"type":["string","null"]},"upc":{"type":["string","null"]},"hsn":{"type":["string","null"]},"lot":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unitOfMeasure":{"type":["string","null"]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountRatePct":{"type":["number","null"]},"discountPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxRatePct":{"type":["number","null"]},"taxCode":{"type":["string","null"]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"grossTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"netTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"category":{"type":["string","null"]},"customCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countryOfOrigin":{"type":["string","null"]},"manufacturer":{"type":["string","null"]},"weight":{"type":["string","null"]},"brand":{"type":["string","null"]},"hsaFsaEligible":{"type":["boolean","null"]},"productInfo":{"anyOf":[{"type":"object","properties":{"expandedDescription":{"type":["string","null"]},"brand":{"type":["string","null"]},"categoryPath":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},{"type":"null"}]}},"required":["description","amountMinor"]}},"suggestedCategory":{"type":["string","null"]},"documentTitle":{"type":["string","null"]},"documentReferenceNumber":{"type":["string","null"]},"isDocument":{"type":["boolean","null"]},"isTransaction":{"type":["boolean","null"]},"isMoneyIn":{"type":["boolean","null"]},"accountingEntryType":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}]},"vendor":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"vendors":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}}},{"type":"null"}]},"bankBreakdown":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}}},{"type":"null"}]},"billTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"vatNumber":{"type":["string","null"]},"regNumber":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"email":{"type":["string","null"]}}},{"type":"null"}]},"shipTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"insuranceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cashbackMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"roundingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"finalBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"previousBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"totalQuantity":{"type":["number","null"]},"totalWeight":{"type":["string","null"]},"payment":{"anyOf":[{"type":"object","properties":{"cardNumber":{"type":["string","null"]},"displayName":{"type":["string","null"]},"terms":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["none","visa","master_card","cash","american_express","interac","other","maestro","discover","bancontact","girocard","applepay","paypal","bancomat","giftcard","card","check","bankaxept","bank-to-bank_transfer_bacs","octopus","pix","jcb","waon","mada","wechat","alipay","unionpay","googlepay","rupay","bpay","shopeepay","mir","giropay","food_stamp","diners_club","paypay"]},{"type":"null"}]}}},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"shipDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliveryDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"exchangeRate":{"type":["number","null"]},"countryCode":{"type":["string","null"]},"deliveryNoteNumber":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"trackingNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"incoterms":{"type":["string","null"]},"weights":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"licensePlateNumber":{"type":["string","null"]},"vinNumber":{"type":["string","null"]},"guestCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"serverName":{"type":["string","null"]},"storeNumber":{"type":["string","null"]},"vendingPerson":{"type":["string","null"]},"vendingPersonNumber":{"type":["string","null"]},"customerAccountNumber":{"type":["string","null"]},"category":{"type":["string","null"]},"defaultCategory":{"type":["string","null"]},"barcodes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"type":{"type":"string","enum":["QR_CODE","PDF417","EAN_13","EAN_8","UPC_A","UPC_E","CODE_128","CODE_39","ITF","DATA_MATRIX","AZTEC","OTHER"]},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"boundingRegion":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]}},"required":["data","type","page"]}},{"type":"null"}]},"paymentLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string","enum":["text","hyperlink","qr_code","barcode"]}},"required":["url","source"]}},{"type":"null"}]},"folio":{"anyOf":[{"type":"object","properties":{"arrivalDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"departureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roomNumber":{"type":["string","null"]},"guestName":{"type":["string","null"]},"nights":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"confirmationNumber":{"type":["string","null"]}}},{"type":"null"}]},"enrichedFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"check":{"anyOf":[{"type":"object","properties":{"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountText":{"type":["string","null"]},"amountsAgree":{"type":["boolean","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"checkNumber":{"type":["string","null"]},"checkType":{"anyOf":[{"type":"string","enum":["bank_draft","bill_pay_draft","business_check","cashiers_check","government_check","money_order","personal_check","starter_check","teller_check"]},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"memo":{"type":["string","null"]},"payerName":{"type":["string","null"]},"payerAddress":{"type":["string","null"]},"receiverName":{"type":["string","null"]},"receiverAddress":{"type":["string","null"]},"isSigned":{"type":["boolean","null"]},"endorsement":{"anyOf":[{"type":"object","properties":{"isEndorsed":{"type":["boolean","null"]},"isSigned":{"type":["boolean","null"]},"mobileOrRemoteDeposit":{"anyOf":[{"type":"object","properties":{"checkbox":{"type":["boolean","null"]},"instructions":{"type":["boolean","null"]}}},{"type":"null"}]},"isMobileOrRemoteDepositOnly":{"type":["boolean","null"]}}},{"type":"null"}]},"micr":{"anyOf":[{"type":"object","properties":{"routingNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"serialNumber":{"type":["string","null"]},"raw":{"type":["string","null"]},"branch":{"type":["string","null"]},"institution":{"type":["string","null"]},"transactionCode":{"type":["string","null"]}}},{"type":"null"}]},"fractionalRoutingNumber":{"type":["string","null"]},"routingFromFractional":{"type":["string","null"]},"voidTerms":{"type":["string","null"]}}},{"type":"null"}]},"statement":{"anyOf":[{"type":"object","properties":{"accountHolderName":{"type":["string","null"]},"accountHolderAddress":{"type":["string","null"]},"accountType":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"bankWebsite":{"type":["string","null"]},"bankVatNumber":{"type":["string","null"]},"accountVatNumber":{"type":["string","null"]},"periodStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementNumber":{"type":["string","null"]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"minimumDueMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"routingNumber":{"type":["string","null"]},"swift":{"type":["string","null"]},"iban":{"type":["string","null"]},"accounts":{"default":[],"type":"array","items":{"type":"object","properties":{"number":{"type":["string","null"]},"ibanNumber":{"type":["string","null"]},"accountType":{"type":["string","null"]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"summaries":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["name"]}},"transactions":{"default":[],"type":"array","items":{"type":"object","properties":{"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"postedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"vendor":{"type":["string","null"]},"transactionId":{"type":["string","null"]},"debitAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"creditAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cardNumber":{"type":["string","null"]},"text":{"type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["order"]}}}}},"balancesAgree":{"type":["boolean","null"]}}},{"type":"null"}]},"taxForm":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["W2","W9","W8BEN_E"]},"w2":{"anyOf":[{"type":"object","properties":{"employeeSsn":{"type":["string","null"]},"ein":{"type":["string","null"]},"employerName":{"type":["string","null"]},"employerAddress":{"type":["string","null"]},"controlNumber":{"type":["string","null"]},"employeeName":{"type":["string","null"]},"employeeAddress":{"type":["string","null"]},"wagesOtherComps":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"federalIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"allocatedTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"advanceEicPayment":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dependentCareBenefits":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"nonQualifiedPlans":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"box12":{"default":[],"type":"array","items":{"type":"object","properties":{"box":{"type":"string"},"code":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["box","code"]}},"is13a":{"type":["boolean","null"]},"is13b":{"type":["boolean","null"]},"is13c":{"type":["boolean","null"]},"box14Other":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["label"]}},"stateLines":{"default":[],"type":"array","items":{"type":"object","properties":{"state":{"type":["string","null"]},"employerStateId":{"type":["string","null"]},"stateWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"stateIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localityName":{"type":["string","null"]}}}},"taxYear":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"w9":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"businessName":{"type":["string","null"]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"individual":{"type":["boolean","null"]},"cCorp":{"type":["boolean","null"]},"sCorp":{"type":["boolean","null"]},"partnership":{"type":["boolean","null"]},"trustEstate":{"type":["boolean","null"]},"llc":{"type":["boolean","null"]},"llcType":{"type":["string","null"]},"other":{"type":["boolean","null"]},"otherDescription":{"type":["string","null"]},"exemptPayeeCode":{"type":["string","null"]},"exemption":{"type":["string","null"]},"ssn":{"type":["string","null"]},"ein":{"type":["string","null"]},"accountNumbers":{"type":["string","null"]},"requester":{"type":["string","null"]},"signature":{"type":["boolean","null"]},"signatureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}},{"type":"null"}]},"w8BenE":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","boolean","null"]}},{"type":"null"}]}},"required":["kind"]},{"type":"null"}]},"itinerary":{"anyOf":[{"type":"object","properties":{"travelerName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"returnsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"segments":{"default":[],"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]}}}},{"type":"null"}]},"fieldConfidence":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fieldBoxes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"page":{"type":"number"},"box":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4}},"required":["page","box"]}}},"description":"What was read, as the extraction contract types it. fieldConfidence holds per-field confidence, 0..1."},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["tax_rate_mismatch","item_counts_mismatch","totals_mismatch","line_item_amount_mismatch","line_item_repeats","barcode_decoding_issue","barcode_code_missing_in_ocr","logo_vendor_mismatch","malware","weekend_transaction","time_and_currency_mismatch","exif_creation_modified_date_mismatch","missing_date","suspicious_document_aspect_ratio","generic_placeholder_content"]},"message":{"type":"string"},"page":{"type":["number","null"]}},"required":["code","message"]},"description":"Integrity findings. A caller without expenses.read_all sees the arithmetic and dates only."}},"required":["fields","confidence","flags","warnings"]},{"type":"null"}]},"fraud":{"anyOf":[{"type":"object","properties":{"version":{"type":"string"},"score":{"type":"number","description":"0 to 1, from the signals that fired. Evidence, never a verdict."},"color":{"type":"string","enum":["green","yellow","red"],"description":"Under the workspace yellow threshold is green. Over its red threshold is red."},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"description":"Signals that fired, most important first."},"details":{"type":"object","propertyNames":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"additionalProperties":{"type":"object","properties":{"description":{"type":"string"},"confidence":{"type":"number","description":"How sure the detector is of what it saw, 0 to 1. Not how likely fraud is."},"reasons":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Stable."},"description":{"type":"string","description":"Written for a person."},"field":{"description":"Where it was read: exif:Software, totalMinor.","type":["string","null"]},"value":{"type":["string","null"]},"page":{"description":"Zero-based.","type":["number","null"]},"score":{"type":["number","null"]},"box":{"description":"Where on the page, as fractions of its size: x, y, width, height.","anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]}},"required":["name","description"]}}},"required":["description","confidence","reasons"]},"description":"By signal: a description, a confidence and typed reasons."},"attribution":{"description":"One sentence naming the strongest evidence.","type":["string","null"]},"decision":{"type":"string","enum":["clear","review","fraud","not_fraud","unknown"],"description":"clear or review until a person decides. Only a person can say fraud."},"review":{"anyOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["FRAUD","NOT_FRAUD","UNKNOWN"]},"types":{"type":"array","items":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},"note":{"type":["string","null"]},"reviewedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"reviewedAt":{"type":"string"}},"required":["decision","types","note","reviewedBy","reviewedAt"]},{"type":"null"}]},"deviceId":{"description":"The id the client sent for its device, when it sent one.","type":["string","null"]},"submissions":{"anyOf":[{"type":"object","properties":{"lastMinutes":{"type":"number"},"lastDay":{"type":"number"},"lastWeek":{"type":"number"},"last2Weeks":{"type":"number"},"lastMonth":{"type":"number"}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]},{"type":"null"}],"description":"Documents from this uploader in this workspace, by window."},"deviceProfiles":{"type":"array","items":{"type":"object","properties":{"deviceId":{"type":"string"},"profileId":{"type":"string"},"documentCount":{"type":"number"}},"required":["deviceId","profileId","documentCount"]},"description":"Over 30 days, inside this workspace only."},"digitalTamperingFields":{"type":"array","items":{"type":"string"}},"handwriting":{"type":"object","properties":{"handwrittenFields":{"type":"array","items":{"type":"string"}},"fullyHandwrittenFields":{"type":"array","items":{"type":"string"}},"handwrittenTamperedFields":{"type":"array","items":{"type":"string"}},"handwritingDetected":{"type":["boolean","null"]},"handwritingTamperingPresent":{"type":["boolean","null"]}},"required":["handwrittenFields","fullyHandwrittenFields","handwrittenTamperedFields","handwritingDetected","handwritingTamperingPresent"],"description":"What Claude saw written by hand, in dot notation, when a key is set and the handwriting signal is on. With no key, the lists are empty and the flags null: skipped says why."},"notADocument":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"digitalBackground":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"fraudulentPdf":{"anyOf":[{"type":"object","properties":{"fraudulentPdfCreator":{"type":["number","null"]},"textOverlay":{"type":["number","null"]},"fontMismatch":{"type":["number","null"]},"hasDigitalSignature":{"type":["boolean","null"]},"pdfModified":{"type":["number","null"]},"incrementalUpdates":{"type":["number","null"]},"incrementalChanges":{"type":"array","items":{"type":"string"}},"incrementalEdits":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["page","before","after"]}},"signatureCreationTools":{"type":"array","items":{"type":"string"}},"dateInversion":{"type":["number","null"]},"producerContentMismatch":{"type":["number","null"]},"writerMismatch":{"type":["number","null"]},"nullMetadata":{"type":["number","null"]},"xmpInfoMismatch":{"type":["number","null"]},"futureMetadataDate":{"type":["number","null"]},"rasterProfileMismatch":{"type":["number","null"]},"uncompressedRaster":{"type":["number","null"]},"splicedPage":{"type":["number","null"]},"splicedPageNumber":{"type":["number","null"]},"valueFontSplice":{"type":["number","null"]},"valueFontSplicePage":{"type":["number","null"]},"headlessDesktopRender":{"type":["number","null"]},"headlessRenderPlatform":{"type":["string","null"]},"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["fraudulentPdfCreator","textOverlay","fontMismatch","hasDigitalSignature","pdfModified","incrementalUpdates","incrementalChanges","incrementalEdits","signatureCreationTools","dateInversion","producerContentMismatch","writerMismatch","nullMetadata","xmpInfoMismatch","futureMetadataDate","rasterProfileMismatch","uncompressedRaster","splicedPage","splicedPageNumber","valueFontSplice","valueFontSplicePage","headlessDesktopRender","headlessRenderPlatform","doubleJpeg","firstQuantizationQuality","scrubbedProvenance","score"],"description":"Every key is always reported, so a check nothing could answer is null rather than missing."},{"type":"null"}]},"fraudulentImage":{"anyOf":[{"type":"object","properties":{"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"editorSignature":{"type":["number","null"]},"editorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"editorSignatureValue":{"type":["string","null"]},"generatorSignature":{"type":["number","null"]},"generatorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"generatorSignatureValue":{"type":["string","null"]},"generatorWriterProfile":{"type":["number","null"]},"generatorWriterProfileValue":{"type":["string","null"]},"syntheticRaster":{"type":["number","null"]},"syntheticRasterFingerprints":{"type":"array","items":{"type":"string"}},"unprofiledPng":{"type":["number","null"]},"unprofiledWebp":{"type":["number","null"]},"source":{"anyOf":[{"type":"string","enum":["original","render"]},{"type":"null"}]},"sourceFormats":{"type":"array","items":{"type":"string"}},"unreadableSource":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["doubleJpeg","firstQuantizationQuality","scrubbedProvenance","editorSignature","editorSignatureField","editorSignatureValue","generatorSignature","generatorSignatureField","generatorSignatureValue","generatorWriterProfile","generatorWriterProfileValue","syntheticRaster","syntheticRasterFingerprints","unprofiledPng","unprofiledWebp","source","sourceFormats","unreadableSource","score"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}]},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Value null means nothing could say: no pixel model runs, only metadata can answer."},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]}},"required":["index","isBlurry","isLcd","screenshot","aiGenerated","glare"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"reason":{"type":"string"}},"required":["check","reason"]},"description":"Checks that could not run on this file, so a clean result is not read as more than it is."}},"required":["version","score","color","types","details","attribution","decision","review","deviceId","submissions","deviceProfiles","digitalTamperingFields","handwriting","notADocument","digitalBackground","fraudulentPdf","fraudulentImage","pages","skipped"],"description":"Evidence for a reviewer. Null until inspected, and for a caller without expenses.read_all."},{"type":"null"}]},"sealed":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]},"masked":{"type":"string","description":"All but the last few characters are stars. Punctuation stays where it was."},"field":{"type":["string","null"]},"page":{"type":"number"}},"required":["kind","masked","field","page"]},"description":"Bank and tax numbers read from this document, as masks. POST /v1/documents/{id}/reveal opens them."},"updatedAt":{"type":"string"},"extractor":{"description":"What read it: rules, claude, a blueprint, business-card, or none.","type":["string","null"]},"ocrText":{"description":"Everything read off the page. Card, bank and tax numbers are masked.","type":["string","null"]},"pdfUrl":{"description":"The PDF as uploaded, signed for 15 minutes. Null for an image, and for a PDF that prints a number only a reveal hands out.","type":["string","null"]},"meta":{"type":"object","properties":{"totalPages":{"type":"number"},"processedPages":{"type":"number"},"ocrScore":{"description":"The average character confidence of the reading, which doubles as a measure of the image.","type":["number","null"]},"originalFileName":{"type":["string","null"]},"source":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"language":{"description":"BCP-47.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]},"description":"Every language found, best first."},"deviceId":{"type":["string","null"]},"deviceUserUuid":{"description":"The signed-in person the device was capturing for. Null when no device was named.","type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"sourceDocuments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Each file as submitted: name, type, size in KB, width, height and EXIF."},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}],"description":"Who uploaded it."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."}},"required":["totalPages","processedPages","ocrScore","originalFileName","source","language","languages","deviceId","deviceUserUuid","latitude","longitude","sourceDocuments","owner","duplicates"]},"reviewedAt":{"description":"A person checked what was read.","type":["string","null"]},"approvedAt":{"description":"A developer's own approved flag. An expense's approval is a different thing.","type":["string","null"]}},"required":["id","type","source","status","originalFilename","mimeType","sizeBytes","pageCount","externalId","folderId","expenseId","mailInBatchId","title","notes","latitude","longitude","locationAccuracyM","duplicateOfId","processingError","processingErrorCode","verification","capturedAt","processedAt","viewedAt","archivedAt","createdAt","uploadedBy","pages","classification","blueprint","tags","tagRefs","recordStatus","duplicates","setId","customFields","enrichment","extraction","fraud","sealed","updatedAt","extractor","ocrText","pdfUrl","meta","reviewedAt","approvedAt"]}},"required":["check","document"]},"DocumentText":{"type":"object","properties":{"text":{"description":"Everything recognized on the document. Card numbers are already masked.","type":["string","null"]},"language":{"type":["string","null"]}},"required":["text","language"]},"DownloadableFile":{"type":"object","properties":{"filename":{"type":"string"},"contentType":{"type":"string"},"content":{"type":"string"}},"required":["filename","contentType","content"]},"ExpenseDetail":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string"},"status":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},"kind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"merchantName":{"type":["string","null"]},"tripTitle":{"description":"For a trip, what to call it in a list.","type":["string","null"]},"description":{"type":["string","null"]},"date":{"type":"string"},"currency":{"type":"string"},"amountMinor":{"type":"number"},"baseAmountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"alsoCategories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Further categories it can be found under. Its money stays in category."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]}},"required":["id","name","code"]},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"moneyFlow":{"type":"string","enum":["IN","OUT"],"description":"Which way the money went."},"invoiceNumber":{"type":["string","null"]},"matched":{"type":"boolean","description":"A card charge has been matched to it."},"connectedApps":{"type":"array","items":{"type":"string"},"description":"Connected services it has been posted to."},"reportId":{"type":["string","null"]},"externalId":{"description":"A developer's own reference, exactly as sent.","type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["info","warn","block"]},"by":{"description":"Who put it there, where that decides who may take it off.","type":"string"}},"required":["code","message","severity"]}},"reviewFields":{"type":"array","items":{"type":"string"}},"thumbnailUrl":{"type":["string","null"]},"documentId":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":["string","null"]}},"required":["id","name","color"]}},"attendeeCount":{"type":"number"},"fxRate":{"type":"number","description":"What one unit of the expense currency is worth in the base currency. Zero means no rate is available yet, so baseAmountMinor is zero too and the expense is held in review."},"held":{"type":"boolean","description":"Held back from its report until someone releases it."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"notes":{"type":["string","null"]},"subtotalMinor":{"type":["number","null"]},"tipMinor":{"type":["number","null"]},"discountMinor":{"type":["number","null"]},"shippingMinor":{"type":["number","null"]},"paymentAccountId":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"poNumber":{"description":"The buyer's purchase order number, as an invoice prints it.","type":["string","null"]},"dueDate":{"description":"When an invoice falls due.","type":["string","null"]},"mcc":{"description":"The merchant category code a card network gave the merchant, four digits.","type":["string","null"]},"taxDeductible":{"type":"boolean"},"quantity":{"type":["number","null"]},"rateMinor":{"type":["number","null"]},"unit":{"type":["string","null"]},"trip":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"vehicleId":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"required":["name"]}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"editedFields":{"type":"array","items":{"type":"string"}},"duplicateOfId":{"type":["string","null"]},"duplicateReview":{"anyOf":[{"type":"object","properties":{"outcome":{"type":"string","enum":["DISMISSED","KEPT"]},"reason":{"type":"string"},"engine":{"type":"string","enum":["rules","claude"]},"at":{"type":"string"}},"required":["outcome","reason","engine","at"]},{"type":"null"}],"description":"What the second look at a flagged copy decided, and why."},"canSettleDuplicate":{"type":"boolean","description":"Whether the caller can answer the duplicate question on this expense."},"splitParentId":{"type":["string","null"]},"access":{"type":"object","properties":{"canEdit":{"type":"boolean"},"limited":{"type":"boolean","description":"Out for approval: only the amount, description, merchant, date, category, tags and attendees can change."},"reason":{"description":"Why it cannot be edited, or how far it can, in words for the person looking at it.","type":["string","null"]},"amountLocked":{"type":"boolean","description":"The amount is a card's own figure."},"canDelete":{"type":"boolean"},"canRestore":{"type":"boolean"},"restoreBlocked":{"description":"Why it cannot be restored: split, or merged, for good.","type":["string","null"]},"canSplit":{"type":"boolean"},"canMove":{"type":"boolean"}},"required":["canEdit","limited","reason","amountLocked","canDelete","canRestore","restoreBlocked","canSplit","canMove"],"description":"What the caller may do with it."},"splitInto":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"amountMinor":{"type":"number"}},"required":["id","reference","amountMinor"]},"description":"This expense was divided: its parts now count in its place."},"mergedIntoId":{"description":"A merge absorbed this expense. Where it went.","type":["string","null"]},"report":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"}},"required":["id","title","status"]},{"type":"null"}],"description":"The report this expense is on, named even where the caller could not list it."},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"type":["number","null"]},"amountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"categoryId":{"type":["string","null"]}},"required":["id","position","description","sku","quantity","unitPriceMinor","amountMinor","taxMinor","categoryId"]}},"documentIds":{"type":"array","items":{"type":"string"}}},"required":["id","number","reference","status","kind","merchantName","tripTitle","description","date","currency","amountMinor","baseAmountMinor","taxMinor","category","alsoCategories","project","client","owner","moneyFlow","invoiceNumber","matched","connectedApps","reportId","externalId","billable","reimbursable","paymentType","confidence","flags","reviewFields","thumbnailUrl","documentId","tags","attendeeCount","fxRate","held","createdAt","updatedAt","notes","subtotalMinor","tipMinor","discountMinor","shippingMinor","paymentAccountId","cardLast4","poNumber","dueDate","mcc","taxDeductible","quantity","rateMinor","unit","trip","vehicleId","attendees","customFields","editedFields","duplicateOfId","duplicateReview","canSettleDuplicate","splitParentId","access","splitInto","mergedIntoId","report","lines","documentIds"]},"ExpensePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string"},"status":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},"kind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"merchantName":{"type":["string","null"]},"tripTitle":{"description":"For a trip, what to call it in a list.","type":["string","null"]},"description":{"type":["string","null"]},"date":{"type":"string"},"currency":{"type":"string"},"amountMinor":{"type":"number"},"baseAmountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"alsoCategories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Further categories it can be found under. Its money stays in category."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]}},"required":["id","name","code"]},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"moneyFlow":{"type":"string","enum":["IN","OUT"],"description":"Which way the money went."},"invoiceNumber":{"type":["string","null"]},"matched":{"type":"boolean","description":"A card charge has been matched to it."},"connectedApps":{"type":"array","items":{"type":"string"},"description":"Connected services it has been posted to."},"reportId":{"type":["string","null"]},"externalId":{"description":"A developer's own reference, exactly as sent.","type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["info","warn","block"]},"by":{"description":"Who put it there, where that decides who may take it off.","type":"string"}},"required":["code","message","severity"]}},"reviewFields":{"type":"array","items":{"type":"string"}},"thumbnailUrl":{"type":["string","null"]},"documentId":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":["string","null"]}},"required":["id","name","color"]}},"attendeeCount":{"type":"number"},"fxRate":{"type":"number","description":"What one unit of the expense currency is worth in the base currency."},"held":{"type":"boolean","description":"Held back from its report until someone releases it."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","number","reference","status","kind","merchantName","tripTitle","description","date","currency","amountMinor","baseAmountMinor","taxMinor","category","alsoCategories","project","client","owner","moneyFlow","invoiceNumber","matched","connectedApps","reportId","externalId","billable","reimbursable","paymentType","confidence","flags","reviewFields","thumbnailUrl","documentId","tags","attendeeCount","fxRate","held","createdAt","updatedAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExpenseTotals":{"type":"object","properties":{"count":{"type":"number"},"moneyOutMinor":{"type":"number","description":"Money out, in the base currency."},"moneyInMinor":{"type":"number","description":"Money in, in the base currency: income, refunds and credits, as a positive figure."},"baseAmountMinor":{"type":"number","description":"In the workspace's base currency. A credit or a refund is negative, so it brings this down."},"currency":{"type":"string"},"unconverted":{"type":"number","description":"Counted, but with no exchange rate yet, so they add nothing to the amount."},"totalMinor":{"type":"number","description":"`baseAmountMinor` in the currency asked for."},"totalCurrency":{"type":"string"},"convertedFrom":{"description":"Set when `totalCurrency` is not the base: the currency it was converted from, at the latest rate.","type":["string","null"]}},"required":["count","moneyOutMinor","moneyInMinor","baseAmountMinor","currency","unconverted","totalMinor","totalCurrency","convertedFrom"]},"ExportJob":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["expenses","report","tax","mileage","receipts","documents"]},"format":{"type":"string","enum":["CSV","XLSX","PDF","ZIP","QBO_CSV","XERO_CSV","SAGE_CSV","DYNAMICS_CSV","MYOB_TXT","ORACLE_CSV","SAP_CSV","IIF","OFX","JSON","XML","TXT","XLS"]},"status":{"type":"string","enum":["EXPIRED","FAILED","COMPLETED","QUEUED","RUNNING"]},"filters":{"type":"object","properties":{"status":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]},"kind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"ids":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string"}},"year":{"type":"integer","minimum":2000,"maximum":2100},"reportState":{"anyOf":[{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]},{"minItems":1,"type":"array","items":{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]}}]},"reportIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1}},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"approvedAfter":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"exported":{"type":"boolean"},"categoryIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1}},"documentIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","minLength":1}},"documentTypes":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}},"policyIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1}},"approvalLinkId":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":80},"formula":{"type":"string","maxLength":500}},"required":["key"]}},"columnSet":{"type":"string","enum":["simple","detailed"]},"preset":{"type":"string","enum":["basic","all_data_expense","all_data_report","canadian_multiple_tax","category","per_diem","tag","tax_report"]},"view":{"type":"object","properties":{"level":{"default":"expense","type":"string","enum":["expense","report"]},"columns":{"minItems":1,"maxItems":60,"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":80}},"required":["key"]}},"sort":{"type":"string","enum":["date:asc","date:desc","merchant:asc","merchant:desc","category:asc","category:desc","status:asc","status:desc","amount:asc","amount:desc"]},"groupBy":{"type":"string","enum":["category","merchant","member","project","status","month"]},"groupsOnly":{"type":"boolean"}},"required":["columns"]},"notifyRequester":{"type":"boolean"},"fullPageReceipts":{"type":"boolean"},"template":{"type":"string"},"emailMessage":{"type":"string"},"delimiter":{"type":"string","enum":[",",";","\t","|"]},"bom":{"type":"boolean"},"recipients":{"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"scheduledReportId":{"type":"string"},"scheduledReportName":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}}}},"filename":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"error":{"description":"Why it failed, written for a person.","type":["string","null"]},"notes":{"type":"array","items":{"type":"string"},"description":"What a finished file left out, such as credits a bill import cannot take."},"requestedBy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"onFinish":{"anyOf":[{"type":"object","properties":{"markAsExported":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["PENDING","DONE","FAILED","SKIPPED"]},"marked":{"type":"array","items":{"type":"string"},"description":"The reports this export marked, by reference."},"skipped":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"reason":{"type":"string"}},"required":["reference","reason"]},"description":"The reports it left as they were, and why."},"error":{"type":["string","null"]}},"required":["state","marked","skipped","error"]},{"type":"null"}]},"sftpUpload":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["PENDING","DONE","FAILED","SKIPPED"]},"host":{"type":"string"},"port":{"type":"number"},"path":{"type":"string"},"attempts":{"type":"number"},"file":{"description":"Where the file landed on the server.","type":["string","null"]},"error":{"type":["string","null"]},"uploadedAt":{"type":["string","null"]}},"required":["state","host","port","path","attempts","file","error","uploadedAt"]},{"type":"null"}],"description":"Where the file went. The credentials are never returned."}},"required":["markAsExported","sftpUpload"]},{"type":"null"}],"description":"How the actions the export asked for went. Null when it asked for none."},"createdAt":{"type":"string"},"completedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"downloadUrl":{"description":"Signed, valid for 15 minutes. Null until the file is ready and after it expires.","type":["string","null"]}},"required":["id","kind","format","status","filters","filename","rowCount","error","notes","requestedBy","onFinish","createdAt","completedAt","expiresAt","downloadUrl"]},"ExportJobPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["expenses","report","tax","mileage","receipts","documents"]},"format":{"type":"string","enum":["CSV","XLSX","PDF","ZIP","QBO_CSV","XERO_CSV","SAGE_CSV","DYNAMICS_CSV","MYOB_TXT","ORACLE_CSV","SAP_CSV","IIF","OFX","JSON","XML","TXT","XLS"]},"status":{"type":"string","enum":["EXPIRED","FAILED","COMPLETED","QUEUED","RUNNING"]},"filters":{"type":"object","properties":{"status":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]},"kind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"paymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"ids":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string"}},"year":{"type":"integer","minimum":2000,"maximum":2100},"reportState":{"anyOf":[{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]},{"minItems":1,"type":"array","items":{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]}}]},"reportIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1}},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"approvedAfter":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"exported":{"type":"boolean"},"categoryIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1}},"documentIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","minLength":1}},"documentTypes":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}},"policyIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1}},"approvalLinkId":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":80},"formula":{"type":"string","maxLength":500}},"required":["key"]}},"columnSet":{"type":"string","enum":["simple","detailed"]},"preset":{"type":"string","enum":["basic","all_data_expense","all_data_report","canadian_multiple_tax","category","per_diem","tag","tax_report"]},"view":{"type":"object","properties":{"level":{"default":"expense","type":"string","enum":["expense","report"]},"columns":{"minItems":1,"maxItems":60,"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":80}},"required":["key"]}},"sort":{"type":"string","enum":["date:asc","date:desc","merchant:asc","merchant:desc","category:asc","category:desc","status:asc","status:desc","amount:asc","amount:desc"]},"groupBy":{"type":"string","enum":["category","merchant","member","project","status","month"]},"groupsOnly":{"type":"boolean"}},"required":["columns"]},"notifyRequester":{"type":"boolean"},"fullPageReceipts":{"type":"boolean"},"template":{"type":"string"},"emailMessage":{"type":"string"},"delimiter":{"type":"string","enum":[",",";","\t","|"]},"bom":{"type":"boolean"},"recipients":{"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"scheduledReportId":{"type":"string"},"scheduledReportName":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}}}},"filename":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"error":{"description":"Why it failed, written for a person.","type":["string","null"]},"notes":{"type":"array","items":{"type":"string"},"description":"What a finished file left out, such as credits a bill import cannot take."},"requestedBy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"onFinish":{"anyOf":[{"type":"object","properties":{"markAsExported":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["PENDING","DONE","FAILED","SKIPPED"]},"marked":{"type":"array","items":{"type":"string"},"description":"The reports this export marked, by reference."},"skipped":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"reason":{"type":"string"}},"required":["reference","reason"]},"description":"The reports it left as they were, and why."},"error":{"type":["string","null"]}},"required":["state","marked","skipped","error"]},{"type":"null"}]},"sftpUpload":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["PENDING","DONE","FAILED","SKIPPED"]},"host":{"type":"string"},"port":{"type":"number"},"path":{"type":"string"},"attempts":{"type":"number"},"file":{"description":"Where the file landed on the server.","type":["string","null"]},"error":{"type":["string","null"]},"uploadedAt":{"type":["string","null"]}},"required":["state","host","port","path","attempts","file","error","uploadedAt"]},{"type":"null"}],"description":"Where the file went. The credentials are never returned."}},"required":["markAsExported","sftpUpload"]},{"type":"null"}],"description":"How the actions the export asked for went. Null when it asked for none."},"createdAt":{"type":"string"},"completedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"downloadUrl":{"description":"Signed, valid for 15 minutes. Null until the file is ready and after it expires.","type":["string","null"]}},"required":["id","kind","format","status","filters","filename","rowCount","error","notes","requestedBy","onFinish","createdAt","completedAt","expiresAt","downloadUrl"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Folder":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":["string","null"]},"name":{"type":"string"},"documentCount":{"type":"number"}},"required":["id","parentId","name","documentCount"]},"FolderPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":["string","null"]},"name":{"type":"string"},"documentCount":{"type":"number"}},"required":["id","parentId","name","documentCount"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Hold":{"type":"object","properties":{"id":{"type":"string"},"held":{"type":"boolean"},"flags":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["info","warn","block"]},"by":{"description":"Who put it there, where that decides who may take it off.","type":"string"}},"required":["code","message","severity"]}}},"required":["id","held","flags"]},"Reached":{"type":"object","properties":{"reached":{"type":"array","items":{"type":"string"},"description":"Who can read it now and has been told."}},"required":["reached"]},"Merchant":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"defaultCategoryId":{"type":["string","null"]},"website":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"taxId":{"type":["string","null"]},"is1099":{"type":"boolean"},"merchantType":{"anyOf":[{"type":"string","enum":["airline","lodging","car_rental","ground_transport","fuel","dining","grocery","office","software","utilities","supplies","other"]},{"type":"null"}],"description":"What kind of business this is. Null lets a rule work it out from the card code or the name."},"expenseCount":{"type":"number"},"totalMinor":{"type":"number","description":"Non-void expenses, in the workspace's base currency."},"aliases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Other spellings that file here: left by a merge or a rename."}},"required":["id","name","defaultCategoryId","website","phone","address","taxId","is1099","merchantType","expenseCount","totalMinor","aliases"]},"MerchantPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"defaultCategoryId":{"type":["string","null"]},"website":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"taxId":{"type":["string","null"]},"is1099":{"type":"boolean"},"merchantType":{"anyOf":[{"type":"string","enum":["airline","lodging","car_rental","ground_transport","fuel","dining","grocery","office","software","utilities","supplies","other"]},{"type":"null"}],"description":"What kind of business this is. Null lets a rule work it out from the card code or the name."},"expenseCount":{"type":"number"},"totalMinor":{"type":"number","description":"Non-void expenses, in the workspace's base currency."},"aliases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Other spellings that file here: left by a merge or a rename."}},"required":["id","name","defaultCategoryId","website","phone","address","taxId","is1099","merchantType","expenseCount","totalMinor","aliases"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"MileageLog":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"expenseId":{"type":"string"},"reference":{"type":"string"},"status":{"type":"string"},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"date":{"type":"string"},"purpose":{"type":"string"},"origin":{"type":"string"},"stops":{"type":"array","items":{"type":"string"},"description":"Places along the way."},"destination":{"type":"string"},"originLabel":{"description":"The name of a saved place at this address, such as Home.","type":["string","null"]},"destinationLabel":{"type":["string","null"]},"departed":{"description":"HH:MM.","type":["string","null"]},"arrived":{"description":"HH:MM.","type":["string","null"]},"distance":{"type":"number"},"unit":{"type":"string"},"calculation":{"type":"string","description":"How the amount was reached: 8.1 mi x $0.76/mi = $6.16."},"purposeKind":{"type":"string","enum":["business","medical","charity"],"description":"What the trip was for, by the rate it took."},"roundTrip":{"type":"boolean"},"odometerStart":{"type":["number","null"]},"odometerEnd":{"type":["number","null"]},"odometerPhotos":{"type":"object","properties":{"start":{"type":["string","null"]},"end":{"type":["string","null"]},"merged":{"type":["string","null"]}},"required":["start","end","merged"],"description":"Documents holding a photo of each reading, and the one image they are merged into."},"receiptDocumentId":{"description":"The generated mileage receipt.","type":["string","null"]},"vehicle":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"plate":{"type":["string","null"]}},"required":["id","name","plate"]},{"type":"null"}]},"rateMinor":{"type":"number","description":"A hundredth of a cent per unit."},"rateName":{"type":["string","null"]},"amountMinor":{"type":"number"},"currency":{"type":"string"},"entry":{"type":"string","enum":["MANUAL","ODOMETER","MAP","GPS"],"description":"How the distance came to be known. Only MAP and GPS were measured."},"driven":{"type":"number","description":"The whole drive. `distance` is what is claimed, which is less when a commute came off it."},"commuteExcluded":{"description":"The commute taken off this trip, or null if none was.","type":["number","null"]},"taxMinor":{"description":"The tax on this trip, when its workspace tracks tax on distance.","type":["number","null"]}},"required":["expenseId","reference","status","owner","date","purpose","origin","stops","destination","originLabel","destinationLabel","departed","arrived","distance","unit","calculation","purposeKind","roundTrip","odometerStart","odometerEnd","odometerPhotos","receiptDocumentId","vehicle","rateMinor","rateName","amountMinor","currency","entry","driven","commuteExcluded","taxMinor"]}},"currency":{"type":"string"},"totals":{"type":"object","properties":{"trips":{"type":"number"},"amountMinor":{"type":"number"},"distances":{"type":"array","items":{"type":"object","properties":{"unit":{"type":"string"},"distance":{"type":"number"}},"required":["unit","distance"]}}},"required":["trips","amountMinor","distances"]},"months":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string","description":"YYYY-MM."},"trips":{"type":"number"},"amountMinor":{"type":"number"}},"required":["month","trips","amountMinor"]}},"tally":{"anyOf":[{"type":"object","properties":{"year":{"type":"number"},"distance":{"type":"number"},"limit":{"type":"number"},"unit":{"type":"string"},"remaining":{"type":"number"}},"required":["year","distance","limit","unit","remaining"]},{"type":"null"}],"description":"Where the person stands against a yearly limit, for a rate that drops after it."}},"required":["from","to","rows","currency","totals","months","tally"]},"MileageRate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"unit":{"type":"string","enum":["mi","km"]},"rateMinor":{"type":"number","description":"A hundredth of a cent per unit, so 72.5 cents is 7250."},"currency":{"type":"string"},"effectiveFrom":{"type":"string"},"effectiveTo":{"description":"The last day this rate covers. Null runs until a newer rate of the same name.","type":["string","null"]},"isDefault":{"type":"boolean"},"archived":{"type":"boolean"},"taxBasisPoints":{"description":"Tax on the reclaimable part, in hundredths of a percent. 2000 is 20%. Used while the workspace tracks tax on distance.","type":["number","null"]},"taxReclaimableMinor":{"description":"The fixed part of this rate tax can be reclaimed on, at the same scale as rateMinor.","type":["number","null"]},"autoGenerated":{"type":"boolean","description":"The government-rate job added this row, and no admin has changed its amount, start or end."}},"required":["id","name","unit","rateMinor","currency","effectiveFrom","effectiveTo","isDefault","archived","taxBasisPoints","taxReclaimableMinor","autoGenerated"]},"MileageRatePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"unit":{"type":"string","enum":["mi","km"]},"rateMinor":{"type":"number","description":"A hundredth of a cent per unit, so 72.5 cents is 7250."},"currency":{"type":"string"},"effectiveFrom":{"type":"string"},"effectiveTo":{"description":"The last day this rate covers. Null runs until a newer rate of the same name.","type":["string","null"]},"isDefault":{"type":"boolean"},"archived":{"type":"boolean"},"taxBasisPoints":{"description":"Tax on the reclaimable part, in hundredths of a percent. 2000 is 20%. Used while the workspace tracks tax on distance.","type":["number","null"]},"taxReclaimableMinor":{"description":"The fixed part of this rate tax can be reclaimed on, at the same scale as rateMinor.","type":["number","null"]},"autoGenerated":{"type":"boolean","description":"The government-rate job added this row, and no admin has changed its amount, start or end."}},"required":["id","name","unit","rateMinor","currency","effectiveFrom","effectiveTo","isDefault","archived","taxBasisPoints","taxReclaimableMinor","autoGenerated"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"PerDiemRate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":["string","null"]},"region":{"type":["string","null"]},"amountMinor":{"type":"number"},"currency":{"type":"string"},"archived":{"type":"boolean"}},"required":["id","name","country","region","amountMinor","currency","archived"]},"PerDiemRatePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":["string","null"]},"region":{"type":["string","null"]},"amountMinor":{"type":"number"},"currency":{"type":"string"},"archived":{"type":"boolean"}},"required":["id","name","country","region","amountMinor","currency","archived"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]},"clientId":{"type":["string","null"]},"clientName":{"type":["string","null"]},"budgetMinor":{"type":["number","null"]},"spentMinor":{"type":"number","description":"Non-void expenses, in the workspace's base currency."},"expenseCount":{"type":"number"},"archived":{"type":"boolean"}},"required":["id","name","code","clientId","clientName","budgetMinor","spentMinor","expenseCount","archived"]},"ProjectPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]},"clientId":{"type":["string","null"]},"clientName":{"type":["string","null"]},"budgetMinor":{"type":["number","null"]},"spentMinor":{"type":"number","description":"Non-void expenses, in the workspace's base currency."},"expenseCount":{"type":"number"},"archived":{"type":"boolean"}},"required":["id","name","code","clientId","clientName","budgetMinor","spentMinor","expenseCount","archived"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ReportDetail":{"type":"object","properties":{"purpose":{"type":["string","null"]},"rejectionReason":{"type":["string","null"]},"rejectedAt":{"type":["string","null"]},"reimbursedAt":{"type":["string","null"]},"exportedAt":{"type":["string","null"]},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string"},"status":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},"kind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"merchantName":{"type":["string","null"]},"tripTitle":{"description":"For a trip, what to call it in a list.","type":["string","null"]},"description":{"type":["string","null"]},"date":{"type":"string"},"currency":{"type":"string"},"amountMinor":{"type":"number"},"baseAmountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"alsoCategories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Further categories it can be found under. Its money stays in category."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]}},"required":["id","name","code"]},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"moneyFlow":{"type":"string","enum":["IN","OUT"],"description":"Which way the money went."},"invoiceNumber":{"type":["string","null"]},"matched":{"type":"boolean","description":"A card charge has been matched to it."},"connectedApps":{"type":"array","items":{"type":"string"},"description":"Connected services it has been posted to."},"reportId":{"type":["string","null"]},"externalId":{"description":"A developer's own reference, exactly as sent.","type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["info","warn","block"]},"by":{"description":"Who put it there, where that decides who may take it off.","type":"string"}},"required":["code","message","severity"]}},"reviewFields":{"type":"array","items":{"type":"string"}},"thumbnailUrl":{"type":["string","null"]},"documentId":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":["string","null"]}},"required":["id","name","color"]}},"attendeeCount":{"type":"number"},"fxRate":{"type":"number","description":"What one unit of the expense currency is worth in the base currency."},"held":{"type":"boolean","description":"Held back from its report until someone releases it."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","number","reference","status","kind","merchantName","tripTitle","description","date","currency","amountMinor","baseAmountMinor","taxMinor","category","alsoCategories","project","client","owner","moneyFlow","invoiceNumber","matched","connectedApps","reportId","externalId","billable","reimbursable","paymentType","confidence","flags","reviewFields","thumbnailUrl","documentId","tags","attendeeCount","fxRate","held","createdAt","updatedAt"]}},"findings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","const":"POLICY_VIOLATION"},"ruleId":{"type":"string"},"type":{"type":"string","enum":["MAX_AMOUNT","DAILY_LIMIT","RECEIPT_REQUIRED","MAX_AGE_DAYS","CATEGORY_REQUIRED","PROJECT_REQUIRED","DESCRIPTION_REQUIRED","ATTENDEES_REQUIRED","PROHIBITED","WEEKEND_SPEND","ITEMIZED_RECEIPT_REQUIRED","TAG_REQUIRED","FUTURE_DATE","COMPANY_CARD_REQUIRED","PROHIBITED_ITEM","ATTENDEE_LIMIT","RECEIPT_MISMATCH","BILLABLE_NOT_ALLOWED","CONVERSION_SURCHARGE","RATE_OUT_OF_POLICY","DISTANCE_INCREASED","NO_ROUTE","INACTIVE_VENDOR","OVER_AUTO_APPROVAL","TAG_OUT_OF_POLICY","TAX_OUT_OF_POLICY","TAX_REQUIRED","AI_GENERATED_RECEIPT","TRIP_LIMIT","FRINGE_BENEFITS"]},"severity":{"type":"string","enum":["WARN","BLOCK_SUBMIT","WAIVE"]},"expenseId":{"type":"string"},"expenseReference":{"type":"string"},"message":{"type":"string"},"reviewerOnly":{"description":"Evidence for a reviewer. It never reaches the person who uploaded the receipt.","type":"boolean"}},"required":["code","ruleId","type","severity","expenseId","expenseReference","message"]}},"approvals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"level":{"type":"number"},"approver":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"actedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}],"description":"Set when someone else acted for the approver."},"state":{"type":"string","enum":["APPROVED","REJECTED","PENDING","SKIPPED","WAITING"]},"comment":{"type":["string","null"]},"decidedAt":{"type":["string","null"]}},"required":["id","level","approver","actedBy","state","comment","decidedAt"]}},"participants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"description":"People added to the report. They can read it and comment, nothing more."},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["TEXT","DATE","LIST","FORMULA"]},"options":{"type":"array","items":{"type":"string"}},"formula":{"type":["string","null"]},"required":{"type":"boolean"},"enabled":{"type":"boolean"},"position":{"type":"number"},"disabledOptions":{"description":"List values turned off: kept on reports that hold them, and not offered for new ones.","type":"array","items":{"type":"string"}},"imported":{"description":"Came from the connected books, so it cannot be deleted and its values only turn on and off.","type":"boolean"},"value":{"type":["string","null"]}},"required":["id","name","type","options","formula","required","enabled","position","value"]}},"titleLocked":{"type":"boolean","description":"True when a title typed here would be refused: the workspace's formula sets it."},"noApprovalStep":{"type":"boolean","description":"Submitting needs nobody's approval, so it finishes the report."},"exportable":{"type":"boolean","description":"This person can export this report or share it. Someone added only to read and comment cannot."},"ccEmails":{"type":"array","items":{"type":"string"},"description":"Addresses outside the workspace copied on each submission."},"canPickApprover":{"type":"boolean","description":"A draft whose workflow leaves the next approver open, so the person submitting can name one."},"canSendOutside":{"type":"boolean","description":"A draft in a workspace with nobody else to approve it, which can go to someone outside instead."},"outsideApprover":{"anyOf":[{"type":"object","properties":{"email":{"type":["string","null"]},"expiresAt":{"type":"string"}},"required":["email","expiresAt"]},{"type":"null"}],"description":"Someone with no account has this report, through a link. A null email is a link that went out on a PDF."},"expenseColumns":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"customField1":{"type":["string","null"]},"customField2":{"type":["string","null"]},"mcc":{"type":["string","null"]},"posted":{"type":["string","null"]},"taxCode":{"type":["string","null"]},"taxRate":{"type":["string","null"]}},"required":["customField1","customField2","mcc","posted","taxCode","taxRate"]},"description":"What the expense table's optional columns read, by expense id."},"customFieldLabels":{"type":"object","properties":{"first":{"type":["string","null"]},"second":{"type":["string","null"]}},"required":["first","second"],"description":"The workspace's first two custom fields, which the Custom field 1 and 2 columns show."},"withdrawalId":{"description":"The batch that pays this report.","type":["string","null"]},"internationalReimbursementId":{"description":"The same, where the batch pays in another currency than the workspace's.","type":["string","null"]},"final":{"type":"boolean","description":"Nothing more is due: paid, or approved with nothing to pay, or done."},"findingsAccepted":{"anyOf":[{"type":"object","properties":{"by":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}]},"at":{"type":"string"}},"required":["by","at"]},{"type":"null"}],"description":"Someone has reviewed and accepted what the receipt checks found."},"auditNote":{"description":"What the receipt audit did on this report, on a plan that has it. There even when it found nothing.","type":["string","null"]},"needsAcceptance":{"type":"boolean","description":"Receipt checks found something, and approving this report has to wait for someone to accept it."},"timeline":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"actor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}],"description":"Null when PaperTotal did it on a schedule."},"onBehalfOf":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}],"description":"The person whose name this was done in, when the actor was covering for them."},"detail":{"description":"The reason, comment or note that came with the action.","type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"at":{"type":"string"}},"required":["id","action","actor","onBehalfOf","detail","metadata","at"]}},"heldExpenseIds":{"type":"array","items":{"type":"string"}},"actions":{"type":"array","items":{"type":"string","enum":["delete","approve","submit","retract","reject","reopen","close","mark_exported","mark_reimbursed","edit","reassign","duplicate","invite","accept_findings","received_payment"]}},"selfApproval":{"type":"boolean","description":"True when the caller's approval would be a self-approval the workspace allows."},"deciding":{"type":"boolean","description":"The caller holds a step that is live now, for themselves or as a delegate. Without one, a workspace admin has to bypass."},"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]},"stage":{"type":"string","enum":["DRAFT","SUBMITTED","OUTSTANDING","APPROVED","REJECTED","PAID","EXPORTED","DONE"]},"paymentStage":{"anyOf":[{"type":"string","enum":["MARKED_AS_PAID","WITHDRAWING","CONFIRMED"]},{"type":"null"}]},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"currency":{"type":"string"},"totalMinor":{"type":"number"},"reimbursableMinor":{"type":"number"},"expenseCount":{"type":"number"},"findingCount":{"type":"number"},"periodStart":{"type":["string","null"]},"periodEnd":{"type":["string","null"]},"autoCreated":{"type":"boolean"},"waitingOn":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"description":"Who the report is with right now."},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["purpose","rejectionReason","rejectedAt","reimbursedAt","exportedAt","expenses","findings","approvals","participants","fields","titleLocked","noApprovalStep","exportable","ccEmails","canPickApprover","canSendOutside","outsideApprover","expenseColumns","customFieldLabels","withdrawalId","internationalReimbursementId","final","findingsAccepted","auditNote","needsAcceptance","timeline","heldExpenseIds","actions","selfApproval","deciding","id","number","reference","title","status","stage","paymentStage","owner","currency","totalMinor","reimbursableMinor","expenseCount","findingCount","periodStart","periodEnd","autoCreated","waitingOn","submittedAt","approvedAt","createdAt","updatedAt"]},"ReportPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]},"stage":{"type":"string","enum":["DRAFT","SUBMITTED","OUTSTANDING","APPROVED","REJECTED","PAID","EXPORTED","DONE"],"description":"Submitted until someone has acted on it. Outstanding once it is part way: under review, with a hold, or partly approved."},"paymentStage":{"anyOf":[{"type":"string","enum":["MARKED_AS_PAID","WITHDRAWING","CONFIRMED"]},{"type":"null"}]},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"currency":{"type":"string"},"totalMinor":{"type":"number"},"reimbursableMinor":{"type":"number"},"expenseCount":{"type":"number"},"findingCount":{"type":"number"},"periodStart":{"type":["string","null"]},"periodEnd":{"type":["string","null"]},"autoCreated":{"type":"boolean"},"waitingOn":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"description":"Who the report is with right now."},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","number","reference","title","status","stage","paymentStage","owner","currency","totalMinor","reimbursableMinor","expenseCount","findingCount","periodStart","periodEnd","autoCreated","waitingOn","submittedAt","approvedAt","createdAt","updatedAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Tag":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"glCode":{"type":["string","null"]},"color":{"type":["string","null"]},"archived":{"type":"boolean"},"expenseCount":{"type":"number"},"approverId":{"description":"Reviews any report carrying this tag, after any category approvers and ahead of the workflow.","type":["string","null"]},"approverName":{"type":["string","null"]},"parentId":{"description":"The tag this one sits under. An expense carrying this one has to carry that one too.","type":["string","null"]},"parentName":{"type":["string","null"]}},"required":["id","name","groupName","glCode","color","archived","expenseCount","approverId","approverName","parentId","parentName"]},"TagPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"glCode":{"type":["string","null"]},"color":{"type":["string","null"]},"archived":{"type":"boolean"},"expenseCount":{"type":"number"},"approverId":{"description":"Reviews any report carrying this tag, after any category approvers and ahead of the workflow.","type":["string","null"]},"approverName":{"type":["string","null"]},"parentId":{"description":"The tag this one sits under. An expense carrying this one has to carry that one too.","type":["string","null"]},"parentName":{"type":["string","null"]}},"required":["id","name","groupName","glCode","color","archived","expenseCount","approverId","approverName","parentId","parentName"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"TaxSummary":{"type":"object","properties":{"year":{"type":"number"},"from":{"type":"string"},"to":{"type":"string"},"fiscalYearStartMonth":{"type":"number"},"currency":{"type":"string"},"notice":{"type":"string"},"mileageNotice":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"line":{"type":"string","description":"The Schedule C line: \"9\", \"24b\"."},"label":{"type":"string"},"count":{"type":"number"},"spentMinor":{"type":"number"},"deductibleMinor":{"type":"number"},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"deductiblePct":{"type":"number"},"count":{"type":"number"},"spentMinor":{"type":"number"},"deductibleMinor":{"type":"number"}},"required":["id","name","deductiblePct","count","spentMinor","deductibleMinor"]}}},"required":["line","label","count","spentMinor","deductibleMinor","categories"]}},"mileage":{"type":"array","items":{"type":"object","properties":{"unit":{"type":"string"},"trips":{"type":"number"},"distance":{"type":"number"},"deductionMinor":{"type":"number"}},"required":["unit","trips","distance","deductionMinor"]}},"unassigned":{"type":"object","properties":{"count":{"type":"number"},"spentMinor":{"type":"number"}},"required":["count","spentMinor"],"description":"Spending on a category with no tax line, or on no category."},"excluded":{"type":"object","properties":{"count":{"type":"number"},"spentMinor":{"type":"number"}},"required":["count","spentMinor"],"description":"Expenses a person marked as not deductible."},"payees":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"merchantId":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"},"totalMinor":{"type":"number"},"cardMinor":{"type":"number","description":"Paid by card. Card payments are reported by the processor, so a preparer usually sets these aside."},"taxIdOnFile":{"type":"boolean","description":"Whether a tax id is on file. The number itself is never shown or exported."}},"required":["merchantId","name","count","totalMinor","cardMinor","taxIdOnFile"]}}},"required":["from","to","rows"],"description":"1099s follow the calendar year whatever the fiscal year, so this has its own dates."},"needsReview":{"type":"number","description":"Counted above, but a person has not confirmed them yet."},"unconverted":{"type":"number","description":"Expenses with no exchange rate yet. They are not in these figures."},"spentMinor":{"type":"number"},"deductibleMinor":{"type":"number"}},"required":["year","from","to","fiscalYearStartMonth","currency","notice","mileageNotice","lines","mileage","unassigned","excluded","payees","needsReview","unconverted","spentMinor","deductibleMinor"]},"TravelTrip":{"type":"object","properties":{"id":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"type":"string","description":"YYYY-MM-DD."},"returnsOn":{"description":"YYYY-MM-DD.","type":["string","null"]},"merchantName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"currency":{"type":["string","null"]},"totalMinor":{"description":"In minor units of the currency: 1250 is 12.50.","type":["number","null"]},"segments":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]},"description":"Flights, stays, cars and trains, in order."},"documentIds":{"type":"array","items":{"type":"string"},"description":"The itinerary and the receipts filed against this trip."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","ownerId","name","origin","destination","departsOn","returnsOn","merchantName","bookingReference","currency","totalMinor","segments","documentIds","createdAt","updatedAt"]},"TravelTripPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"type":"string","description":"YYYY-MM-DD."},"returnsOn":{"description":"YYYY-MM-DD.","type":["string","null"]},"merchantName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"currency":{"type":["string","null"]},"totalMinor":{"description":"In minor units of the currency: 1250 is 12.50.","type":["number","null"]},"segments":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]},"description":"Flights, stays, cars and trains, in order."},"documentIds":{"type":"array","items":{"type":"string"},"description":"The itinerary and the receipts filed against this trip."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","ownerId","name","origin","destination","departsOn","returnsOn","merchantName","bookingReference","currency","totalMinor","segments","documentIds","createdAt","updatedAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Trip":{"type":"object","properties":{"expenseId":{"type":"string"},"reference":{"type":"string"},"status":{"type":"string"},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"date":{"type":"string"},"purpose":{"type":"string"},"origin":{"type":"string"},"stops":{"type":"array","items":{"type":"string"},"description":"Places along the way."},"destination":{"type":"string"},"originLabel":{"description":"The name of a saved place at this address, such as Home.","type":["string","null"]},"destinationLabel":{"type":["string","null"]},"departed":{"description":"HH:MM.","type":["string","null"]},"arrived":{"description":"HH:MM.","type":["string","null"]},"distance":{"type":"number"},"unit":{"type":"string"},"calculation":{"type":"string","description":"How the amount was reached: 8.1 mi x $0.76/mi = $6.16."},"purposeKind":{"type":"string","enum":["business","medical","charity"],"description":"What the trip was for, by the rate it took."},"roundTrip":{"type":"boolean"},"odometerStart":{"type":["number","null"]},"odometerEnd":{"type":["number","null"]},"odometerPhotos":{"type":"object","properties":{"start":{"type":["string","null"]},"end":{"type":["string","null"]},"merged":{"type":["string","null"]}},"required":["start","end","merged"],"description":"Documents holding a photo of each reading, and the one image they are merged into."},"receiptDocumentId":{"description":"The generated mileage receipt.","type":["string","null"]},"vehicle":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"plate":{"type":["string","null"]}},"required":["id","name","plate"]},{"type":"null"}]},"rateMinor":{"type":"number","description":"A hundredth of a cent per unit."},"rateName":{"type":["string","null"]},"amountMinor":{"type":"number"},"currency":{"type":"string"},"entry":{"type":"string","enum":["MANUAL","ODOMETER","MAP","GPS"],"description":"How the distance came to be known. Only MAP and GPS were measured."},"driven":{"type":"number","description":"The whole drive. `distance` is what is claimed, which is less when a commute came off it."},"commuteExcluded":{"description":"The commute taken off this trip, or null if none was.","type":["number","null"]},"taxMinor":{"description":"The tax on this trip, when its workspace tracks tax on distance.","type":["number","null"]}},"required":["expenseId","reference","status","owner","date","purpose","origin","stops","destination","originLabel","destinationLabel","departed","arrived","distance","unit","calculation","purposeKind","roundTrip","odometerStart","odometerEnd","odometerPhotos","receiptDocumentId","vehicle","rateMinor","rateName","amountMinor","currency","entry","driven","commuteExcluded","taxMinor"]},"TripRoutes":{"type":"array","items":{"type":"object","properties":{"origin":{"type":"string"},"stops":{"type":"array","items":{"type":"string"}},"destination":{"type":"string"},"distance":{"type":"number","description":"One way, as it would be typed."},"unit":{"type":"string"},"roundTrip":{"type":"boolean"},"lastDriven":{"type":"string"},"uses":{"type":"number"}},"required":["origin","stops","destination","distance","unit","roundTrip","lastDriven","uses"]}},"ExpenseDetails":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string"},"status":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},"kind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"merchantName":{"type":["string","null"]},"tripTitle":{"description":"For a trip, what to call it in a list.","type":["string","null"]},"description":{"type":["string","null"]},"date":{"type":"string"},"currency":{"type":"string"},"amountMinor":{"type":"number"},"baseAmountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"alsoCategories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Further categories it can be found under. Its money stays in category."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]}},"required":["id","name","code"]},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"moneyFlow":{"type":"string","enum":["IN","OUT"],"description":"Which way the money went."},"invoiceNumber":{"type":["string","null"]},"matched":{"type":"boolean","description":"A card charge has been matched to it."},"connectedApps":{"type":"array","items":{"type":"string"},"description":"Connected services it has been posted to."},"reportId":{"type":["string","null"]},"externalId":{"description":"A developer's own reference, exactly as sent.","type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"anyOf":[{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},{"type":"null"}]},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["info","warn","block"]},"by":{"description":"Who put it there, where that decides who may take it off.","type":"string"}},"required":["code","message","severity"]}},"reviewFields":{"type":"array","items":{"type":"string"}},"thumbnailUrl":{"type":["string","null"]},"documentId":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":["string","null"]}},"required":["id","name","color"]}},"attendeeCount":{"type":"number"},"fxRate":{"type":"number","description":"What one unit of the expense currency is worth in the base currency. Zero means no rate is available yet, so baseAmountMinor is zero too and the expense is held in review."},"held":{"type":"boolean","description":"Held back from its report until someone releases it."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"notes":{"type":["string","null"]},"subtotalMinor":{"type":["number","null"]},"tipMinor":{"type":["number","null"]},"discountMinor":{"type":["number","null"]},"shippingMinor":{"type":["number","null"]},"paymentAccountId":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"poNumber":{"description":"The buyer's purchase order number, as an invoice prints it.","type":["string","null"]},"dueDate":{"description":"When an invoice falls due.","type":["string","null"]},"mcc":{"description":"The merchant category code a card network gave the merchant, four digits.","type":["string","null"]},"taxDeductible":{"type":"boolean"},"quantity":{"type":["number","null"]},"rateMinor":{"type":["number","null"]},"unit":{"type":["string","null"]},"trip":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"vehicleId":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"required":["name"]}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"editedFields":{"type":"array","items":{"type":"string"}},"duplicateOfId":{"type":["string","null"]},"duplicateReview":{"anyOf":[{"type":"object","properties":{"outcome":{"type":"string","enum":["DISMISSED","KEPT"]},"reason":{"type":"string"},"engine":{"type":"string","enum":["rules","claude"]},"at":{"type":"string"}},"required":["outcome","reason","engine","at"]},{"type":"null"}],"description":"What the second look at a flagged copy decided, and why."},"canSettleDuplicate":{"type":"boolean","description":"Whether the caller can answer the duplicate question on this expense."},"splitParentId":{"type":["string","null"]},"access":{"type":"object","properties":{"canEdit":{"type":"boolean"},"limited":{"type":"boolean","description":"Out for approval: only the amount, description, merchant, date, category, tags and attendees can change."},"reason":{"description":"Why it cannot be edited, or how far it can, in words for the person looking at it.","type":["string","null"]},"amountLocked":{"type":"boolean","description":"The amount is a card's own figure."},"canDelete":{"type":"boolean"},"canRestore":{"type":"boolean"},"restoreBlocked":{"description":"Why it cannot be restored: split, or merged, for good.","type":["string","null"]},"canSplit":{"type":"boolean"},"canMove":{"type":"boolean"}},"required":["canEdit","limited","reason","amountLocked","canDelete","canRestore","restoreBlocked","canSplit","canMove"],"description":"What the caller may do with it."},"splitInto":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"amountMinor":{"type":"number"}},"required":["id","reference","amountMinor"]},"description":"This expense was divided: its parts now count in its place."},"mergedIntoId":{"description":"A merge absorbed this expense. Where it went.","type":["string","null"]},"report":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"}},"required":["id","title","status"]},{"type":"null"}],"description":"The report this expense is on, named even where the caller could not list it."},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"type":["number","null"]},"amountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"categoryId":{"type":["string","null"]}},"required":["id","position","description","sku","quantity","unitPriceMinor","amountMinor","taxMinor","categoryId"]}},"documentIds":{"type":"array","items":{"type":"string"}}},"required":["id","number","reference","status","kind","merchantName","tripTitle","description","date","currency","amountMinor","baseAmountMinor","taxMinor","category","alsoCategories","project","client","owner","moneyFlow","invoiceNumber","matched","connectedApps","reportId","externalId","billable","reimbursable","paymentType","confidence","flags","reviewFields","thumbnailUrl","documentId","tags","attendeeCount","fxRate","held","createdAt","updatedAt","notes","subtotalMinor","tipMinor","discountMinor","shippingMinor","paymentAccountId","cardLast4","poNumber","dueDate","mcc","taxDeductible","quantity","rateMinor","unit","trip","vehicleId","attendees","customFields","editedFields","duplicateOfId","duplicateReview","canSettleDuplicate","splitParentId","access","splitInto","mergedIntoId","report","lines","documentIds"]}},"Vehicle":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"ownerName":{"type":["string","null"]},"name":{"type":"string"},"plate":{"type":["string","null"]},"archived":{"type":"boolean"},"expenseCount":{"type":"number"}},"required":["id","userId","ownerName","name","plate","archived","expenseCount"]},"VehiclePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"ownerName":{"type":["string","null"]},"name":{"type":"string"},"plate":{"type":["string","null"]},"archived":{"type":"boolean"},"expenseCount":{"type":"number"}},"required":["id","userId","ownerName","name","plate","archived","expenseCount"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ApiKeyVerification":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string","description":"The first characters of the key."},"kind":{"type":"string","enum":["PERSONAL","WORKSPACE"],"description":"PERSONAL acts as the person who made it and ends when they leave. WORKSPACE belongs to the workspace and outlives them."},"environment":{"type":"string","enum":["LIVE","TEST"]},"workspaceId":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"},"description":"Every scope this key holds right now."},"fullAccess":{"type":"boolean","description":"Every scope, present and future."},"role":{"type":"string","description":"The role its reach is measured against: a scope opens a route, and the role decides what the route may do."},"signingRequired":{"type":"boolean","description":"A request with no valid signature is refused."},"expiresAt":{"type":["string","null"]}},"required":["id","name","prefix","kind","environment","workspaceId","scopes","fullAccess","role","signingRequired","expiresAt"]},"ClientCertificate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"fingerprint":{"type":"string","description":"SHA-256 of the certificate, lowercase hex."},"subject":{"type":["string","null"]},"notAfter":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","name","fingerprint","subject","notAfter","revokedAt","createdAt"]},"ClientCertificatePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"fingerprint":{"type":"string","description":"SHA-256 of the certificate, lowercase hex."},"subject":{"type":["string","null"]},"notAfter":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","name","fingerprint","subject","notAfter","revokedAt","createdAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ReleaseNotePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"string"},"product":{"type":"string","enum":["app_web","api","mcp","model_document_extraction","model_bank_statements","model_checks","model_fraud_detection"]},"environments":{"type":"array","items":{"type":"string","enum":["production","sandbox"]}},"title":{"type":"string"},"body":{"type":"string"},"publishedAt":{"type":"string"}},"required":["id","version","product","environments","title","body","publishedAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"endpointId":{"type":"string"},"eventId":{"type":"string"},"eventType":{"type":"string"},"state":{"type":"string","enum":["FAILED","PENDING","DELIVERED","ABANDONED"]},"attempts":{"type":"number"},"responseStatus":{"type":["number","null"]},"responseBody":{"type":["string","null"]},"nextAttemptAt":{"type":["string","null"]},"deliveredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"payload":{}},"required":["id","endpointId","eventId","eventType","state","attempts","responseStatus","responseBody","nextAttemptAt","deliveredAt","createdAt","payload"]},"WebhookDeliveryPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"endpointId":{"type":"string"},"eventId":{"type":"string"},"eventType":{"type":"string"},"state":{"type":"string","enum":["FAILED","PENDING","DELIVERED","ABANDONED"]},"attempts":{"type":"number"},"responseStatus":{"type":["number","null"]},"responseBody":{"type":["string","null"]},"nextAttemptAt":{"type":["string","null"]},"deliveredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"payload":{}},"required":["id","endpointId","eventId","eventType","state","attempts","responseStatus","responseBody","nextAttemptAt","deliveredAt","createdAt","payload"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"WebhookEndpoint":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","CONFIRMED"],"description":"PENDING receives the subscription event and nothing else, until POST /v1/webhooks/confirm."},"pendingUntil":{"description":"A pending endpoint not confirmed by then is deleted.","type":["string","null"]},"confirmedAt":{"type":["string","null"]},"apiKeyId":{"description":"Set when this endpoint belongs to one API key rather than the workspace.","type":["string","null"]},"id":{"type":"string"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"failureCount":{"type":"number"},"disabledAt":{"description":"Set while the endpoint is off.","type":["string","null"]},"createdAt":{"type":"string"}},"required":["status","pendingUntil","confirmedAt","apiKeyId","id","url","description","events","enabled","failureCount","disabledAt","createdAt"]},"WebhookEndpointPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","CONFIRMED"],"description":"PENDING receives the subscription event and nothing else, until POST /v1/webhooks/confirm."},"pendingUntil":{"description":"A pending endpoint not confirmed by then is deleted.","type":["string","null"]},"confirmedAt":{"type":["string","null"]},"apiKeyId":{"description":"Set when this endpoint belongs to one API key rather than the workspace.","type":["string","null"]},"id":{"type":"string"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"failureCount":{"type":"number"},"disabledAt":{"description":"Set while the endpoint is off.","type":["string","null"]},"createdAt":{"type":"string"}},"required":["status","pendingUntil","confirmedAt","apiKeyId","id","url","description","events","enabled","failureCount","disabledAt","createdAt"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"WebhookEndpointWithSecret":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","CONFIRMED"],"description":"PENDING receives the subscription event and nothing else, until POST /v1/webhooks/confirm."},"pendingUntil":{"description":"A pending endpoint not confirmed by then is deleted.","type":["string","null"]},"confirmedAt":{"type":["string","null"]},"apiKeyId":{"description":"Set when this endpoint belongs to one API key rather than the workspace.","type":["string","null"]},"secret":{"type":"string"},"id":{"type":"string"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"failureCount":{"type":"number"},"disabledAt":{"description":"Set while the endpoint is off.","type":["string","null"]},"createdAt":{"type":"string"}},"required":["status","pendingUntil","confirmedAt","apiKeyId","secret","id","url","description","events","enabled","failureCount","disabledAt","createdAt"]},"WebhookEventPayload":{"type":"object","properties":{"id":{"type":"string","description":"Stable across retries, so a repeat can be ignored."},"type":{"type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","createdAt","data"]}}}}