{"openapi":"3.1.0","info":{"title":"Accountable API","version":"1.0.0","description":"Read your books and change them through the same preview → policy → apply pipeline as the app and MCP. The API never moves money. Webhooks are signed with HMAC-SHA256; see /docs/api."},"servers":[{"url":"https://accountable.im"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"A personal access token (acc_pat_…) from Settings › Connected agents."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","required":["type","code","message","request_id"],"properties":{"type":{"type":"string","enum":["invalid_request","authentication","permission","not_found","conflict","rate_limited","server"]},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"}}}}}}},"paths":{"/v1/companies":{"get":{"operationId":"get_companies","summary":"Companies this token can open, with your role in each.","tags":["Companies"],"parameters":[],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}":{"get":{"operationId":"get_companies_company","summary":"One company: legal name, closed-through month and open months.","tags":["Companies"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/accounts":{"get":{"operationId":"get_companies_company_accounts","summary":"The chart of accounts.","tags":["Books"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"include_inactive","in":"query","required":false,"description":"true to include deactivated accounts","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/entries":{"get":{"operationId":"get_companies_company_entries","summary":"Journal entries, newest first, with cursor pagination (`{data, next_cursor, has_more}`).","tags":["Books"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"YYYY-MM-DD","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"YYYY-MM-DD","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1–200, default 50","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"next_cursor from the previous page","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/entries/{entryId}":{"get":{"operationId":"get_companies_company_entries_entryId","summary":"One journal entry with its lines.","tags":["Books"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"entryId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/periods":{"get":{"operationId":"get_companies_company_periods","summary":"Months and whether each is open or closed.","tags":["Books"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/profit-and-loss":{"get":{"operationId":"get_companies_company_reports_profit_and_loss","summary":"Profit and loss for a period (`period=2026-Q3`, `columns=months`, `basis=cash|accrual`). Also at /reports/pl.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"basis","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"columns","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"compare","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"pct","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/balance-sheet":{"get":{"operationId":"get_companies_company_reports_balance_sheet","summary":"Balance sheet at a period end. Also at /reports/bs.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"basis","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"columns","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"compare","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"pct","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/cash-flow":{"get":{"operationId":"get_companies_company_reports_cash_flow","summary":"Cash flow statement (indirect method). Also at /reports/cf.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"basis","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"columns","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"compare","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"pct","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/trial-balance":{"get":{"operationId":"get_companies_company_reports_trial_balance","summary":"Trial balance at a month end. Also at /reports/tb.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"basis","in":"query","required":false,"description":"string","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/general-ledger":{"get":{"operationId":"get_companies_company_reports_general_ledger","summary":"Every line in a period, by account. Also at /reports/gl.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"basis","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"account","in":"query","required":false,"description":"string","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/account-detail":{"get":{"operationId":"get_companies_company_reports_account_detail","summary":"One account's lines and running balance.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"basis","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"account","in":"query","required":false,"description":"string","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/metrics":{"get":{"operationId":"get_companies_company_reports_metrics","summary":"Cash, net burn, gross burn, runway, revenue and net income, each with its formula.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"today","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"burnMethod","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"fixedBurn","in":"query","required":false,"description":"integer","schema":{"type":"string"}},{"name":"basis","in":"query","required":false,"description":"string","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/transaction-list":{"get":{"operationId":"get_companies_company_reports_transaction_list","summary":"Transactions with filters (tab, q, category, from, to) and limit/offset. Also at /reports/transactions.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"tab","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"category","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"funding","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"method","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"string","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"integer","schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"description":"integer","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/transaction-detail":{"get":{"operationId":"get_companies_company_reports_transaction_detail","summary":"One transaction with its lines, rule and activity.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"id","in":"query","required":false,"description":"string","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/transaction-review":{"get":{"operationId":"get_companies_company_reports_transaction_review","summary":"Grouped questions and the light-look queue.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/close-overview":{"get":{"operationId":"get_companies_company_reports_close_overview","summary":"Close history, the oldest open month and days to close.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/planning":{"get":{"operationId":"get_companies_company_reports_planning","summary":"The planning baseline and saved scenarios.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"today","in":"query","required":false,"description":"string","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/ar-aging":{"get":{"operationId":"get_companies_company_reports_ar_aging","summary":"Receivables aging.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"asOf","in":"query","required":false,"description":"string","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/reports/ap-aging":{"get":{"operationId":"get_companies_company_reports_ap_aging","summary":"Payables aging.","tags":["Reports"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"asOf","in":"query","required":false,"description":"string","schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/commands/create_entry":{"post":{"operationId":"post_companies_company_commands_create_entry","summary":"Post a balanced journal entry. Large entries wait for a person's approval.","tags":["Entries"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"date":{"type":"string"},"memo":{"default":"","type":"string","maxLength":500},"source":{"default":"manual","type":"string","maxLength":80},"lines":{"minItems":2,"maxItems":500,"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"maxLength":64},"debit":{"default":0,"type":"integer","minimum":0,"maximum":1000000000000000},"credit":{"default":0,"type":"integer","minimum":0,"maximum":1000000000000000},"class":{"type":"string","maxLength":80},"department":{"type":"string","maxLength":80},"memo":{"type":"string","maxLength":500},"fx":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amountMinor":{"type":"integer","minimum":-1000000000000000,"maximum":1000000000000000},"rateE10":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"source":{"default":"ecb","type":"string","enum":["ecb","oxr","mock","stripe","bank","manual"]},"rateDate":{"type":"string"}},"required":["currency","amountMinor","rateE10"]},"basis":{"type":"string","enum":["both","accrual_only","cash_only"]}},"required":["accountId"]}},"sourceDocumentId":{"type":"string","maxLength":64},"reverseOn":{"type":"string"}},"required":["date","lines"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/reverse_entry":{"post":{"operationId":"post_companies_company_commands_reverse_entry","summary":"Post the mirror of an entry and link the two. Posted entries are never edited.","tags":["Entries"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"entryId":{"type":"string","minLength":1},"date":{"type":"string"},"memo":{"type":"string","maxLength":500}},"required":["entryId"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/create_account":{"post":{"operationId":"post_companies_company_commands_create_account","summary":"Add an account to the chart of accounts.","tags":["Accounts"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"code":{"type":"string","minLength":1,"maxLength":20},"name":{"type":"string","minLength":1,"maxLength":120},"type":{"type":"string","enum":["asset","liability","equity","revenue","cost_of_revenue","expense","other_income","other_expense"]},"subtype":{"type":"string","maxLength":40},"parentId":{"type":"string","minLength":1,"maxLength":64},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"revalue":{"type":"boolean"},"intercompanyCompanyId":{"type":"string","minLength":1,"maxLength":64},"intercompanyRole":{"type":"string","enum":["due_from","due_to","loan_receivable","loan_payable","interest_income","interest_expense","fee_income","fee_expense","investment","paid_in_capital"]}},"required":["code","name","type"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/update_account":{"post":{"operationId":"post_companies_company_commands_update_account","summary":"Rename or renumber an account.","tags":["Accounts"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"maxLength":64},"patch":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":20},"name":{"type":"string","minLength":1,"maxLength":120},"subtype":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"parentId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"revalue":{"type":"boolean"},"intercompanyCompanyId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"intercompanyRole":{"anyOf":[{"type":"string","enum":["due_from","due_to","loan_receivable","loan_payable","interest_income","interest_expense","fee_income","fee_expense","investment","paid_in_capital"]},{"type":"null"}]}}}},"required":["accountId","patch"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/deactivate_account":{"post":{"operationId":"post_companies_company_commands_deactivate_account","summary":"Hide an account from new postings.","tags":["Accounts"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"accountId":{"type":"string","minLength":1}},"required":["accountId"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/activate_account":{"post":{"operationId":"post_companies_company_commands_activate_account","summary":"Use a deactivated account again.","tags":["Accounts"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"accountId":{"type":"string","minLength":1}},"required":["accountId"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/categorize":{"post":{"operationId":"post_companies_company_commands_categorize","summary":"Categorize one or many transactions, optionally saving a rule.","tags":["Transactions"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"transactionIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"accountId":{"type":"string","minLength":1,"maxLength":64},"rule":{"type":"object","properties":{"matchValue":{"type":"string","minLength":1,"maxLength":200},"matchField":{"type":"string","enum":["description","raw_description"]}}}},"required":["transactionIds","accountId"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/answer_question":{"post":{"operationId":"post_companies_company_commands_answer_question","summary":"Answer a grouped question: categorize the group and save the rule.","tags":["Transactions"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"transactionIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"accountId":{"type":"string","minLength":1,"maxLength":64},"alwaysDoThis":{"default":true,"type":"boolean"}},"required":["transactionIds","accountId"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/split_transaction":{"post":{"operationId":"post_companies_company_commands_split_transaction","summary":"Split one transaction across categories.","tags":["Transactions"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"transactionId":{"type":"string","minLength":1},"lines":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"maxLength":64},"amount":{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},"memo":{"type":"string","maxLength":500}},"required":["accountId","amount"]}}},"required":["transactionId","lines"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/set_transaction_fields":{"post":{"operationId":"post_companies_company_commands_set_transaction_fields","summary":"Set the vendor name or memo.","tags":["Transactions"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"transactionIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"description":{"type":"string","minLength":1,"maxLength":200},"memo":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["transactionIds"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/mark_reviewed":{"post":{"operationId":"post_companies_company_commands_mark_reviewed","summary":"Mark transactions reviewed (or not).","tags":["Transactions"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"transactionIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"reviewed":{"default":true,"type":"boolean"}},"required":["transactionIds"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/match_transfer":{"post":{"operationId":"post_companies_company_commands_match_transfer","summary":"Match two transactions as a transfer between your own accounts.","tags":["Transactions"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"transactionIds":{"minItems":2,"maxItems":2,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"required":["transactionIds"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/unmatch_transfer":{"post":{"operationId":"post_companies_company_commands_unmatch_transfer","summary":"Undo a transfer match.","tags":["Transactions"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"groupId":{"type":"string","minLength":1,"maxLength":64},"states":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"memo":{"type":["string","null"]}},"required":["accountId","amount","memo"]}},"description":{"type":"string"},"memo":{"type":["string","null"]},"categorizedBy":{"type":["string","null"]},"confidence":{"type":["number","null"]},"reason":{"type":["string","null"]},"reviewState":{"type":"string","enum":["none","needs_review","reviewed"]},"suggestedAccountId":{"type":["string","null"]},"aiAttemptedAt":{"type":["string","null"]}},"required":["id","lines","description","memo","categorizedBy","confidence","reason","reviewState","suggestedAccountId","aiAttemptedAt"]}},"fxEntryId":{"type":"string","minLength":1,"maxLength":64}},"required":["groupId","states"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/set_transaction_rate":{"post":{"operationId":"post_companies_company_commands_set_transaction_rate","summary":"Change the exchange rate behind a foreign-currency transaction. A closed month stays closed: the difference posts in the first open month.","tags":["Transactions"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"transactionId":{"type":"string","minLength":1,"maxLength":64},"rateE10":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"source":{"default":"manual","type":"string","enum":["ecb","oxr","mock","stripe","bank","manual"]},"rateDate":{"type":"string"},"reason":{"type":"string","minLength":1,"maxLength":500},"stale":{"default":false,"type":"boolean"}},"required":["transactionId","rateE10","reason"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/create_rule":{"post":{"operationId":"post_companies_company_commands_create_rule","summary":"Create a categorization rule.","tags":["Rules"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"matchField":{"default":"description","type":"string","enum":["description","raw_description"]},"matchOp":{"default":"contains","type":"string","enum":["contains","equals","starts_with"]},"matchValue":{"type":"string","minLength":1,"maxLength":200},"direction":{"default":"any","type":"string","enum":["any","in","out"]},"minAmount":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},{"type":"null"}]},"maxAmount":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},{"type":"null"}]},"fundingAccountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"id":{"type":"string","minLength":1,"maxLength":64},"name":{"type":"string","maxLength":120},"accountId":{"type":"string","minLength":1,"maxLength":64},"setDescription":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"group":{"default":"yours","type":"string","enum":["yours","accountable"]},"priority":{"default":100,"type":"integer","minimum":0,"maximum":10000},"applyToExisting":{"default":false,"type":"boolean"},"active":{"default":true,"type":"boolean"}},"required":["matchValue","accountId"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/update_rule":{"post":{"operationId":"post_companies_company_commands_update_rule","summary":"Change a rule.","tags":["Rules"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"ruleId":{"type":"string","minLength":1},"patch":{"type":"object","properties":{"matchField":{"default":"description","type":"string","enum":["description","raw_description"]},"matchOp":{"default":"contains","type":"string","enum":["contains","equals","starts_with"]},"matchValue":{"type":"string","minLength":1,"maxLength":200},"direction":{"default":"any","type":"string","enum":["any","in","out"]},"minAmount":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},{"type":"null"}]},"maxAmount":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},{"type":"null"}]},"fundingAccountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":120},"accountId":{"type":"string","minLength":1,"maxLength":64},"setDescription":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"priority":{"type":"integer","minimum":0,"maximum":10000},"active":{"type":"boolean"}}}},"required":["ruleId","patch"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/delete_rule":{"post":{"operationId":"post_companies_company_commands_delete_rule","summary":"Delete a rule.","tags":["Rules"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"ruleId":{"type":"string","minLength":1}},"required":["ruleId"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/record_statement_balance":{"post":{"operationId":"post_companies_company_commands_record_statement_balance","summary":"Record a statement's ending balance for an account and month.","tags":["Close"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"maxLength":64},"month":{"type":"string"},"statementBalanceCents":{"type":"integer","minimum":-1000000000000000,"maximum":1000000000000000},"statementEnd":{"type":"string"},"source":{"default":"entered","type":"string","enum":["entered","parsed","feed"]}},"required":["accountId","month","statementBalanceCents"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/close_period":{"post":{"operationId":"post_companies_company_commands_close_period","summary":"Close and lock a month once its checklist passes.","tags":["Close"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"month":{"type":"string"},"overrideReason":{"type":"string","minLength":3,"maxLength":500}},"required":["month"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/reopen_period":{"post":{"operationId":"post_companies_company_commands_reopen_period","summary":"Reopen a closed month, with a reason.","tags":["Close"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"month":{"type":"string"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["month","reason"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/link_document":{"post":{"operationId":"post_companies_company_commands_link_document","summary":"Link a document to what it proves.","tags":["Documents"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"documentId":{"type":"string","pattern":"^doc_[\\w]{6,40}$"},"objectType":{"type":"string","enum":["transaction","entry","account_month","account","party"]},"objectId":{"type":"string","minLength":1,"maxLength":200},"accountId":{"type":"string","minLength":1,"maxLength":64},"month":{"type":"string"},"linkKind":{"type":"string","enum":["proves","supports","statement_for"]},"confidence":{"type":"number","minimum":0,"maximum":1},"reason":{"type":"string","maxLength":200}},"required":["documentId","objectType"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/unlink_document":{"post":{"operationId":"post_companies_company_commands_unlink_document","summary":"Remove a document link.","tags":["Documents"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"documentId":{"type":"string","pattern":"^doc_[\\w]{6,40}$"},"objectType":{"type":"string","enum":["transaction","entry","account_month","account","party"]},"objectId":{"type":"string","minLength":1,"maxLength":200}},"required":["documentId","objectType","objectId"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/save_plan":{"post":{"operationId":"post_companies_company_commands_save_plan","summary":"Create or replace a planning scenario. Never posts entries.","tags":["Planning"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"planId":{"type":"string","maxLength":40},"name":{"type":"string","minLength":1,"maxLength":80},"drivers":{"default":[],"maxItems":100,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"kind":{"type":"string","const":"hire"},"title":{"type":"string","minLength":1,"maxLength":80},"department":{"default":"Engineering","type":"string","maxLength":40},"start":{"type":"string"},"end":{"type":["string","null"]},"salaryCents":{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},"loadedFactor":{"default":1.25,"type":"number","minimum":1,"maximum":3}},"required":["id","kind","title","start","salaryCents"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"kind":{"type":"string","const":"cost"},"label":{"type":"string","minLength":1,"maxLength":80},"lineKey":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"monthlyCents":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"from":{"type":"string"},"to":{"type":["string","null"]}},"required":["id","kind","label","monthlyCents","from"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"kind":{"type":"string","const":"revenue"},"label":{"default":"Revenue change","type":"string","maxLength":80},"from":{"type":"string"},"monthlyChangeCents":{"default":0,"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"growthPct":{"default":0,"type":"number","minimum":-50,"maximum":100}},"required":["id","kind","from"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"kind":{"type":"string","const":"one_off"},"label":{"type":"string","minLength":1,"maxLength":80},"month":{"type":"string"},"amountCents":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000}},"required":["id","kind","label","month","amountCents"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"kind":{"type":"string","const":"raise"},"label":{"default":"Raise","type":"string","maxLength":80},"amountCents":{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},"closeMonth":{"type":"string"},"preMoneyCents":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},{"type":"null"}]},"fullyDilutedShares":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":1000000000000},{"type":"null"}]}},"required":["id","kind","amountCents","closeMonth"]}]}}},"required":["name"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/commands/delete_plan":{"post":{"operationId":"post_companies_company_commands_delete_plan","summary":"Delete a planning scenario.","tags":["Planning"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","properties":{"planId":{"type":"string","minLength":1,"maxLength":40}},"required":["planId"]},"reason":{"type":"string","description":"Why. Kept in the audit log and shown to an approver."}}}}}}}},"/v1/companies/{company}/changes/{changeId}":{"get":{"operationId":"get_companies_company_changes_changeId","summary":"One change from the audit log: who, what, before and after.","tags":["Changes"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"changeId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/changes/{changeId}/undo":{"post":{"operationId":"post_companies_company_changes_changeId_undo","summary":"Undo a change. Posted entries are reversed, never deleted.","tags":["Changes"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"changeId","in":"path","required":true,"schema":{"type":"string"}},{"name":"mode","in":"query","required":false,"description":"`preview` returns the full diff and the policy decision and changes nothing. `apply` (default) applies, or returns 202 with a proposal a person approves.","schema":{"type":"string","enum":["preview","apply"],"default":"apply"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required with mode=apply: 8–200 characters. A retry with the same key and body returns the first response with `Idempotent-Replay: true`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview (mode=preview): the diff and the policy decision."},"201":{"description":"Applied: `{status: applied, change_id, summary, result}`."},"202":{"description":"Waiting for a person: `{status: pending_approval, proposal_id, approval_url}`."},"400":{"description":"Invalid request (for example a missing Idempotency-Key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict: a closed month, a used preview, or an Idempotency-Key reused for a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies/{company}/proposals/{proposalId}":{"get":{"operationId":"get_companies_company_proposals_proposalId","summary":"A change waiting for a person's approval, and its decision. No token can approve.","tags":["Changes"],"parameters":[{"name":"company","in":"path","required":true,"description":"Company id, or its exact name.","schema":{"type":"string"}},{"name":"proposalId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK: `{data}`"},"401":{"description":"Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token or your role cannot do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such company, report, command or record (a company the token cannot open is also 404)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 120 reads and 30 writes a minute per token (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"x-webhook-events":{"entry.posted":"A journal entry was posted.","entry.reversed":"A journal entry was reversed (posted entries are never edited).","period.closed":"A month was closed and locked.","period.reopened":"A closed month was reopened, with a reason.","transaction.categorized":"One or more transactions were categorized, or a grouped question was answered.","ping":"A test event sent from Settings › Developers."}}