{"openapi":"3.1.0","info":{"title":"Keel API","version":"1.0.0","description":"Versioned JSON API for Keel. Authenticate with `Authorization: Bearer <token>`. Tokens are scoped to one organization and cannot exceed the creator's role. Send `Idempotency-Key` on financial posts. Send `X-Dry-Run: true` to preview a post without writing. Money values are integer minor units serialized as strings."},"servers":[{"url":"/api/v1"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Money":{"type":"object","required":["currency","minor"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"minor":{"type":"string","description":"Integer minor units as a decimal string, never a float."}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}},"security":[{"bearerAuth":[]}],"paths":{"/me":{"get":{"summary":"Current token principal","responses":{"200":{"description":"Actor"}}}},"/customers":{"get":{"summary":"List customers in the token organization","responses":{"200":{"description":"Customers"}}},"post":{"summary":"Create a customer","responses":{"201":{"description":"Created"}}}},"/customers/{id}":{"get":{"summary":"Get a customer","responses":{"200":{"description":"Customer"},"404":{"description":"Not found"}}}},"/items":{"get":{"summary":"List catalog items","responses":{"200":{"description":"Items"}}}},"/estimates":{"get":{"summary":"List estimates","responses":{"200":{"description":"Estimates"}}},"post":{"summary":"Create an estimate","responses":{"201":{"description":"Created"}}}},"/estimates/{id}":{"get":{"summary":"Get an estimate","responses":{"200":{"description":"Estimate"}}}},"/estimates/{id}/convert":{"post":{"summary":"Convert an estimate into a draft invoice","responses":{"201":{"description":"Invoice id"}}}},"/invoices":{"get":{"summary":"List invoices","responses":{"200":{"description":"Invoices"}}},"post":{"summary":"Create a draft invoice. Does not post the ledger.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Draft invoice"}}}},"/invoices/{id}":{"get":{"summary":"Get an invoice","responses":{"200":{"description":"Invoice"}}}},"/invoices/{id}/issue":{"post":{"summary":"Issue an invoice and post (or stage) the sale journal entry","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Issued or previewed"}}}},"/invoices/{id}/payments":{"post":{"summary":"Record a payment and post (or stage) the cash journal entry","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Payment"}}}},"/invoices/{id}/pdf":{"get":{"summary":"Branded invoice PDF","responses":{"200":{"description":"application/pdf"}}}},"/journal-entries":{"get":{"summary":"List journal entries","responses":{"200":{"description":"Entries"}}}},"/journal-entries/{id}":{"get":{"summary":"Get a journal entry and its lines","responses":{"200":{"description":"Entry"}}}},"/journal-entries/{id}/approve":{"post":{"summary":"Approve a draft journal entry when the organization requires approval","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Posted"}}}},"/customers/{id}/notes":{"post":{"summary":"Add a note, call, visit, or email to the customer timeline","responses":{"201":{"description":"Saved"}}}},"/customers/{id}/contacts":{"post":{"summary":"Add a contact","responses":{"201":{"description":"Contact"}}}},"/customers/{id}/sites":{"post":{"summary":"Add a site","responses":{"201":{"description":"Site"}}}},"/customers/{id}/tasks":{"post":{"summary":"Add a customer task. X-Dry-Run previews it.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Task"}}}},"/customers/{id}/tags":{"post":{"summary":"Attach a tag, creating it when needed","responses":{"201":{"description":"Tag"}}}},"/sites/{id}/equipment":{"post":{"summary":"Add equipment at a site","responses":{"201":{"description":"Equipment"}}}},"/pipeline":{"get":{"summary":"List pipeline stages and opportunities in this organization","responses":{"200":{"description":"Pipeline"}}}},"/opportunities":{"post":{"summary":"Open a lead or opportunity. Does not post the ledger. X-Dry-Run previews it.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Opportunity"}}}},"/opportunities/{id}/move":{"post":{"summary":"Move an opportunity to another stage","responses":{"200":{"description":"Moved"}}}},"/projects":{"get":{"summary":"List owned and shared projects","responses":{"200":{"description":"Projects"}}},"post":{"summary":"Create a project in the token organization","responses":{"201":{"description":"Project"}}}},"/projects/{id}":{"get":{"summary":"Get a project. Partner grants hide customer, ledger, files, and budget lines that were not shared.","responses":{"200":{"description":"Project"}}}},"/projects/{id}/visibility":{"get":{"summary":"Audit what this organization can see on the project. A partner never sees another ledger.","responses":{"200":{"description":"Visibility"}}}},"/projects/{id}/phases":{"post":{"summary":"Add a phase","responses":{"201":{"description":"Phase"}}}},"/projects/{id}/tasks":{"post":{"summary":"Add a project task for this organization. X-Dry-Run previews it.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Task"}}}},"/projects/{id}/assignments":{"post":{"summary":"Assign a member of this organization","responses":{"201":{"description":"Assignment"}}}},"/projects/{id}/budget-lines":{"post":{"summary":"Add an owner budget line. Publishing it does not open the ledger.","responses":{"201":{"description":"Line"}}}},"/projects/{id}/costs":{"post":{"summary":"Record an org-private job cost. Does not post the ledger. X-Dry-Run previews it.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Cost"}}}},"/projects/{id}/documents":{"post":{"summary":"Add document metadata. Private files stay in the authoring organization.","responses":{"201":{"description":"Document"}}}},"/projects/{id}/updates":{"post":{"summary":"Add a project update","responses":{"201":{"description":"Update"}}}},"/projects/{id}/shares":{"post":{"summary":"Invite a partner organization by slug, or replace that partner's grant","responses":{"201":{"description":"Share"}}}},"/projects/{id}/agreements":{"post":{"summary":"Create an active revenue and cost split. This is not a ledger entry.","responses":{"201":{"description":"Agreement"}}}},"/projects/{id}/rollups":{"post":{"summary":"Publish an owner aggregate. Partners see it only when budget lines are shared. X-Dry-Run previews it.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Rollup"}}}},"/imports/adapters":{"get":{"summary":"List importers and which OAuth settings are present","responses":{"200":{"description":"Adapters"}}}},"/imports/probe":{"post":{"summary":"Check whether an importer has the credentials the host passed in. Does not call the provider.","responses":{"200":{"description":"Probe"}}}},"/imports/inspect":{"post":{"summary":"Read spreadsheet headers and suggest a column map","responses":{"200":{"description":"Headers and suggested map"}}}},"/imports/preview":{"post":{"summary":"Dry-run an import. Returns a diff and account map. Writes nothing.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Preview diff"}}}},"/imports/stage":{"post":{"summary":"Stage an import for review. X-Dry-Run: true returns the preview and writes nothing. Re-sending the same file returns the existing batch.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Batch"}}}},"/imports/customers/csv":{"post":{"summary":"Stage a CSV customer import for review","responses":{"201":{"description":"Batch"}}}},"/imports/{id}":{"get":{"summary":"Review a staged import","responses":{"200":{"description":"Batch"}}}},"/imports/{id}/errors":{"get":{"summary":"Download a CSV error report for a staged import","responses":{"200":{"description":"text/csv"}}}},"/imports/{id}/commit":{"post":{"summary":"Commit accepted staged rows. Posts journals through the ledger. X-Dry-Run previews the diff. Idempotency-Key replays a financial commit.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Created and linked counts"}}}},"/imports/{id}/rollback":{"post":{"summary":"Roll back a committed import batch. Voids journals it posted and removes records it created.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Rolled back"}}}},"/vendors":{"get":{"summary":"List vendors","responses":{"200":{"description":"Vendors"}}},"post":{"summary":"Create a vendor","responses":{"201":{"description":"Created"}}}},"/bills":{"get":{"summary":"List bills","responses":{"200":{"description":"Bills"}}},"post":{"summary":"Create a draft bill","responses":{"201":{"description":"Created"}}}},"/bills/{id}":{"get":{"summary":"Get a bill","responses":{"200":{"description":"Bill"}}}},"/bills/{id}/issue":{"post":{"summary":"Record a bill and post accounts payable","responses":{"200":{"description":"Issued or pending approval"}}}},"/bills/{id}/payments":{"post":{"summary":"Pay a bill from a bank account","responses":{"201":{"description":"Payment"}}}},"/expenses":{"get":{"summary":"List expenses","responses":{"200":{"description":"Expenses"}}},"post":{"summary":"Record an expense","responses":{"201":{"description":"Created"}}}},"/receipts/{id}":{"get":{"summary":"Download an expense receipt","responses":{"200":{"description":"File bytes"}}}},"/bank-accounts":{"get":{"summary":"List bank accounts","responses":{"200":{"description":"Accounts"}}},"post":{"summary":"Link an asset account as a bank account","responses":{"201":{"description":"Created"}}}},"/bank-accounts/{id}/transactions":{"get":{"summary":"Bank register","responses":{"200":{"description":"Transactions"}}}},"/bank-accounts/{id}/import":{"post":{"summary":"Import CSV, OFX, or QFX transactions","responses":{"200":{"description":"Created and skipped counts"}}}},"/bank-transactions/{id}/categorize":{"post":{"summary":"Assign a category account","responses":{"200":{"description":"Updated"}}}},"/bank-transactions/{id}/post":{"post":{"summary":"Post a categorized bank line to the ledger","responses":{"200":{"description":"Journal entry"}}}},"/transfers":{"post":{"summary":"Transfer between two bank accounts","responses":{"201":{"description":"Transfer"}}}},"/categorization-rules":{"get":{"summary":"List categorization rules","responses":{"200":{"description":"Rules"}}},"post":{"summary":"Create a categorization rule","responses":{"201":{"description":"Rule"}}}},"/bank-accounts/{id}/reconciliations":{"post":{"summary":"Start a reconciliation","responses":{"201":{"description":"Reconciliation"}}}},"/reconciliations/{id}":{"get":{"summary":"Reconciliation report","responses":{"200":{"description":"Report"}}}},"/reconciliations/{id}/complete":{"post":{"summary":"Lock a reconciliation when the cleared total matches the statement","responses":{"200":{"description":"Completed"}}}},"/reports/trial-balance":{"get":{"summary":"Trial balance","responses":{"200":{"description":"Debits and credits"}}}},"/reports/general-ledger":{"get":{"summary":"General ledger detail","responses":{"200":{"description":"Lines"}}}},"/reports/profit-and-loss":{"get":{"summary":"Profit and loss, accrual or cash","responses":{"200":{"description":"P&L"}}}},"/reports/balance-sheet":{"get":{"summary":"Balance sheet, accrual or cash","responses":{"200":{"description":"Balance sheet"}}}},"/accounts":{"get":{"summary":"Chart of accounts","responses":{"200":{"description":"Accounts"}}}},"/tax/estimate":{"get":{"summary":"Live income-tax set-aside from posted profit plus categorized, not-yet-posted bank lines. Preparation aid for owners and admins.","responses":{"200":{"description":"Estimate"}}}},"/tax/planning":{"put":{"summary":"Save the organization's planning rates for the set-aside. Requires tax:write.","responses":{"200":{"description":"Saved"}}}},"/tax/mappings":{"get":{"summary":"Tax-line mappings for Schedule C, Form 1120-S, or Form 1065","responses":{"200":{"description":"Mappings"}}},"put":{"summary":"Set one account's tax line. Requires tax:write. The CPA role cannot call this.","responses":{"200":{"description":"Saved"}}}},"/tax/statements":{"get":{"summary":"Tax-ready P&L and balance sheet by mapped line. Preparation aid.","responses":{"200":{"description":"Statements"}}}},"/tax/close":{"get":{"summary":"Year-end close checklist and readiness score","responses":{"200":{"description":"Checklist"}}}},"/tax/1099":{"get":{"summary":"1099-NEC/MISC vendor totals with masked TINs","responses":{"200":{"description":"Vendors"}}}},"/tax/1099.csv":{"get":{"summary":"IRS-friendly 1099 CSV. masked=1 keeps the TIN masked.","responses":{"200":{"description":"CSV"}}}},"/tax/sales-tax":{"get":{"summary":"Sales and use tax liability by jurisdiction","responses":{"200":{"description":"Liability"}}}},"/tax/mileage":{"get":{"summary":"Mileage worksheet","responses":{"200":{"description":"Worksheet"}}}},"/tax/home-office":{"get":{"summary":"Home-office worksheet","responses":{"200":{"description":"Worksheet"}}}},"/tax/assets":{"get":{"summary":"Fixed assets and depreciation schedules","responses":{"200":{"description":"Assets"}}}},"/tax/package":{"get":{"summary":"Accountant package zip: PDF, CSV, and tax-software JSON. Preparation aid.","responses":{"200":{"description":"Zip"}}}},"/templates":{"get":{"summary":"List document templates","responses":{"200":{"description":"Templates"}}},"post":{"summary":"Create a document template","responses":{"201":{"description":"Template"}}}},"/templates/{id}":{"get":{"summary":"Get a document template","responses":{"200":{"description":"Template"}}},"post":{"summary":"Update a document template","responses":{"200":{"description":"Template"}}}},"/numbering":{"get":{"summary":"List per-organization document numbers","responses":{"200":{"description":"Sequences"}}}},"/numbering/{docType}":{"post":{"summary":"Update a document number sequence","responses":{"200":{"description":"Sample number"}}}},"/customers/{id}/document-defaults":{"get":{"summary":"List per-customer document defaults","responses":{"200":{"description":"Defaults"}}},"post":{"summary":"Save per-customer terms, notes, template, and custom fields","responses":{"200":{"description":"Saved"}}}},"/proposals":{"get":{"summary":"List proposals","responses":{"200":{"description":"Proposals"}}},"post":{"summary":"Create a draft proposal. Does not post the ledger.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Draft proposal"}}}},"/proposals/{id}":{"get":{"summary":"Get a proposal, sections, options, and attachments","responses":{"200":{"description":"Proposal"}}}},"/proposals/{id}/pdf":{"get":{"summary":"Branded proposal PDF","responses":{"200":{"description":"application/pdf"}}}},"/proposals/{id}/email":{"get":{"summary":"Email subject and body for a proposal PDF","responses":{"200":{"description":"Email copy"}}}},"/proposals/{id}/options":{"post":{"summary":"Choose proposal options before acceptance","responses":{"200":{"description":"Repriced proposal"}}}},"/proposals/{id}/convert":{"post":{"summary":"Convert a proposal into a draft estimate","responses":{"201":{"description":"Estimate id"}}}},"/proposals/{id}/acceptance-link":{"post":{"summary":"Create a one-time customer acceptance link","responses":{"201":{"description":"Token shown once"}}}},"/estimates/{id}/acceptance-link":{"post":{"summary":"Create a one-time estimate acceptance link","responses":{"201":{"description":"Token shown once"}}}},"/estimates/{id}/email":{"get":{"summary":"Email subject and body for an estimate PDF","responses":{"200":{"description":"Email copy"}}}},"/estimates/{id}/progress":{"post":{"summary":"Create a draft deposit or progress invoice from an estimate. Does not post.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Draft invoice"}}}},"/invoices/{id}/email":{"get":{"summary":"Email subject and body for an invoice PDF","responses":{"200":{"description":"Email copy"}}}},"/credit-memos":{"get":{"summary":"List credit memos","responses":{"200":{"description":"Credit memos"}}},"post":{"summary":"Create a draft credit memo. Does not post the ledger.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Draft credit memo"}}}},"/credit-memos/{id}":{"get":{"summary":"Get a credit memo","responses":{"200":{"description":"Credit memo"}}}},"/credit-memos/{id}/pdf":{"get":{"summary":"Branded credit memo PDF","responses":{"200":{"description":"application/pdf"}}}},"/credit-memos/{id}/email":{"get":{"summary":"Email subject and body for a credit memo PDF","responses":{"200":{"description":"Email copy"}}}},"/credit-memos/{id}/issue":{"post":{"summary":"Issue a credit memo and post (or stage) the reversing journal entry","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Issued or previewed"}}}},"/credit-memos/{id}/applications":{"post":{"summary":"Apply an open credit memo to an invoice. Does not post a second journal entry.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Application"}}}},"/recurring-invoices":{"get":{"summary":"List recurring invoice schedules","responses":{"200":{"description":"Schedules"}}},"post":{"summary":"Create a recurring invoice schedule. Does not issue an invoice.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Schedule"}}}},"/recurring-invoices/{id}":{"get":{"summary":"Get a recurring invoice schedule","responses":{"200":{"description":"Schedule"}}}},"/recurring-invoices/{id}/pause":{"post":{"summary":"Pause or resume a recurring invoice schedule","responses":{"200":{"description":"Status"}}}},"/recurring-invoices/{id}/generate":{"post":{"summary":"Generate the next draft invoice when the schedule is due. Does not issue it.","parameters":[{"name":"X-Dry-Run","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Draft invoice"}}}},"/audit":{"get":{"summary":"Audit log with the user and API token that acted","responses":{"200":{"description":"Entries"}}}},"/events":{"get":{"summary":"Automation events for this organization","responses":{"200":{"description":"Events"}}}},"/webhooks":{"get":{"summary":"List webhook endpoints without secrets","responses":{"200":{"description":"Endpoints"}}},"post":{"summary":"Create a webhook. The signing secret is returned once.","responses":{"201":{"description":"Endpoint"}}}},"/webhooks/deliveries":{"get":{"summary":"Signed webhook deliveries. Outbound HTTP stays off unless the host is allowlisted.","responses":{"200":{"description":"Deliveries"}}}},"/assistant":{"post":{"summary":"Ask the configured assistant. Uses the offline assistant when no provider URL is set.","responses":{"200":{"description":"Reply"}}}},"/public/acceptances/{token}":{"get":{"summary":"Preview a document for online acceptance. No API token.","responses":{"200":{"description":"Preview"}}},"post":{"summary":"Record a typed or drawn signature and consent. No API token.","responses":{"200":{"description":"Accepted"}}}}}}