{"components":{"securitySchemes":{"apiKey":{"description":"`Authorization: Bearer firmowid_…` (personal key) or `firmowid_org_…` (company key).","scheme":"bearer","type":"http"}}},"info":{"description":"The operations of the Firmowid MCP server, called with an API key from the \"API keys\" settings page. A key works in its company with its role, so it may call only the operations that role allows.","title":"Firmowid API","version":"1"},"openapi":"3.1.0","paths":{"/restore_transaction_for_matching":{"post":{"description":"Return a skipped transaction to pending so it can be connected to an invoice or a salary. A pending transaction stays unchanged; a matched one returns an error naming the conflict. Requires an accountant or administrator.","operationId":"restore_transaction_for_matching","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"}},"required":["id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Restore skipped transaction","tags":["Finances"]}},"/connect_cost_invoice_transactions":{"post":{"description":"Mark a cost invoice as paid by connecting bank transactions to it, only after the user approves the specific match. Any combination is allowed: several transactions may pay one invoice (installments) and one transaction may pay several invoices (call once per invoice). A transaction assigned to a salary cannot be connected. Existing connections are kept. Requires an accountant or administrator.","operationId":"connect_cost_invoice_transactions","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"transaction_ids":{"items":{"format":"uuid","type":"string"},"type":"array"}},"required":["transaction_ids"],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Connect cost invoice payments","tags":["Invoicing"]}},"/update_transaction_internal_note":{"post":{"description":"Replace the bank transaction's internal note only when the user asks. Pass null to clear it. Maximum 10000 characters. Does not change bank data, the transfer title or invoice/salary matches. Requires an accountant or administrator.","operationId":"update_transaction_internal_note","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"internal_note":{"maxLength":10000,"type":"string"}},"required":[],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Update bank transaction internal note","tags":["Finances"]}},"/connect_transaction_salary":{"post":{"description":"Settle one employee's monthly salary with a pending outgoing transfer, only after the user approves the specific match. Pass the transaction id, salary_user_id and salary_month (first day of the month). Repeating an existing assignment succeeds without changes. Restore a skipped transfer first. A salary month can be paid by one transfer only; conflicts with another transfer, salary or invoice return an error naming them and change nothing. Requires an administrator.","operationId":"connect_transaction_salary","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"salary_month":{"description":"First day of the salary month this transfer pays.","format":"date","type":"string"},"salary_user_id":{"format":"uuid","type":"string"}},"required":["salary_user_id","salary_month"],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Assign transfer to salary","tags":["Finances"]}},"/get_next_sales_invoice_number":{"post":{"description":"Return the next free sales invoice number for an issue date. format is monthly (NN/MM/YYYY) or yearly (N/YYYY); series is an optional suffix or prefix such as A. Match the format and series of the organization's most recent invoices. Saves nothing.","operationId":"get_next_sales_invoice_number","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"date":{"format":"date","type":"string"},"format":{"enum":["monthly","yearly"],"type":"string"},"omit_invoice_id":{"format":"uuid","type":"string"},"series":{"type":"string"}},"required":["date","format"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Get next invoice number","tags":["Invoicing"]}},"/list_projects":{"post":{"description":"List all projects of the authenticated user","operationId":"list_projects","requestBody":{"content":{"application/json":{"schema":{"properties":{"filter":{"description":"A filter to apply to the query: either a condition {\"field\": ..., \"operator\": ..., \"value\": ...} or an {\"and\": [...]} / {\"or\": [...]} group of conditions and groups (nestable). Operators: contains, eq, greater_than, greater_than_or_equal, ilike, in, is_distinct_from, is_nil, is_not_distinct_from, less_than, less_than_or_equal, like, not_eq, string_ends_with, string_starts_with. For 'is_nil' the value is true or false; for 'in' the value is an array. Fields: id, name, archived_at, suspended_by_plan_at, inserted_at, updated_at.","type":"object"},"input":{"properties":{"status":{"description":"Filter by status: active or archived. Omit to list all projects.","enum":["active","archived"],"type":"string"}},"required":[],"type":"object"},"limit":{"default":25,"description":"The maximum number of records to return","type":"integer"},"offset":{"default":0,"description":"The number of records to skip","type":"integer"},"result_type":{"default":"run_query","description":"The type of result to return","oneOf":[{"description":"Run the query returning the matching records (up to `limit`), or return a count of results, or check if any results exist","enum":["run_query","count","exists"],"type":"string"},{"properties":{"aggregate":{"description":"The aggregate function to use","enum":["max","min","sum","avg","count"],"type":"string"},"field":{"description":"The field to aggregate","enum":["id","name","archived_at","suspended_by_plan_at","inserted_at","updated_at"],"type":"string"}},"required":["aggregate","field"],"type":"object"}]},"sort":{"items":{"properties":{"direction":{"description":"The direction to sort by","enum":["asc","desc"],"type":"string"},"field":{"description":"The field to sort by","enum":["id","name","archived_at","suspended_by_plan_at","inserted_at","updated_at"],"type":"string"}},"required":["field","direction"],"type":"object"},"type":"array"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List projects","tags":["Timetracker"]}},"/create_sales_invoice_draft":{"post":{"description":"Save a complete but unnumbered invoice only when the user explicitly asks to issue it later. A draft requires the same data as issuance except the number, as listed for preview_sales_invoice; keep partial data in the chat instead. Prefer calling preview_sales_invoice directly. Saving is available without KSeF and neither issues nor submits.","operationId":"create_sales_invoice_draft","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"vat_exemption_type":{"enum":["art_113","art_43","art_82_ust_3","directive_2006_112","other"],"type":"string"},"buyer_full_name":{"type":"string"},"buyer_id":{"type":"string"},"buyer_surname":{"type":"string"},"skip_invoicing":{"type":"boolean"},"counterparty_id":{"format":"uuid","type":"string"},"buyer_is_different_mail_address":{"type":"boolean"},"is_reverse_charge":{"type":"boolean"},"input":{"properties":{"vat_exemption_type":{"enum":["art_113","art_43","art_82_ust_3","directive_2006_112","other"],"type":"string"},"buyer_full_name":{"type":"string"},"buyer_id":{"type":"string"},"buyer_surname":{"type":"string"},"skip_invoicing":{"type":"boolean"},"counterparty_id":{"format":"uuid","type":"string"},"buyer_is_different_mail_address":{"type":"boolean"},"is_reverse_charge":{"type":"boolean"},"issue_date":{"format":"date","type":"string"},"buyer_pesel":{"type":"string"},"should_send_emails":{"type":"boolean"},"sales_invoice_items":{"items":{"properties":{"discount":{"type":"string"},"gtu":{"type":"string"},"index":{"type":"integer"},"name":{"type":"string"},"quantity":{"type":"string"},"unit":{"type":"string"},"unit_price":{"type":"string"},"vat_rate":{"type":"string"}},"required":["name","quantity","unit","unit_price"],"type":"object"},"type":"array"},"buyer_given_name":{"type":"string"},"buyer_display_name":{"type":"string"},"sale_date":{"format":"date","type":"string"},"buyer_country":{"type":"string"},"vat_exemption_basis":{"type":"string"},"buyer_phone":{"type":"string"},"invoice_note":{"type":"string"},"buyer_mail_country":{"type":"string"},"buyer_type":{"enum":["company","individual"],"type":"string"},"correction_reason":{"maxLength":256,"type":"string"},"invoice_number":{"type":"string"},"paid_on":{"description":"The day a VAT invoice was paid in full, no later than its issue date. It is then issued as paid, with no due date. Leave null for an invoice the buyer still has to pay, and for an advance invoice.","format":"date","type":"string"},"buyer_mail_address":{"type":"string"},"internal_note":{"maxLength":10000,"type":"string"},"is_cash_account":{"description":"Cash accounting of VAT (metoda kasowa). Leave null to use the organization's usual choice; set it only when the user asks.","type":"boolean"},"ksef_invoice_kind":{"description":"vat (default) for a regular invoice; advance for an advance invoice (KSeF ZAL) documenting a payment received in full before the sale, with sale_date as the payment date.","enum":["vat","advance"],"type":"string"},"currency":{"type":"string"},"invoice_type":{"enum":["poland","foreign"],"type":"string"},"buyer_description":{"type":"string"},"payment_method":{"enum":["cash","card","voucher","check","credit","transfer","mobile"],"type":"string"},"buyer_email":{"type":"string"},"buyer_address":{"type":"string"},"seller_account_number":{"type":"string"},"due_date":{"format":"date","type":"string"},"settlement_entries":{"description":"Charges and deductions settled on the invoice (FA(3) Rozliczenie), such as a deposit charged or an advance already paid. They change only the amount due, never the invoice's totals. Leave null to keep a draft's saved entries.","items":{"description":"Charges and deductions settled on the invoice (FA(3) Rozliczenie), such as a deposit charged or an advance already paid. They change only the amount due, never the invoice's totals. Leave null to keep a draft's saved entries.","properties":{"amount":{"type":"string"},"kind":{"description":"charge adds to the invoice's gross total, deduction (e.g. an advance already paid) subtracts from it.","enum":["charge","deduction"],"type":"string"},"reason":{"maxLength":256,"type":"string"}},"required":["kind","amount","reason"],"type":"object"},"type":"array"}},"required":[],"type":"object"},"buyer_pesel":{"type":"string"},"should_send_emails":{"type":"boolean"},"sales_invoice_items":{"items":{"type":"object"},"type":"array"},"buyer_given_name":{"type":"string"},"buyer_display_name":{"type":"string"},"sale_date":{"format":"date","type":"string"},"buyer_country":{"type":"string"},"vat_exemption_basis":{"maxLength":256,"type":"string"},"buyer_phone":{"type":"string"},"invoice_note":{"type":"string"},"buyer_mail_country":{"type":"string"},"buyer_type":{"enum":["individual","company"],"type":"string"},"paid_on":{"description":"The day a VAT invoice was paid in full, by its issue date. An advance invoice is paid on its sale date instead.","format":"date","type":"string"},"buyer_mail_address":{"type":"string"},"internal_note":{"type":"string"},"is_cash_account":{"type":"boolean"},"ksef_invoice_kind":{"enum":["vat","kor","advance"],"type":"string"},"currency":{"type":"string"},"invoice_type":{"enum":["poland","foreign"],"type":"string"},"buyer_description":{"type":"string"},"payment_method":{"enum":["cash","card","voucher","check","credit","transfer","mobile"],"type":"string"},"buyer_email":{"type":"string"},"buyer_address":{"type":"string"},"seller_account_number":{"type":"string"},"due_date":{"format":"date","type":"string"},"settlement_entries":{"items":{"type":"object"},"type":"array"}},"required":[],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Save invoice draft","tags":["Invoicing"]}},"/issue_sales_invoice_from_api":{"post":{"description":"Issue an invoice for another system's order, numbered in the organization's sequence. An\norder that already has an invoice gets that invoice back, in whatever state, so a retried\nrequest never issues a second one.","operationId":"issue_sales_invoice_from_api","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"buyer_address":{"type":"string"},"buyer_country":{"description":"ISO 3166-1 alpha-2 code, in either case; null means PL.","type":"string"},"buyer_email":{"type":"string"},"buyer_full_name":{"description":"The company buyer's name.","type":"string"},"buyer_given_name":{"description":"The individual buyer's given name.","type":"string"},"buyer_id":{"description":"The company buyer's tax ID, such as a NIP.","type":"string"},"buyer_phone":{"type":"string"},"buyer_surname":{"description":"The individual buyer's surname.","type":"string"},"buyer_type":{"enum":["company","individual"],"type":"string"},"currency":{"type":"string"},"due_date":{"description":"The payment due date of an invoice still to be paid.","format":"date","type":"string"},"external_id":{"description":"The order's ID in the calling system; one invoice per ID.","maxLength":64,"type":"string"},"invoice_note":{"type":"string"},"items":{"description":"The invoice lines; `unit_price` is net, or gross on a VAT-exempt line (`vat_rate: \"zw\"`).","items":{"description":"The invoice lines; `unit_price` is net, or gross on a VAT-exempt line (`vat_rate: \"zw\"`).","properties":{"discount":{"type":"string"},"gtu":{"type":"string"},"index":{"type":"integer"},"name":{"type":"string"},"quantity":{"type":"string"},"unit":{"type":"string"},"unit_price":{"type":"string"},"vat_rate":{"type":"string"}},"required":["name","quantity","unit","unit_price"],"type":"object"},"type":"array"},"numbering_format":{"description":"`monthly` (also for null) numbers the invoice NN/MM/YYYY[/SERIES], `yearly` [SERIES/]N/YYYY.","enum":["monthly","yearly"],"type":"string"},"numbering_series":{"type":"string"},"paid_on":{"description":"The day the buyer paid in full, by today. The invoice is then issued as paid, with no due date.","format":"date","type":"string"},"payment_method":{"enum":["cash","card","voucher","check","credit","transfer","mobile"],"type":"string"},"sale_date":{"description":"Defaults to the issue date, today.","format":"date","type":"string"},"seller_account_number":{"description":"The account to pay a transfer to; defaults to the organization's account for the currency.","type":"string"},"should_send_emails":{"description":"E-mail the invoice once KSeF accepts it: to the address of the counterparty matched by `buyer_id`, or else to `buyer_email`.","type":"boolean"}},"required":["external_id","buyer_type","buyer_address","items"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Issue sales invoice for an order","tags":["Invoicing"]}},"/link_sales_invoice_counterparty":{"post":{"description":"Attach an issued sales invoice that has no counterparty yet to an existing counterparty, only after the user approves the specific pair. Use it when the buyer on the invoice is the same company or person as the counterparty but the tax ID or name differ (a brand, a typo, a renamed company). The buyer data printed on the invoice stays unchanged. An invoice that already has a counterparty is not changed. Requires an accountant or administrator.","operationId":"link_sales_invoice_counterparty","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"counterparty_id":{"format":"uuid","type":"string"}},"required":["counterparty_id"],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Link a sales invoice to a counterparty","tags":["Invoicing"]}},"/list_sales_invoices":{"post":{"description":"List sales invoices as data for questions, summaries, analysis and tables in the conversation. First check get_ksef_connection_status and propose connection if needed; stored invoices remain readable without it and may be out of date. Results belong to the authenticated organization. An absent invoice_number identifies a draft. amount is the gross total stated on the invoice and effective_amount the same after corrections; with merge_corrections sum effective_amount instead of amount. effective_amount_due is what the buyer pays after corrections: the gross total plus the invoice's charges and minus its deductions (FA(3) Rozliczenie). Use after/before keyset cursors with the same filters to navigate pages.","operationId":"list_sales_invoices","requestBody":{"content":{"application/json":{"schema":{"properties":{"after":{"description":"Fetch the page after this keyset cursor. Pass the `end_keyset` from a previous page to fetch the following page.","type":"string"},"before":{"description":"Fetch the page before this keyset cursor. Pass the `start_keyset` from a previous page to fetch the preceding page.","type":"string"},"input":{"properties":{"amount_from":{"description":"Minimum gross amount, inclusive, compared as an absolute value.","type":"string"},"amount_to":{"description":"Maximum gross amount, inclusive, compared as an absolute value.","type":"string"},"buyer_type":{"enum":["company","individual"],"type":"string"},"currency":{"description":"ISO currency code, e.g. PLN. Never add up amounts in different currencies.","type":"string"},"date_field":{"description":"Date compared with date_from and date_to; any matches either issue_date or sale_date.","enum":["issue_date","sale_date","due_date","any"],"type":"string"},"date_from":{"description":"Inclusive start of the date_field range (YYYY-MM-DD).","format":"date","type":"string"},"date_to":{"description":"Inclusive end of the date_field range (YYYY-MM-DD).","format":"date","type":"string"},"ids":{"description":"Return only invoices with these IDs.","items":{"description":"Return only invoices with these IDs.","format":"uuid","type":"string"},"type":"array"},"inserted_from":{"description":"Inclusive lower bound of when the invoice was recorded in Firmowid, not its document date.","format":"date-time","type":"string"},"inserted_to":{"description":"Exclusive upper bound of when the invoice was recorded in Firmowid, not its document date.","format":"date-time","type":"string"},"is_cash":{"description":"When true, return only invoices paid in cash.","type":"boolean"},"is_reverse_charge":{"description":"Filter by reverse-charge VAT.","type":"boolean"},"kind":{"description":"Document kind: vat for a regular invoice, kor for a correction, advance for an advance invoice (KSeF ZAL).","enum":["vat","kor","advance"],"type":"string"},"limit":{"description":"Page size, at most 100.","minimum":1,"type":"integer"},"listing_sort":{"description":"Order by issue date, newest or oldest first.","enum":["newest","oldest"],"type":"string"},"merge_corrections":{"description":"Hide corrections of an existing invoice and compare amounts after corrections. Use for totals and rankings.","type":"boolean"},"overdue_on":{"description":"Only unpaid transfer invoices overdue on this date, using corrected dates and amounts.","format":"date","type":"string"},"query":{"description":"Full-text search over buyer names, tax ID, email and description, invoice number and item names.","maxLength":500,"type":"string"},"reconciliation":{"description":"Payment matching with bank transactions: pending has no matched payment yet, matched is linked to a bank transaction or to the expected payment of an invoice paid on issue, skipped is excluded from matching.","enum":["pending","matched","skipped"],"type":"string"},"submission":{"description":"draft returns unnumbered drafts; confirmed returns issued invoices with a number, whatever their KSeF status.","enum":["draft","confirmed"],"type":"string"}},"required":[],"type":"object"},"limit":{"default":25,"description":"The maximum number of records to return in one page","type":"integer"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List sales invoices","tags":["Invoicing"]}},"/list_leave_requests":{"post":{"description":"Paginated leave and absence requests for the authenticated user, newest first. Default limit is 25 - results are truncated. Paginate with limit+offset (e.g. offset 0, 25, 50) or increase limit. If returned count equals your limit, fetch next page. Supports start_date (requests ending on/after) and end_date (starting on/before) filters. Use result_type count to get total matching requests.\n\nPersonal keys only: it acts as the key's person.","operationId":"list_leave_requests","requestBody":{"content":{"application/json":{"schema":{"properties":{"filter":{"description":"A filter to apply to the query: either a condition {\"field\": ..., \"operator\": ..., \"value\": ...} or an {\"and\": [...]} / {\"or\": [...]} group of conditions and groups (nestable). Operators: contains, eq, greater_than, greater_than_or_equal, ilike, in, is_distinct_from, is_nil, is_not_distinct_from, less_than, less_than_or_equal, like, not_eq, string_ends_with, string_starts_with. For 'is_nil' the value is true or false; for 'in' the value is an array. Fields: id, starts_on, ends_on, note, category, reason, status, inserted_at, updated_at, days_count.","type":"object"},"input":{"properties":{"end_date":{"description":"Only return requests starting on or before this date","format":"date","type":"string"},"start_date":{"description":"Only return requests ending on or after this date","format":"date","type":"string"}},"required":[],"type":"object"},"limit":{"default":25,"description":"The maximum number of records to return in one page","type":"integer"},"offset":{"default":0,"description":"The number of records to skip. Pass the `next_offset` from a previous page to fetch the following page.","type":"integer"},"result_type":{"default":"run_query","description":"The type of result to return","oneOf":[{"description":"Run the query returning a page of results (check `has_more` to see whether further pages exist), or return a count of results, or check if any results exist","enum":["run_query","count","exists"],"type":"string"},{"properties":{"aggregate":{"description":"The aggregate function to use","enum":["max","min","sum","avg","count"],"type":"string"},"field":{"description":"The field to aggregate","enum":["id","starts_on","ends_on","note","category","reason","status","inserted_at","updated_at","days_count"],"type":"string"}},"required":["aggregate","field"],"type":"object"}]},"sort":{"items":{"properties":{"direction":{"description":"The direction to sort by","enum":["asc","desc"],"type":"string"},"field":{"description":"The field to sort by","enum":["id","starts_on","ends_on","note","category","reason","status","inserted_at","updated_at","days_count"],"type":"string"}},"required":["field","direction"],"type":"object"},"type":"array"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List leave requests","tags":["Timetracker"]}},"/list_sessions":{"post":{"description":"Paginated work sessions for the authenticated user, newest first. Default limit is 25 - results are truncated. For whole-month or multi-month analysis paginate with limit+offset (e.g. offset 0, 25, 50) or increase limit. If the returned count equals your limit, fetch the next page with offset+limit. Optionally filter with after_date (UTC, sessions starting on or after that date). Use result_type count to get the total number of matching sessions.\n\nPersonal keys only: it acts as the key's person.","operationId":"list_sessions","requestBody":{"content":{"application/json":{"schema":{"properties":{"after":{"description":"Fetch the page after this keyset cursor. Pass the `end_keyset` from a previous page to fetch the following page.","type":"string"},"before":{"description":"Fetch the page before this keyset cursor. Pass the `start_keyset` from a previous page to fetch the preceding page.","type":"string"},"filter":{"description":"A filter to apply to the query: either a condition {\"field\": ..., \"operator\": ..., \"value\": ...} or an {\"and\": [...]} / {\"or\": [...]} group of conditions and groups (nestable). Operators: contains, eq, greater_than, greater_than_or_equal, ilike, in, is_distinct_from, is_nil, is_not_distinct_from, less_than, less_than_or_equal, like, not_eq, string_ends_with, string_starts_with. For 'is_nil' the value is true or false; for 'in' the value is an array. Fields: id, title, start_datetime, end_datetime, is_remote, inserted_at, updated_at, project_id, duration, lockdown.","type":"object"},"input":{"properties":{"after_date":{"description":"Only return sessions starting on or after this date (UTC)","format":"date","type":"string"}},"required":[],"type":"object"},"limit":{"default":25,"description":"The maximum number of records to return in one page","type":"integer"},"offset":{"default":0,"description":"The number of records to skip. Pages use keyset cursors by default; pass a positive offset to page by position instead, then pass the `next_offset` from that page for the following one.","type":"integer"},"result_type":{"default":"run_query","description":"The type of result to return","oneOf":[{"description":"Run the query returning a page of results (check `has_more` to see whether further pages exist), or return a count of results, or check if any results exist","enum":["run_query","count","exists"],"type":"string"},{"properties":{"aggregate":{"description":"The aggregate function to use","enum":["max","min","sum","avg","count"],"type":"string"},"field":{"description":"The field to aggregate","enum":["id","title","start_datetime","end_datetime","is_remote","inserted_at","updated_at","project_id","duration","lockdown"],"type":"string"}},"required":["aggregate","field"],"type":"object"}]},"sort":{"items":{"properties":{"direction":{"description":"The direction to sort by","enum":["asc","desc"],"type":"string"},"field":{"description":"The field to sort by","enum":["id","title","start_datetime","end_datetime","is_remote","inserted_at","updated_at","project_id","duration","lockdown"],"type":"string"}},"required":["field","direction"],"type":"object"},"type":"array"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List work sessions","tags":["Timetracker"]}},"/update_sales_invoice_internal_note":{"post":{"description":"Replace the sales invoice's internal note only when the user asks. Pass null to clear it. Maximum 10000 characters. Available for drafts and KSeF-submitted invoices; does not change the issued document or send the note to KSeF or the buyer. Requires an accountant or administrator.","operationId":"update_sales_invoice_internal_note","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"internal_note":{"type":"string"}},"required":[],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Update sales invoice internal note","tags":["Invoicing"]}},"/update_profile":{"post":{"description":"Update the authenticated user's own profile: name, phone, Slack URL, bank account number, birthday and its visibility, residence and correspondence addresses. Pass only the fields to change.\n\nPersonal keys only: it acts as the key's person.","operationId":"update_profile","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"bank_account_number":{"type":"string"},"birthday":{"format":"date","type":"string"},"birthday_visibility":{"enum":["not_shared","day_with_month","full_date"],"type":"string"},"correspondence_address":{"type":"string"},"is_same_correspondence_address":{"type":"boolean"},"name":{"type":"string"},"phone":{"type":"string"},"residence_address":{"type":"string"},"slack_url":{"type":"string"}},"required":[],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Update profile","tags":["Core"]}},"/forecast_taxes":{"post":{"description":"Forecast a year's tax and ZUS payments from the saved tax settings and the invoices and bank transactions Firmowid has. An estimate to plan cash, not a tax return: say so. One item per period: kind, period, period_start, period_end, amount in PLN, due_date, description, member_id and details, the figures the amount comes from; use details to explain an amount. The period that is still running includes the typical rest of the period, and the periods ahead the typical month, both taken from the previous three months, so their amounts are for the whole period and not only for the documents dated so far; the forecast looks ahead to the end of the second month after today's, later periods count the documents only; details projected_output_vat and projected_input_vat (vat) and projected_revenue and projected_costs (cit, pit) say how much of the figure is that expectation (zero for a period without any). vat: for a VAT payer with a saved vat_period; details output_vat, input_vat, carried_over, refunded. carried_over is the surplus input VAT from earlier periods, deducted first, already lowered by refunded: the VAT refunds from a tax office (incoming transfers from Urząd Skarbowy titled with VAT) booked in the period. A period with more input than output VAT pays 0 and carries the surplus forward. cit: advances of a limited company with a saved CIT rate and advance form (none for simplified advances); cumulative from 1 January: details revenue, costs, income, tax (on the whole income so far), advances_before, rate in percent; revenue includes transfer_revenue. pit and zus: per partner of a sole proprietorship or civil partnership, member_id is the partner (see list_tax_years); pit details revenue, transfer_revenue (the part of revenue from incoming transfers without an invoice), costs, income (the partner's share, cumulative), social_deducted, health_deducted, tax_base, tax, advances_before, income_tax, rate (nil on the tax scale), rates_year; zus is monthly, details pension, disability, accident, sickness, labour_fund, health, social_base, health_base, rates_year. details documents_amount and typical_payment are present only when amount is the median of the last three payments of that kind (transfers to the tax micro-account or to ZUS; only the periods due on or after the booking date of the earliest transaction count, so for a recent bank history the median of two (their mean) or of one, and none without any) instead of what the documents gave: for a period not past due and within the look-ahead, when the documents did not track the payments (the forecasts of those last three periods were not within 1.5 times of the three sums paid) and the documents' amount is not within 1.5 times of that median, so too low as for a company that does not issue its invoices in Firmowid, or too high as from wrong settings; documents_amount is what the documents gave. A year without saved settings is forecast with those of the latest saved year before it; without any saved year the vat_period that suggest_tax_settings gives (from the transfers to the tax micro-account) lets a VAT payer's VAT be forecast from the documents, nothing is saved, and cit, pit and zus come from the payments alone as their rate, owners and ZUS settings are unknown. A kind that the settings do not forecast at all (no saved year, ZUS of a limited company, simplified CIT advances, unknown legal form) is forecast from the payments alone: the frequency of its latest paid period, one item per period of the year not past due, within the look-ahead and not paid yet, amount the median of the last three payments, member_id empty (the organization's total) and only typical_payment in details; ZUS of a limited company is due on the 15th. vat and cit details also have cost_invoices_without_vat, the cost invoices up to the period without a VAT amount: they bring no input VAT and count at their gross amount in CIT costs. Simplifications: revenue is issued invoices net of VAT plus incoming transfers without an invoice that the analysis put into a revenue category (not from a tax office or ZUS, between own accounts, unclassified or other_income), at their gross amount: a VAT payer's revenue is overstated by the VAT in them, and the VAT of such sales is not forecast; costs are cost invoices net of VAT, salary transfers and skipped outgoing transfers that the analysis put into a cost category (not taxes or other, ZUS of owners or transfers between own accounts; unclassified transfers are not costs); no depreciation, reliefs or losses of earlier years; contributions use the rates_year figures and count in the month they are for; VAT surplus is carried forward and lowered by refunds, not refunded itself. Changes nothing.","operationId":"forecast_taxes","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"year":{"maximum":2100,"minimum":2020,"type":"integer"}},"required":["year"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Forecast taxes and ZUS","tags":["Taxes"]}},"/get_current_session":{"post":{"description":"Get the user's currently running session, if any\n\nPersonal keys only: it acts as the key's person.","operationId":"get_current_session","requestBody":{"content":{"application/json":{"schema":{"properties":{"filter":{"description":"A filter to apply to the query: either a condition {\"field\": ..., \"operator\": ..., \"value\": ...} or an {\"and\": [...]} / {\"or\": [...]} group of conditions and groups (nestable). Operators: contains, eq, greater_than, greater_than_or_equal, ilike, in, is_distinct_from, is_nil, is_not_distinct_from, less_than, less_than_or_equal, like, not_eq, string_ends_with, string_starts_with. For 'is_nil' the value is true or false; for 'in' the value is an array. Fields: id, title, start_datetime, end_datetime, is_remote, inserted_at, updated_at, project_id, duration, lockdown.","type":"object"},"limit":{"default":25,"description":"The maximum number of records to return","type":"integer"},"offset":{"default":0,"description":"The number of records to skip","type":"integer"},"result_type":{"default":"run_query","description":"The type of result to return","oneOf":[{"description":"Run the query returning the matching records (up to `limit`), or return a count of results, or check if any results exist","enum":["run_query","count","exists"],"type":"string"},{"properties":{"aggregate":{"description":"The aggregate function to use","enum":["max","min","sum","avg","count"],"type":"string"},"field":{"description":"The field to aggregate","enum":["id","title","start_datetime","end_datetime","is_remote","inserted_at","updated_at","project_id","duration","lockdown"],"type":"string"}},"required":["aggregate","field"],"type":"object"}]},"sort":{"items":{"properties":{"direction":{"description":"The direction to sort by","enum":["asc","desc"],"type":"string"},"field":{"description":"The field to sort by","enum":["id","title","start_datetime","end_datetime","is_remote","inserted_at","updated_at","project_id","duration","lockdown"],"type":"string"}},"required":["field","direction"],"type":"object"},"type":"array"}},"required":[],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Get current work session","tags":["Timetracker"]}},"/connect_expected_transaction_transactions":{"post":{"description":"Link the bank transactions that brought an expected payment, only after the user approves the specific match. A payment gateway pays many orders in one payout, minus its fee: connect that payout to each expected transaction it covers (call once per expected transaction), so the amounts need not be equal. A transaction already paying an invoice or a salary cannot be linked. Existing links are kept. Requires an accountant or administrator.","operationId":"connect_expected_transaction_transactions","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"transaction_ids":{"items":{"format":"uuid","type":"string"},"type":"array"}},"required":["transaction_ids"],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Fulfil an expected transaction","tags":["Finances"]}},"/disconnect_transaction_salary":{"post":{"description":"Remove a wrong salary assignment from a transfer when the user asks. The bank transaction stays and becomes pending again. Requires an administrator.","operationId":"disconnect_transaction_salary","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"}},"required":["id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Unassign transfer from salary","tags":["Finances"]}},"/disconnect_expected_transaction_transactions":{"post":{"description":"Remove a wrong link between an expected transaction and bank transactions when the user asks. Only the link is removed; the bank transactions become pending again. Requires an accountant or administrator.","operationId":"disconnect_expected_transaction_transactions","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"transaction_ids":{"items":{"format":"uuid","type":"string"},"type":"array"}},"required":["transaction_ids"],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Unlink an expected transaction","tags":["Finances"]}},"/list_analysis_entries":{"post":{"description":"List the entries behind the income and expense analysis for whole months, at most 12: sales invoices, cost invoices, standalone bank transactions and salary transfers. Each entry has its document amount and currency, the month it is counted in, and amount_pln as counted in the totals (negative for expenses; nil when internal or zero, i.e. not counted). category is the industry template category (e.g. payroll, software, premises, sales), nil while unclassified; category_source says who chose it: owner (confirmed), rule (salary, ZUS or tax payment) or classifier, with category_probability for the classifier's choice. counterparty_nip and registered_activity (PKD from public registers) describe the counterparty. allocation splits amount_pln exactly as the dashboard does between projects, shared_cost (company functions), company, taxes or unassigned (salaries by tracked time, else equally). Sum amount_pln yourself for any breakdown. Results belong to the authenticated organization.","operationId":"list_analysis_entries","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"from":{"description":"Any day of the period's first month.","format":"date","type":"string"},"to":{"description":"Any day of the period's last month; the period covers whole months, at most 12.","format":"date","type":"string"}},"required":["from","to"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List analysis entries","tags":["Analysis"]}},"/list_tax_years":{"post":{"description":"List how the company is taxed in each saved year: legal_form, the organization's current legal form (sole_proprietorship, civil_partnership or limited_company), vat_period (nil outside VAT), the CIT rate and advances of a limited company, the accident insurance rate in percent, and the partners who pay their own income tax and ZUS: member_id, profit_share in percent, income_tax, lump_sum_rate, pit_advances, social_insurance and voluntary_sickness. An empty list means nothing is set yet. The settings are entered and confirmed by the accountant in the company settings. Changes nothing.","operationId":"list_tax_years","requestBody":{"content":{"application/json":{"schema":{"properties":{"filter":{"description":"A filter to apply to the query: either a condition {\"field\": ..., \"operator\": ..., \"value\": ...} or an {\"and\": [...]} / {\"or\": [...]} group of conditions and groups (nestable). Operators: eq, greater_than, greater_than_or_equal, in, is_distinct_from, is_nil, is_not_distinct_from, less_than, less_than_or_equal, not_eq. For 'is_nil' the value is true or false; for 'in' the value is an array. Fields: id, year, vat_period, cit_rate, cit_advances, accident_insurance_rate, inserted_at, updated_at, legal_form.","type":"object"},"input":{"properties":{"year":{"type":"integer"}},"required":[],"type":"object"},"limit":{"default":25,"description":"The maximum number of records to return","type":"integer"},"offset":{"default":0,"description":"The number of records to skip","type":"integer"},"result_type":{"default":"run_query","description":"The type of result to return","oneOf":[{"description":"Run the query returning the matching records (up to `limit`), or return a count of results, or check if any results exist","enum":["run_query","count","exists"],"type":"string"},{"properties":{"aggregate":{"description":"The aggregate function to use","enum":["max","min","sum","avg","count"],"type":"string"},"field":{"description":"The field to aggregate","enum":["id","year","vat_period","cit_rate","cit_advances","accident_insurance_rate","inserted_at","updated_at","legal_form"],"type":"string"}},"required":["aggregate","field"],"type":"object"}]},"sort":{"items":{"properties":{"direction":{"description":"The direction to sort by","enum":["asc","desc"],"type":"string"},"field":{"description":"The field to sort by","enum":["id","year","vat_period","cit_rate","cit_advances","accident_insurance_rate","inserted_at","updated_at","legal_form"],"type":"string"}},"required":["field","direction"],"type":"object"},"type":"array"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List tax settings","tags":["Taxes"]}},"/set_analysis_entry_project_tags":{"post":{"description":"Replace all categories of an analysis entry with the selected project tags, sharing its amount equally between them. Use entity_type and the entry's id as resource_id from list_analysis_entries, and tag_definition_ids from list_analysis_tags. An empty tag_definition_ids list removes all categories, leaving the entry unassigned. Requires at least the accountant role. Salary-pinned transfers have automatic categories derived from tracked time; do not tag them manually.","operationId":"set_analysis_entry_project_tags","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"entity_type":{"enum":["sales_invoice","cost_invoice","transaction"],"type":"string"},"resource_id":{"format":"uuid","type":"string"},"tag_definition_ids":{"items":{"format":"uuid","type":"string"},"type":"array"}},"required":["entity_type","resource_id","tag_definition_ids"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Set analysis entry project tags","tags":["Analysis"]}},"/list_counterparties":{"post":{"description":"Search the organization's counterparties (clients) by name, display name, tax ID, PESEL or e-mail. Use it to find the counterparty a sales invoice belongs to before link_sales_invoice_counterparty; a counterparty may be known under a brand different from the buyer name on the invoice. Changes nothing.","operationId":"list_counterparties","requestBody":{"content":{"application/json":{"schema":{"properties":{"filter":{"description":"A filter to apply to the query: either a condition {\"field\": ..., \"operator\": ..., \"value\": ...} or an {\"and\": [...]} / {\"or\": [...]} group of conditions and groups (nestable). Operators: contains, eq, greater_than, greater_than_or_equal, ilike, in, is_distinct_from, is_nil, is_not_distinct_from, less_than, less_than_or_equal, like, not_eq, string_ends_with, string_starts_with. For 'is_nil' the value is true or false; for 'in' the value is an array. Fields: id, type, tax_id, full_name, given_name, surname, pesel, display_name, address, country, archived_at, is_different_mail_address, mail_address, mail_country, email, phone, description, website_domain, website_checked_at, inserted_at, updated_at, vat_id_status, vat_id_checked_at, nip_registers, krs, regon.","type":"object"},"input":{"properties":{"limit":{"maximum":100,"minimum":1,"type":"integer"},"search":{"type":"string"},"sort_by":{"enum":["name","display_name","created_at"],"type":"string"},"sort_order":{"enum":["asc","desc"],"type":"string"},"status":{"enum":["active","archived","all"],"type":"string"},"type":{"enum":["individual","company"],"type":"string"},"vat_id_due_before":{"description":"Only counterparties with an EU VAT number or NIP never checked or last checked before this time.","format":"date-time","type":"string"},"vat_id_statuses":{"description":"Only counterparties whose last tax ID check gave one of these results.","items":{"description":"Only counterparties whose last tax ID check gave one of these results.","enum":["active","inactive","invalid","exempt","no_vat","closed","unconfirmed"],"type":"string"},"type":"array"},"website_unchecked":{"description":"Only companies whose website was never looked up.","type":"boolean"}},"required":[],"type":"object"},"sort":{"items":{"properties":{"direction":{"description":"The direction to sort by","enum":["asc","desc"],"type":"string"},"field":{"description":"The field to sort by","enum":["id","type","tax_id","full_name","given_name","surname","pesel","display_name","address","country","archived_at","is_different_mail_address","mail_address","mail_country","email","phone","description","website_domain","website_checked_at","inserted_at","updated_at","vat_id_status","vat_id_checked_at","nip_registers","krs","regon"],"type":"string"}},"required":["field","direction"],"type":"object"},"type":"array"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List counterparties","tags":["Invoicing"]}},"/preview_sales_invoice":{"post":{"description":"Validate invoice data and open the mandatory user confirmation widget. Creates nothing. The user selects a number and confirms issuance inside the widget; an active KSeF connection is required to issue. Pass invoice_id to resume a saved draft, retaining its ID. Put the invoice fields in invoice. Required: buyer_type, buyer_full_name (or given name and surname), buyer_id (tax ID) for companies, buyer_address, sale_date, due_date and sales_invoice_items with name, quantity, unit, net unit_price and vat_rate such as \"23\". Seller details, issue date, PLN, Poland and payment by transfer to the organization's default account for the currency are filled in when omitted.","operationId":"preview_sales_invoice","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"invoice":{"properties":{"vat_exemption_type":{"enum":["art_113","art_43","art_82_ust_3","directive_2006_112","other"],"type":"string"},"buyer_full_name":{"type":"string"},"buyer_id":{"type":"string"},"buyer_surname":{"type":"string"},"skip_invoicing":{"type":"boolean"},"counterparty_id":{"format":"uuid","type":"string"},"buyer_is_different_mail_address":{"type":"boolean"},"is_reverse_charge":{"type":"boolean"},"issue_date":{"format":"date","type":"string"},"buyer_pesel":{"type":"string"},"should_send_emails":{"type":"boolean"},"sales_invoice_items":{"items":{"properties":{"discount":{"type":"string"},"gtu":{"type":"string"},"index":{"type":"integer"},"name":{"type":"string"},"quantity":{"type":"string"},"unit":{"type":"string"},"unit_price":{"type":"string"},"vat_rate":{"type":"string"}},"required":["name","quantity","unit","unit_price"],"type":"object"},"type":"array"},"buyer_given_name":{"type":"string"},"buyer_display_name":{"type":"string"},"sale_date":{"format":"date","type":"string"},"buyer_country":{"type":"string"},"vat_exemption_basis":{"type":"string"},"buyer_phone":{"type":"string"},"invoice_note":{"type":"string"},"buyer_mail_country":{"type":"string"},"buyer_type":{"enum":["company","individual"],"type":"string"},"correction_reason":{"maxLength":256,"type":"string"},"invoice_number":{"type":"string"},"paid_on":{"description":"The day a VAT invoice was paid in full, no later than its issue date. It is then issued as paid, with no due date. Leave null for an invoice the buyer still has to pay, and for an advance invoice.","format":"date","type":"string"},"buyer_mail_address":{"type":"string"},"internal_note":{"maxLength":10000,"type":"string"},"is_cash_account":{"description":"Cash accounting of VAT (metoda kasowa). Leave null to use the organization's usual choice; set it only when the user asks.","type":"boolean"},"ksef_invoice_kind":{"description":"vat (default) for a regular invoice; advance for an advance invoice (KSeF ZAL) documenting a payment received in full before the sale, with sale_date as the payment date.","enum":["vat","advance"],"type":"string"},"currency":{"type":"string"},"invoice_type":{"enum":["poland","foreign"],"type":"string"},"buyer_description":{"type":"string"},"payment_method":{"enum":["cash","card","voucher","check","credit","transfer","mobile"],"type":"string"},"buyer_email":{"type":"string"},"buyer_address":{"type":"string"},"seller_account_number":{"type":"string"},"due_date":{"format":"date","type":"string"},"settlement_entries":{"description":"Charges and deductions settled on the invoice (FA(3) Rozliczenie), such as a deposit charged or an advance already paid. They change only the amount due, never the invoice's totals. Leave null to keep a draft's saved entries.","items":{"description":"Charges and deductions settled on the invoice (FA(3) Rozliczenie), such as a deposit charged or an advance already paid. They change only the amount due, never the invoice's totals. Leave null to keep a draft's saved entries.","properties":{"amount":{"type":"string"},"kind":{"description":"charge adds to the invoice's gross total, deduction (e.g. an advance already paid) subtracts from it.","enum":["charge","deduction"],"type":"string"},"reason":{"maxLength":256,"type":"string"}},"required":["kind","amount","reason"],"type":"object"},"type":"array"}},"required":[],"type":"object"},"invoice_id":{"description":"ID of a saved draft to issue; omit for a new invoice.","format":"uuid","type":"string"}},"required":["invoice"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Preview sales invoice","tags":["Invoicing"]}},"/suggest_transaction_invoices":{"post":{"description":"Rank unresolved invoices that a pending bank transaction may pay, using the same model as automatic matching: sales invoices for income, cost invoices for expenses, best score first. Returns nothing for a matched or skipped transaction. The score only ranks candidates; confirm the counterparty, amount and title before proposing a match. Changes nothing.","operationId":"suggest_transaction_invoices","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"transaction_id":{"description":"ID of a pending transaction.","format":"uuid","type":"string"}},"required":["transaction_id"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Suggest invoices for a transaction","tags":["Finances"]}},"/list_analysis_tags":{"post":{"description":"List the authenticated organization's project tags with IDs and names. Use these IDs as tag_definition_ids in set_analysis_entry_project_tags. Tags include custom categories and project tags. Company, taxes and internal are built-in categories. Tags with overhead set are company functions (e.g. marketing, HR): their shares count as company overhead.","operationId":"list_analysis_tags","requestBody":{"content":{"application/json":{"schema":{"properties":{"filter":{"description":"A filter to apply to the query: either a condition {\"field\": ..., \"operator\": ..., \"value\": ...} or an {\"and\": [...]} / {\"or\": [...]} group of conditions and groups (nestable). Operators: contains, eq, greater_than, greater_than_or_equal, ilike, in, is_distinct_from, is_nil, is_not_distinct_from, less_than, less_than_or_equal, like, not_eq, string_ends_with, string_starts_with. For 'is_nil' the value is true or false; for 'in' the value is an array. Fields: id, name, color, overhead, inserted_at, updated_at.","type":"object"},"input":{"properties":{"ids":{"items":{"format":"uuid","type":"string"},"type":"array"},"search":{"type":"string"}},"required":[],"type":"object"},"limit":{"default":25,"description":"The maximum number of records to return","type":"integer"},"offset":{"default":0,"description":"The number of records to skip","type":"integer"},"result_type":{"default":"run_query","description":"The type of result to return","oneOf":[{"description":"Run the query returning the matching records (up to `limit`), or return a count of results, or check if any results exist","enum":["run_query","count","exists"],"type":"string"},{"properties":{"aggregate":{"description":"The aggregate function to use","enum":["max","min","sum","avg","count"],"type":"string"},"field":{"description":"The field to aggregate","enum":["id","name","color","overhead","inserted_at","updated_at"],"type":"string"}},"required":["aggregate","field"],"type":"object"}]},"sort":{"items":{"properties":{"direction":{"description":"The direction to sort by","enum":["asc","desc"],"type":"string"},"field":{"description":"The field to sort by","enum":["id","name","color","overhead","inserted_at","updated_at"],"type":"string"}},"required":["field","direction"],"type":"object"},"type":"array"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List analysis project tags","tags":["Analysis"]}},"/list_transactions":{"post":{"description":"List the organization's synced bank transactions to find payments, answer questions and match them with invoices or salaries. Amounts are signed: income positive, expenses negative; direction tells which. reconciliation_status pending means unresolved, matched means linked to an invoice, a salary or an expected transaction, skipped means excluded from matching. Use after/before keyset cursors with the same filters to navigate pages.","operationId":"list_transactions","requestBody":{"content":{"application/json":{"schema":{"properties":{"after":{"description":"Fetch the page after this keyset cursor. Pass the `end_keyset` from a previous page to fetch the following page.","type":"string"},"before":{"description":"Fetch the page before this keyset cursor. Pass the `start_keyset` from a previous page to fetch the preceding page.","type":"string"},"input":{"properties":{"amount_from":{"description":"Minimum amount, inclusive, compared as an absolute value although expenses are negative.","type":"string"},"amount_to":{"description":"Maximum amount, inclusive, compared as an absolute value although expenses are negative.","type":"string"},"currency":{"description":"ISO currency code, e.g. PLN.","type":"string"},"date_from":{"description":"Inclusive start of the booking date range (YYYY-MM-DD).","format":"date","type":"string"},"date_to":{"description":"Inclusive end of the booking date range (YYYY-MM-DD).","format":"date","type":"string"},"ids":{"description":"Return only transactions with these IDs.","items":{"description":"Return only transactions with these IDs.","format":"uuid","type":"string"},"type":"array"},"query":{"description":"Full-text search over the debtor, creditor and transfer title.","maxLength":500,"type":"string"},"reconciliation":{"description":"matched is linked to an invoice or a monthly salary, pending is unresolved, skipped is excluded from matching.","enum":["matched","skipped","pending"],"type":"string"},"salary_assigned":{"description":"Whether the transfer is assigned to a monthly salary.","type":"boolean"},"salary_month":{"description":"Only transfers assigned to the salary of this month (first day).","format":"date","type":"string"},"salary_user_id":{"description":"Only transfers assigned to this employee's salary.","format":"uuid","type":"string"}},"required":[],"type":"object"},"limit":{"default":25,"description":"The maximum number of records to return in one page","type":"integer"},"sort":{"items":{"properties":{"direction":{"description":"The direction to sort by","enum":["asc","desc"],"type":"string"},"field":{"description":"The field to sort by","enum":["id","transaction_id","internal_transaction_id","creditor_name","creditor_account","debtor_name","debtor_account","amount","booking_date","value_date","remittance_information_unstructured","skip_invoicing","inserted_at","updated_at","reconciliation_status","has_salary?","direction","signed_amount","counterparty_name","counterparty_display_name","groupable?"],"type":"string"}},"required":["field","direction"],"type":"object"},"type":"array"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List bank transactions","tags":["Finances"]}},"/suggest_tax_settings":{"post":{"description":"Suggest a year's vat_period, cit_advances, income_tax and pit_advances from the transfers to the company's tax micro-account: the period (month or quarter) and form symbol in their titles. Each suggestion has the year whose transfers it comes from (the year before when the year has none) and how many transfers it counts. Income tax suggestions only fit a sole proprietorship, whose owner pays from the company account. For a sole proprietorship with its one owner saved in the year, also social_insurance and voluntary_sickness (from the ZUS transfers, each month's total equal to the contributions that setting makes, to the grosz) and lump_sum_rate (from lump sum advances, equal within 1 zł, only when the saved income tax is the lump sum); each needs two matching months or periods and no other setting matching as often. value is a word, true/false (voluntary_sickness) or the rate in percent (lump_sum_rate). Not binding: say they are based on the transactions; an admin confirms them by saving the year in the company settings. Changes nothing.","operationId":"suggest_tax_settings","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"year":{"maximum":2100,"minimum":2020,"type":"integer"}},"required":["year"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Suggest tax settings","tags":["Taxes"]}},"/suggest_cost_invoice_transactions":{"post":{"description":"Rank bank transactions that may pay a cost invoice, using the same model as automatic matching. Returns every transaction already connected (connected: true, unscored when outside the matching window) and pending transactions near the invoice's dates and amount, best score first. The score only ranks candidates; confirm the payee, amount and title before proposing a match. Pass an original invoice ID, not a correction. Changes nothing.","operationId":"suggest_cost_invoice_transactions","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"invoice_id":{"description":"ID of an original invoice, not a correction.","format":"uuid","type":"string"}},"required":["invoice_id"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Suggest cost invoice payments","tags":["Invoicing"]}},"/disconnect_cost_invoice_transactions":{"post":{"description":"Remove a wrong payment match from a cost invoice when the user asks. Only the connection is removed; the invoice and the bank transactions stay. Connected transactions appear in suggest_cost_invoice_transactions with connected: true. Requires an accountant or administrator.","operationId":"disconnect_cost_invoice_transactions","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"transaction_ids":{"items":{"format":"uuid","type":"string"},"type":"array"}},"required":["transaction_ids"],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Disconnect cost invoice payments","tags":["Invoicing"]}},"/list_monthly_salaries":{"post":{"description":"List every employee salary of one month, including already paid ones and months without submitted hours, with no amount or date window. expected_amount is the hourly rate multiplied by the logged hours rounded up, not a recorded payout. payout_estimates contains hypothetical net payout alternatives. connected_transaction_id is the transfer assigned to that salary. Use it to find the right salary when suggestions miss it. Requires an administrator. Changes nothing.","operationId":"list_monthly_salaries","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"month":{"description":"Any day of the salary month, e.g. 2026-01-01.","format":"date","type":"string"},"query":{"description":"Case- and diacritic-insensitive part of the employee's name or email.","maxLength":200,"type":"string"},"user_id":{"description":"Only this employee's salary.","format":"uuid","type":"string"}},"required":["month"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List salaries of a month","tags":["Finances"]}},"/preview_sales_invoice_correction":{"post":{"description":"Preview a correction to an issued invoice and open the mandatory confirmation widget. First read the source with get_sales_invoice. Supply original_invoice_id and put the full corrected invoice fields and items in invoice. Preserves buyer tax identity and the effective correction chain. Creates nothing until the user confirms in the widget.","operationId":"preview_sales_invoice_correction","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"invoice":{"properties":{"vat_exemption_type":{"enum":["art_113","art_43","art_82_ust_3","directive_2006_112","other"],"type":"string"},"buyer_full_name":{"type":"string"},"buyer_id":{"type":"string"},"buyer_surname":{"type":"string"},"skip_invoicing":{"type":"boolean"},"counterparty_id":{"format":"uuid","type":"string"},"buyer_is_different_mail_address":{"type":"boolean"},"is_reverse_charge":{"type":"boolean"},"issue_date":{"format":"date","type":"string"},"buyer_pesel":{"type":"string"},"should_send_emails":{"type":"boolean"},"sales_invoice_items":{"items":{"properties":{"discount":{"type":"string"},"gtu":{"type":"string"},"index":{"type":"integer"},"name":{"type":"string"},"quantity":{"type":"string"},"unit":{"type":"string"},"unit_price":{"type":"string"},"vat_rate":{"type":"string"}},"required":["name","quantity","unit","unit_price"],"type":"object"},"type":"array"},"buyer_given_name":{"type":"string"},"buyer_display_name":{"type":"string"},"sale_date":{"format":"date","type":"string"},"buyer_country":{"type":"string"},"vat_exemption_basis":{"type":"string"},"buyer_phone":{"type":"string"},"invoice_note":{"type":"string"},"buyer_mail_country":{"type":"string"},"buyer_type":{"enum":["company","individual"],"type":"string"},"correction_reason":{"maxLength":256,"type":"string"},"invoice_number":{"type":"string"},"paid_on":{"description":"The day a VAT invoice was paid in full, no later than its issue date. It is then issued as paid, with no due date. Leave null for an invoice the buyer still has to pay, and for an advance invoice.","format":"date","type":"string"},"buyer_mail_address":{"type":"string"},"internal_note":{"maxLength":10000,"type":"string"},"is_cash_account":{"description":"Cash accounting of VAT (metoda kasowa). Leave null to use the organization's usual choice; set it only when the user asks.","type":"boolean"},"ksef_invoice_kind":{"description":"vat (default) for a regular invoice; advance for an advance invoice (KSeF ZAL) documenting a payment received in full before the sale, with sale_date as the payment date.","enum":["vat","advance"],"type":"string"},"currency":{"type":"string"},"invoice_type":{"enum":["poland","foreign"],"type":"string"},"buyer_description":{"type":"string"},"payment_method":{"enum":["cash","card","voucher","check","credit","transfer","mobile"],"type":"string"},"buyer_email":{"type":"string"},"buyer_address":{"type":"string"},"seller_account_number":{"type":"string"},"due_date":{"format":"date","type":"string"},"settlement_entries":{"description":"Charges and deductions settled on the invoice (FA(3) Rozliczenie), such as a deposit charged or an advance already paid. They change only the amount due, never the invoice's totals. Leave null to keep a draft's saved entries.","items":{"description":"Charges and deductions settled on the invoice (FA(3) Rozliczenie), such as a deposit charged or an advance already paid. They change only the amount due, never the invoice's totals. Leave null to keep a draft's saved entries.","properties":{"amount":{"type":"string"},"kind":{"description":"charge adds to the invoice's gross total, deduction (e.g. an advance already paid) subtracts from it.","enum":["charge","deduction"],"type":"string"},"reason":{"maxLength":256,"type":"string"}},"required":["kind","amount","reason"],"type":"object"},"type":"array"}},"required":[],"type":"object"},"original_invoice_id":{"format":"uuid","type":"string"}},"required":["invoice","original_invoice_id"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Preview invoice correction","tags":["Invoicing"]}},"/get_ksef_connection_status":{"post":{"description":"Check KSeF connection status before invoice work. KSeF is connected only by an organization admin in the Firmowid web app, never through this tool or the conversation; if disconnected or expired, send the user to the KSeF settings there. Stored invoices remain readable while disconnected. A connected status does not guarantee current invoice data: data_freshness is unknown.","operationId":"get_ksef_connection_status","requestBody":{"content":{"application/json":{"schema":{"properties":{},"required":[],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Get KSeF connection status","tags":["Ksef"]}},"/get_shared_birthday":{"post":{"description":"Returns the authenticated user's shared birthday (nil if not shared)\n\nPersonal keys only: it acts as the key's person.","operationId":"get_shared_birthday","requestBody":{"content":{"application/json":{"schema":{"properties":{},"required":[],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Get shared birthday","tags":["Core"]}},"/set_analysis_entry_category":{"post":{"description":"Replace all categories of an analysis entry with company (general company income or expense), taxes, or internal (excluded from analysis totals). Use entity_type and the entry's id as resource_id from list_analysis_entries. Requires at least the accountant role. Salary-pinned transfers have automatic categories derived from tracked time; do not tag them manually.","operationId":"set_analysis_entry_category","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"entity_type":{"enum":["sales_invoice","cost_invoice","transaction"],"type":"string"},"kind":{"enum":["company","taxes","internal"],"type":"string"},"resource_id":{"format":"uuid","type":"string"}},"required":["entity_type","resource_id","kind"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Set analysis entry category","tags":["Analysis"]}},"/update_cost_invoice_internal_note":{"post":{"description":"Replace the cost invoice's internal note only when the user asks. Pass null to clear it. Maximum 10000 characters. Does not change the source document. Requires an accountant or administrator.","operationId":"update_cost_invoice_internal_note","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"internal_note":{"type":"string"}},"required":[],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Update cost invoice internal note","tags":["Invoicing"]}},"/start_session":{"post":{"description":"Start a work session for the authenticated user now. Optionally pass project_id from list_projects, a title and is_remote. Stops the current session, if any. To log past work use add_sessions instead of stopping the running session.\n\nPersonal keys only: it acts as the key's person.","operationId":"start_session","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"is_remote":{"type":"boolean"},"project_id":{"format":"uuid","type":"string"},"start_datetime":{"format":"date-time","type":"string"},"title":{"type":"string"}},"required":["title","start_datetime","project_id"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Start work session","tags":["Timetracker"]}},"/disconnect_sales_invoice_transactions":{"post":{"description":"Remove a wrong payment match from a sales invoice when the user asks. Only the connection is removed; the invoice and the bank transactions stay. Connected transactions appear in suggest_sales_invoice_transactions with connected: true. Requires an accountant or administrator.","operationId":"disconnect_sales_invoice_transactions","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"transaction_ids":{"items":{"format":"uuid","type":"string"},"type":"array"}},"required":["transaction_ids"],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Disconnect sales invoice payments","tags":["Invoicing"]}},"/list_cost_invoices":{"post":{"description":"List cost invoices as data for questions, summaries, analysis and tables in the conversation. First check get_ksef_connection_status and propose connection if needed; stored invoices remain readable without it and may be out of date. Results belong to the authenticated organization and retain signed Money amounts. effective_amount includes correction deltas; with merge_corrections sum it instead of amount. Use after/before keyset cursors with the same filters to navigate pages.","operationId":"list_cost_invoices","requestBody":{"content":{"application/json":{"schema":{"properties":{"after":{"description":"Fetch the page after this keyset cursor. Pass the `end_keyset` from a previous page to fetch the following page.","type":"string"},"before":{"description":"Fetch the page before this keyset cursor. Pass the `start_keyset` from a previous page to fetch the preceding page.","type":"string"},"input":{"properties":{"amount_from":{"description":"Minimum gross amount, inclusive, compared as an absolute value although costs are stored negative.","type":"string"},"amount_to":{"description":"Maximum gross amount, inclusive, compared as an absolute value although costs are stored negative.","type":"string"},"currency":{"description":"ISO currency code, e.g. PLN. Never add up amounts in different currencies.","type":"string"},"date_field":{"description":"Date compared with date_from and date_to; any matches either issue_date or sale_date.","enum":["issue_date","sale_date","due_date","any"],"type":"string"},"date_from":{"description":"Inclusive start of the date_field range (YYYY-MM-DD).","format":"date","type":"string"},"date_to":{"description":"Inclusive end of the date_field range (YYYY-MM-DD).","format":"date","type":"string"},"ids":{"description":"Return only invoices with these IDs.","items":{"description":"Return only invoices with these IDs.","format":"uuid","type":"string"},"type":"array"},"in_digest":{"description":"Whether the invoice was already included in a KSeF cost invoice notification digest.","enum":["yes","no"],"type":"string"},"inserted_from":{"description":"Inclusive lower bound of when the invoice was recorded in Firmowid, not its document date.","format":"date-time","type":"string"},"inserted_to":{"description":"Exclusive upper bound of when the invoice was recorded in Firmowid, not its document date.","format":"date-time","type":"string"},"is_ksef_imported":{"description":"Whether the invoice was imported from KSeF.","type":"boolean"},"limit":{"description":"Page size, at most 100.","minimum":1,"type":"integer"},"listing_sort":{"description":"Order by issue date, newest or oldest first.","enum":["newest","oldest"],"type":"string"},"merge_corrections":{"description":"Hide corrections linked to an original and compare amounts after corrections. Use for totals and rankings.","type":"boolean"},"overdue_on":{"description":"Only unpaid transfer invoices overdue on this date, using corrected dates and amounts.","format":"date","type":"string"},"query":{"description":"Full-text search over seller, description and invoice identifier.","maxLength":500,"type":"string"},"reconciliation":{"description":"Payment matching with bank transactions: pending has no matched payment yet, matched is linked to a transaction, skipped is excluded from matching. Linked corrections use the original invoice's reconciliation and are never listed separately.","enum":["pending","matched","skipped"],"type":"string"},"source":{"description":"ksef for invoices imported from KSeF, manual_import for those added another way.","enum":["manual_import","ksef"],"type":"string"}},"required":[],"type":"object"},"limit":{"default":25,"description":"The maximum number of records to return in one page","type":"integer"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List cost invoices","tags":["Invoicing"]}},"/stop_current_session":{"post":{"description":"End the authenticated user's currently running work session\n\nPersonal keys only: it acts as the key's person.","operationId":"stop_current_session","requestBody":{"content":{"application/json":{"schema":{"properties":{},"required":[],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Stop work session","tags":["Timetracker"]}},"/get_sales_invoice":{"post":{"description":"Read a single authorized sales invoice, its items, effective correction snapshot and KSeF status. Use this before preparing a correction or resuming a saved draft. This tool never changes the invoice.","operationId":"get_sales_invoice","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"}},"required":["id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Get sales invoice","tags":["Invoicing"]}},"/list_expected_transactions":{"post":{"description":"List money the organization expects on or from its bank account, such as a forecast payment or the payment of an invoice paid on issue, which then counts as paid already. Amounts are signed: income positive, expenses negative. Pass fulfilled: false for the ones still waiting for their bank transaction, which connect_expected_transaction_transactions links.","operationId":"list_expected_transactions","requestBody":{"content":{"application/json":{"schema":{"properties":{"filter":{"description":"A filter to apply to the query: either a condition {\"field\": ..., \"operator\": ..., \"value\": ...} or an {\"and\": [...]} / {\"or\": [...]} group of conditions and groups (nestable). Operators: contains, eq, greater_than, greater_than_or_equal, ilike, in, is_distinct_from, is_nil, is_not_distinct_from, less_than, less_than_or_equal, like, not_eq, string_ends_with, string_starts_with. For 'is_nil' the value is true or false; for 'in' the value is an array. Fields: id, date, amount, description, counterparty_name, forecast_key, inserted_at, updated_at, is_fulfilled.","type":"object"},"input":{"properties":{"date_from":{"format":"date","type":"string"},"date_to":{"format":"date","type":"string"},"forecast":{"description":"true for the expectations kept by the tax forecast, false for all the others.","type":"boolean"},"fulfilled":{"type":"boolean"}},"required":[],"type":"object"},"limit":{"default":25,"description":"The maximum number of records to return","type":"integer"},"offset":{"default":0,"description":"The number of records to skip","type":"integer"},"result_type":{"default":"run_query","description":"The type of result to return","oneOf":[{"description":"Run the query returning the matching records (up to `limit`), or return a count of results, or check if any results exist","enum":["run_query","count","exists"],"type":"string"},{"properties":{"aggregate":{"description":"The aggregate function to use","enum":["max","min","sum","avg","count"],"type":"string"},"field":{"description":"The field to aggregate","enum":["id","date","amount","description","counterparty_name","forecast_key","inserted_at","updated_at","is_fulfilled"],"type":"string"}},"required":["aggregate","field"],"type":"object"}]},"sort":{"items":{"properties":{"direction":{"description":"The direction to sort by","enum":["asc","desc"],"type":"string"},"field":{"description":"The field to sort by","enum":["id","date","amount","description","counterparty_name","forecast_key","inserted_at","updated_at","is_fulfilled"],"type":"string"}},"required":["field","direction"],"type":"object"},"type":"array"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"List expected transactions","tags":["Finances"]}},"/suggest_transaction_salaries":{"post":{"description":"Suggest which employee's monthly salary a pending or skipped outgoing PLN transfer pays. Considers months with logged time up to six months back whose salary is not yet assigned and whose closest estimated payout is within 20% (at least 1000 PLN) of the transfer. When the employee's stored bank account is known, it decides instead: a transfer to that account is suggested whatever the amount and ranked first, a transfer to another account is not. Uses gross pay only if the contract type is unknown. A full recipient name strictly outranks a partial name, the expected month and the amount difference. A payout variant is a hypothesis, not confirmed insurance or tax status. By default only salaries with a submitted hours record count. An empty result has a reason. Requires an administrator. Changes nothing.","operationId":"suggest_transaction_salaries","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"salary_month":{"description":"Only suggest the salary of this month (first day).","format":"date","type":"string"},"salary_user_id":{"description":"Only suggest this employee's salaries.","format":"uuid","type":"string"},"submitted_hours_only?":{"description":"Only propose salaries with a submitted, non-withdrawn hours record.","type":"boolean"},"transaction_id":{"description":"ID of a pending or skipped outgoing PLN transfer.","format":"uuid","type":"string"}},"required":["transaction_id","submitted_hours_only?"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Suggest salaries for a transfer","tags":["Finances"]}},"/update_sales_invoice_draft":{"post":{"description":"Revise a saved unnumbered invoice draft when the user asks to change it before issuing later. To issue a draft, call preview_sales_invoice with its invoice_id instead.","operationId":"update_sales_invoice_draft","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"vat_exemption_type":{"enum":["art_113","art_43","art_82_ust_3","directive_2006_112","other"],"type":"string"},"buyer_full_name":{"type":"string"},"buyer_id":{"type":"string"},"buyer_surname":{"type":"string"},"counterparty_id":{"format":"uuid","type":"string"},"buyer_is_different_mail_address":{"type":"boolean"},"is_reverse_charge":{"type":"boolean"},"input":{"properties":{"vat_exemption_type":{"enum":["art_113","art_43","art_82_ust_3","directive_2006_112","other"],"type":"string"},"buyer_full_name":{"type":"string"},"buyer_id":{"type":"string"},"buyer_surname":{"type":"string"},"skip_invoicing":{"type":"boolean"},"counterparty_id":{"format":"uuid","type":"string"},"buyer_is_different_mail_address":{"type":"boolean"},"is_reverse_charge":{"type":"boolean"},"issue_date":{"format":"date","type":"string"},"buyer_pesel":{"type":"string"},"should_send_emails":{"type":"boolean"},"sales_invoice_items":{"items":{"properties":{"discount":{"type":"string"},"gtu":{"type":"string"},"index":{"type":"integer"},"name":{"type":"string"},"quantity":{"type":"string"},"unit":{"type":"string"},"unit_price":{"type":"string"},"vat_rate":{"type":"string"}},"required":["name","quantity","unit","unit_price"],"type":"object"},"type":"array"},"buyer_given_name":{"type":"string"},"buyer_display_name":{"type":"string"},"sale_date":{"format":"date","type":"string"},"buyer_country":{"type":"string"},"vat_exemption_basis":{"type":"string"},"buyer_phone":{"type":"string"},"invoice_note":{"type":"string"},"buyer_mail_country":{"type":"string"},"buyer_type":{"enum":["company","individual"],"type":"string"},"correction_reason":{"maxLength":256,"type":"string"},"invoice_number":{"type":"string"},"paid_on":{"description":"The day a VAT invoice was paid in full, no later than its issue date. It is then issued as paid, with no due date. Leave null for an invoice the buyer still has to pay, and for an advance invoice.","format":"date","type":"string"},"buyer_mail_address":{"type":"string"},"internal_note":{"maxLength":10000,"type":"string"},"is_cash_account":{"description":"Cash accounting of VAT (metoda kasowa). Leave null to use the organization's usual choice; set it only when the user asks.","type":"boolean"},"ksef_invoice_kind":{"description":"vat (default) for a regular invoice; advance for an advance invoice (KSeF ZAL) documenting a payment received in full before the sale, with sale_date as the payment date.","enum":["vat","advance"],"type":"string"},"currency":{"type":"string"},"invoice_type":{"enum":["poland","foreign"],"type":"string"},"buyer_description":{"type":"string"},"payment_method":{"enum":["cash","card","voucher","check","credit","transfer","mobile"],"type":"string"},"buyer_email":{"type":"string"},"buyer_address":{"type":"string"},"seller_account_number":{"type":"string"},"due_date":{"format":"date","type":"string"},"settlement_entries":{"description":"Charges and deductions settled on the invoice (FA(3) Rozliczenie), such as a deposit charged or an advance already paid. They change only the amount due, never the invoice's totals. Leave null to keep a draft's saved entries.","items":{"description":"Charges and deductions settled on the invoice (FA(3) Rozliczenie), such as a deposit charged or an advance already paid. They change only the amount due, never the invoice's totals. Leave null to keep a draft's saved entries.","properties":{"amount":{"type":"string"},"kind":{"description":"charge adds to the invoice's gross total, deduction (e.g. an advance already paid) subtracts from it.","enum":["charge","deduction"],"type":"string"},"reason":{"maxLength":256,"type":"string"}},"required":["kind","amount","reason"],"type":"object"},"type":"array"}},"required":[],"type":"object"},"buyer_pesel":{"type":"string"},"should_send_emails":{"type":"boolean"},"sales_invoice_items":{"items":{"type":"object"},"type":"array"},"buyer_given_name":{"type":"string"},"buyer_display_name":{"type":"string"},"sale_date":{"format":"date","type":"string"},"buyer_country":{"type":"string"},"vat_exemption_basis":{"maxLength":256,"type":"string"},"buyer_phone":{"type":"string"},"invoice_note":{"type":"string"},"buyer_mail_country":{"type":"string"},"buyer_type":{"enum":["individual","company"],"type":"string"},"paid_on":{"description":"The day a VAT invoice was paid in full, by its issue date. An advance invoice is paid on its sale date instead.","format":"date","type":"string"},"buyer_mail_address":{"type":"string"},"internal_note":{"type":"string"},"is_cash_account":{"type":"boolean"},"ksef_invoice_kind":{"enum":["vat","kor","advance"],"type":"string"},"currency":{"type":"string"},"invoice_type":{"enum":["poland","foreign"],"type":"string"},"buyer_description":{"type":"string"},"payment_method":{"enum":["cash","card","voucher","check","credit","transfer","mobile"],"type":"string"},"buyer_email":{"type":"string"},"buyer_address":{"type":"string"},"seller_account_number":{"type":"string"},"due_date":{"format":"date","type":"string"},"settlement_entries":{"items":{"type":"object"},"type":"array"}},"required":[],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Update invoice draft","tags":["Invoicing"]}},"/add_sessions":{"post":{"description":"Add one or more completed work sessions of the authenticated user with explicit start and end times, e.g. to fill in a forgotten morning. A running session keeps going untouched; do not stop, edit or restart it. Pass ISO 8601 times with an offset (2026-11-04T08:00:00+01:00 or ...Z); times without one are read as UTC. Times are stored at minute precision. Each session needs a title and a project_id from list_projects, must not end before it starts, stay within one calendar month, last at most 24 hours and must not overlap any other session, including the running one from its start onwards. Months with a submitted hours record are locked. All sessions are added or none; an error names the failing item as sessions.<index>.\n\nPersonal keys only: it acts as the key's person.","operationId":"add_sessions","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"sessions":{"items":{"properties":{"end_datetime":{"format":"date-time","type":"string"},"is_remote":{"type":"boolean"},"project_id":{"format":"uuid","type":"string"},"start_datetime":{"format":"date-time","type":"string"},"title":{"type":"string"}},"required":["title","project_id","start_datetime","end_datetime"],"type":"object"},"type":"array"}},"required":["sessions"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Add past work sessions","tags":["Timetracker"]}},"/connect_sales_invoice_transactions":{"post":{"description":"Mark a sales invoice as paid by connecting bank transactions to it, only after the user approves the specific match. Any combination is allowed: several transactions may pay one invoice (installments) and one transaction may pay several invoices (call once per invoice). A transaction assigned to a salary cannot be connected. Existing connections are kept. Requires an accountant or administrator.","operationId":"connect_sales_invoice_transactions","requestBody":{"content":{"application/json":{"schema":{"properties":{"id":{"format":"uuid","type":"string"},"input":{"properties":{"transaction_ids":{"items":{"format":"uuid","type":"string"},"type":"array"}},"required":["transaction_ids"],"type":"object"}},"required":["input","id"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Connect sales invoice payments","tags":["Invoicing"]}},"/edit_session":{"post":{"description":"Edit the title, start or end time, project or remote flag of one of the authenticated user's sessions by id. Sessions locked by a submitted hours record cannot be changed.\n\nPersonal keys only: it acts as the key's person.","operationId":"edit_session","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"end_datetime":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"is_remote":{"type":"boolean"},"project_id":{"format":"uuid","type":"string"},"start_datetime":{"format":"date-time","type":"string"},"title":{"type":"string"}},"required":["id"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Edit work session","tags":["Timetracker"]}},"/suggest_sales_invoice_transactions":{"post":{"description":"Rank bank transactions that may pay a sales invoice, using the same model as automatic matching. Returns every transaction already connected (connected: true, unscored when outside the matching window) and pending transactions near the invoice's dates and amount, best score first. The score only ranks candidates; confirm the payer, amount and title before proposing a match. Pass an original invoice ID, not a correction. Changes nothing.","operationId":"suggest_sales_invoice_transactions","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"properties":{"invoice_id":{"description":"ID of an original invoice, not a correction.","format":"uuid","type":"string"}},"required":["invoice_id"],"type":"object"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"The result, as the MCP tool returns it."},"401":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"A valid API key is required."},"403":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The key's role does not allow the operation, or a company key called a personal one."},"422":{"content":{"application/json":{"schema":{"properties":{"error":{"type":"string"},"message":{"type":"string"}},"type":"object"}}},"description":"The operation failed, for example on invalid input; `message` says why."}},"summary":"Suggest sales invoice payments","tags":["Invoicing"]}}},"security":[{"apiKey":[]}],"servers":[{"url":"https://firmowid.pl/api/v1"}]}