{"openapi":"3.1.0","info":{"title":"K-Φ API","version":"1.0.0","description":"Read your K-Φ data (statements, cash, forecasts, scenarios) and save scenarios. The tenant always comes from the credential. Every response is { data, meta }; every error { error: { code, message } }."},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key, OAuth access token, extension key (kphix_…) or extension session token (kxs1.…)"}}},"paths":{"/api/v1/bank_balance_history":{"get":{"operationId":"get_bank_balance_history","summary":"Bank balances over time, per account: one point per day (or the last known balance of each month with granularity month_end), each with its source — reported (what the bank said at a sync), statement ","description":"Bank balances over time, per account: one point per day (or the last known balance of each month with granularity month_end), each with its source — reported (what the bank said at a sync), statement (a statement closing balance) or computed (rebuilt from the transactions). Filter by account, entity, currency and dates (default: the last 90 days). Use for \"how did cash evolve this quarter\", \"what was the balance on 30 June\", \"month-end balances this year\".","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"since","in":"query","required":false,"description":"YYYY-MM-DD, default 90 days before until","schema":{"type":"string"}},{"name":"until","in":"query","required":false,"description":"YYYY-MM-DD, default today","schema":{"type":"string"}},{"name":"granularity","in":"query","required":false,"description":"Default day","schema":{"type":"string"}},{"name":"account","in":"query","required":false,"description":"Bank account name (part of it) or id","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Entity code","schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"description":"ISO code","schema":{"type":"string"}}]},"post":{"operationId":"post_bank_balance_history","summary":"Bank balances over time, per account: one point per day (or the last known balance of each month with granularity month_end), each with its source — reported (what the bank said at a sync), statement ","description":"Bank balances over time, per account: one point per day (or the last known balance of each month with granularity month_end), each with its source — reported (what the bank said at a sync), statement (a statement closing balance) or computed (rebuilt from the transactions). Filter by account, entity, currency and dates (default: the last 90 days). Use for \"how did cash evolve this quarter\", \"what was the balance on 30 June\", \"month-end balances this year\".","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"since":{"type":"string","description":"YYYY-MM-DD, default 90 days before until"},"until":{"type":"string","description":"YYYY-MM-DD, default today"},"granularity":{"type":"string","enum":["day","month_end"],"description":"Default day"},"account":{"type":"string","description":"Bank account name (part of it) or id"},"entity":{"type":"string","description":"Entity code"},"currency":{"type":"string","description":"ISO code"}},"additionalProperties":false}}}}}},"/api/v1/bank_position":{"get":{"operationId":"get_bank_position","summary":"Cash in the bank TODAY, read from the banks themselves (not the accounting): each account with its bank, entity, currency, balance and the date the bank reported it, plus the total per currency","description":"Cash in the bank TODAY, read from the banks themselves (not the accounting): each account with its bank, entity, currency, balance and the date the bank reported it, plus the total per currency. Use for \"how much cash do I have\", \"what is in account X\". Quote the as-of dates: a balance is as fresh as the last bank sync.","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[]},"post":{"operationId":"post_bank_position","summary":"Cash in the bank TODAY, read from the banks themselves (not the accounting): each account with its bank, entity, currency, balance and the date the bank reported it, plus the total per currency","description":"Cash in the bank TODAY, read from the banks themselves (not the accounting): each account with its bank, entity, currency, balance and the date the bank reported it, plus the total per currency. Use for \"how much cash do I have\", \"what is in account X\". Quote the as-of dates: a balance is as fresh as the last bank sync.","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/api/v1/bank_transactions":{"get":{"operationId":"get_bank_transactions","summary":"Bank movements: recent first, or the largest first","description":"Bank movements: recent first, or the largest first. Filter by date, text (description or counterparty), direction (in / out), account (name or id), entity and currency. A since date older than the recent window searches the Banking archive too, so any period the banks have sent can be read. Returns how many movements matched and which window was searched. Use for \"did X pay\", \"what were the big outflows this week\", \"everything on the EUR account in March\".","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"since","in":"query","required":false,"description":"YYYY-MM-DD; older than the recent window = the archive is searched too","schema":{"type":"string"}},{"name":"until","in":"query","required":false,"description":"YYYY-MM-DD, default today","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Text in the description or the counterparty","schema":{"type":"string"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string"}},{"name":"order","in":"query","required":false,"schema":{"type":"string"}},{"name":"account","in":"query","required":false,"description":"Bank account name (part of it) or id","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Entity code","schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"description":"ISO code, e.g. EUR","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1 to 100, default 25","schema":{"type":"number"}}]},"post":{"operationId":"post_bank_transactions","summary":"Bank movements: recent first, or the largest first","description":"Bank movements: recent first, or the largest first. Filter by date, text (description or counterparty), direction (in / out), account (name or id), entity and currency. A since date older than the recent window searches the Banking archive too, so any period the banks have sent can be read. Returns how many movements matched and which window was searched. Use for \"did X pay\", \"what were the big outflows this week\", \"everything on the EUR account in March\".","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"since":{"type":"string","description":"YYYY-MM-DD; older than the recent window = the archive is searched too"},"until":{"type":"string","description":"YYYY-MM-DD, default today"},"search":{"type":"string","description":"Text in the description or the counterparty"},"direction":{"type":"string","enum":["in","out"]},"order":{"type":"string","enum":["recent","largest"]},"account":{"type":"string","description":"Bank account name (part of it) or id"},"entity":{"type":"string","description":"Entity code"},"currency":{"type":"string","description":"ISO code, e.g. EUR"},"limit":{"type":"number","description":"1 to 100, default 25"}},"additionalProperties":false}}}}}},"/api/v1/cash_forecast":{"get":{"operationId":"get_cash_forecast","summary":"K-Φ’s cash forecast as of today: bank balances (actual), the recurring movements history predicts (extrapolated, kept apart), open invoices at their due date and transfers in flight (committed), and t","description":"K-Φ’s cash forecast as of today: bank balances (actual), the recurring movements history predicts (extrapolated, kept apart), open invoices at their due date and transfers in flight (committed), and the FP&A projection by month (planned, net of the invoices due in the month). One line per movement with its source and certainty, a summary per currency (opening, low point and its date, closing, totals by layer), the consumption of the plan by invoices, and an inputs hash: the same data gives the same forecast. Use for \"when do I go under\", \"a 90-day forecast per currency\", \"what is committed vs planned\". Pass extra_lines to add the user’s own movements (a sheet, typed lines).","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"horizon_days","in":"query","required":false,"description":"7 to 365, default 90","schema":{"type":"number"}},{"name":"sources","in":"query","required":false,"description":"Default: all six (typed = the cash forecasts typed or pasted in Banking)","schema":{"type":"string"}},{"name":"extra_lines","in":"query","required":false,"description":"The user’s own movements, added as committed unless a certainty is given","schema":{"type":"string"}},{"name":"max_lines","in":"query","required":false,"description":"Lines returned, 50 to 2000, default 400 (the summary always covers all lines)","schema":{"type":"number"}}]},"post":{"operationId":"post_cash_forecast","summary":"K-Φ’s cash forecast as of today: bank balances (actual), the recurring movements history predicts (extrapolated, kept apart), open invoices at their due date and transfers in flight (committed), and t","description":"K-Φ’s cash forecast as of today: bank balances (actual), the recurring movements history predicts (extrapolated, kept apart), open invoices at their due date and transfers in flight (committed), and the FP&A projection by month (planned, net of the invoices due in the month). One line per movement with its source and certainty, a summary per currency (opening, low point and its date, closing, totals by layer), the consumption of the plan by invoices, and an inputs hash: the same data gives the same forecast. Use for \"when do I go under\", \"a 90-day forecast per currency\", \"what is committed vs planned\". Pass extra_lines to add the user’s own movements (a sheet, typed lines).","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"horizon_days":{"type":"number","description":"7 to 365, default 90"},"sources":{"type":"array","items":{"type":"string","enum":["actual","extrapolation","typed","arap","transfers","fpa"]},"description":"Default: all six (typed = the cash forecasts typed or pasted in Banking)"},"extra_lines":{"type":"array","items":{"type":"object","properties":{"value_date":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"note":{"type":"string"},"certainty":{"type":"string","enum":["committed","planned","extrapolated"]},"account_name":{"type":"string"},"entity":{"type":"string"},"reference":{"type":"string"}},"required":["value_date","amount"]},"description":"The user’s own movements, added as committed unless a certainty is given"},"max_lines":{"type":"number","description":"Lines returned, 50 to 2000, default 400 (the summary always covers all lines)"}},"additionalProperties":false}}}}}},"/api/v1/cash_forecast_lines":{"get":{"operationId":"get_cash_forecast_lines","summary":"Builder Mode: the lines THIS extension put in CASH > Cash forecasts (not a person's, not another extension's)","description":"Builder Mode: the lines THIS extension put in CASH > Cash forecasts (not a person's, not another extension's). Read only.","x-scope":"read:cash","x-extension-only":true,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[]},"post":{"operationId":"post_cash_forecast_lines","summary":"Builder Mode: the lines THIS extension put in CASH > Cash forecasts (not a person's, not another extension's)","description":"Builder Mode: the lines THIS extension put in CASH > Cash forecasts (not a person's, not another extension's). Read only.","x-scope":"read:cash","x-extension-only":true,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/api/v1/cash_forecast_lines_delete":{"post":{"operationId":"post_cash_forecast_lines_delete","summary":"WRITE — Builder Mode: remove lines THIS extension put in CASH > Cash forecasts: the ids given, or all of them without ids","description":"WRITE — Builder Mode: remove lines THIS extension put in CASH > Cash forecasts: the ids given, or all of them without ids. An intercompany pair goes together.","x-scope":"write:cash","x-extension-only":true,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}}}}}},"/api/v1/cash_forecast_lines_put":{"post":{"operationId":"post_cash_forecast_lines_put","summary":"WRITE — Builder Mode: put forecast lines in CASH > Cash forecasts, as committed movements on a bank account and a day","description":"WRITE — Builder Mode: put forecast lines in CASH > Cash forecasts, as committed movements on a bank account and a day. Each row: value_date (YYYY-MM-DD), amount (signed: + in, - out), currency (the account's), account_id (from kphi_bank_position); optional description, reference, third_party, third_entity (a group company: the mirror line is created on its default account), recur_freq (weekly | monthly | quarterly | yearly) with recur_until. All or nothing: one bad row saves nothing and says which and why. replace: true first removes every line this extension put there before (a forecast that is recomputed). The Cash worksheet, the CASH forecast and Claude read the lines at once.","x-scope":"write:cash","x-extension-only":true,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","description":"Up to 2000 lines","items":{"type":"object","properties":{"value_date":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"account_id":{"type":"string"},"description":{"type":"string"},"reference":{"type":"string"},"third_party":{"type":"string"},"third_entity":{"type":"string"},"recur_freq":{"type":"string","enum":["weekly","monthly","quarterly","yearly"]},"recur_until":{"type":"string"}},"required":["value_date","amount","currency","account_id"]}},"replace":{"type":"boolean","description":"Remove this extension's previous lines first"}},"required":["rows"],"additionalProperties":false}}}}}},"/api/v1/cash_low_point":{"get":{"operationId":"get_cash_low_point","summary":"The short-term cash position: per currency, the opening balance, the LOWEST projected closing balance over the horizon and its date, and the accounts expected to go negative","description":"The short-term cash position: per currency, the opening balance, the LOWEST projected closing balance over the horizon and its date, and the accounts expected to go negative. Built from real bank balances plus the recurring movements learned from bank history. Use for \"when do I go under\", \"will I be short next month\". Say which layers it includes (it does not include committed items or the plan yet).","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"days","in":"query","required":false,"description":"Horizon in days, 7 to 120, default 28","schema":{"type":"number"}}]},"post":{"operationId":"post_cash_low_point","summary":"The short-term cash position: per currency, the opening balance, the LOWEST projected closing balance over the horizon and its date, and the accounts expected to go negative","description":"The short-term cash position: per currency, the opening balance, the LOWEST projected closing balance over the horizon and its date, and the accounts expected to go negative. Built from real bank balances plus the recurring movements learned from bank history. Use for \"when do I go under\", \"will I be short next month\". Say which layers it includes (it does not include committed items or the plan yet).","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"number","description":"Horizon in days, 7 to 120, default 28"}},"additionalProperties":false}}}}}},"/api/v1/explain_gap":{"get":{"operationId":"get_explain_gap","summary":"Reconcile the direct method (treasury forecast) against the indirect method (derived from the GL), cell by cell over spine x entity x period","description":"Reconcile the direct method (treasury forecast) against the indirect method (derived from the GL), cell by cell over spine x entity x period. This is the thing no ERP or TMS can produce, because neither holds both methods in one grid. It REFUSES to answer when the inputs are not comparable — mixed FX bases, more than one GL version, or only one method present — because a reconciliation whose number cannot be trusted is worse than none. Provable layers are peeled deterministically; narrate only the residual.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"tolerance","in":"query","required":false,"description":"Absolute amount within which a cell is considered to tie. Default 1.","schema":{"type":"number"}},{"name":"layers","in":"query","required":false,"description":"Optional spine -> layer name map. An explained difference becomes a named layer instead of counting as a failure to reconcile.","schema":{"type":"string"}}]},"post":{"operationId":"post_explain_gap","summary":"Reconcile the direct method (treasury forecast) against the indirect method (derived from the GL), cell by cell over spine x entity x period","description":"Reconcile the direct method (treasury forecast) against the indirect method (derived from the GL), cell by cell over spine x entity x period. This is the thing no ERP or TMS can produce, because neither holds both methods in one grid. It REFUSES to answer when the inputs are not comparable — mixed FX bases, more than one GL version, or only one method present — because a reconciliation whose number cannot be trusted is worse than none. Provable layers are peeled deterministically; narrate only the residual.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"tolerance":{"type":"number","description":"Absolute amount within which a cell is considered to tie. Default 1."},"layers":{"type":"object","description":"Optional spine -> layer name map. An explained difference becomes a named layer instead of counting as a failure to reconcile."}},"additionalProperties":false}}}}}},"/api/v1/ext_code_list":{"get":{"operationId":"get_ext_code_list","summary":"Builder Mode: list the files of one of this account's extensions (its repository, deployed branch)","description":"Builder Mode: list the files of one of this account's extensions (its repository, deployed branch). Without extension_id, lists the account's extensions. Read CLAUDE.md in the repository first: it holds the rules every extension follows (data only from the K-Φ API, never a key in the browser or in the code, figures shown as K-Φ gives them).","x-scope":"read:code","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"extension_id","in":"query","required":false,"description":"The extension (see kphi_ext_code_list without arguments). An extension key reaches its own extension and may omit it.","schema":{"type":"string"}}]},"post":{"operationId":"post_ext_code_list","summary":"Builder Mode: list the files of one of this account's extensions (its repository, deployed branch)","description":"Builder Mode: list the files of one of this account's extensions (its repository, deployed branch). Without extension_id, lists the account's extensions. Read CLAUDE.md in the repository first: it holds the rules every extension follows (data only from the K-Φ API, never a key in the browser or in the code, figures shown as K-Φ gives them).","x-scope":"read:code","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"extension_id":{"type":"string","description":"The extension (see kphi_ext_code_list without arguments). An extension key reaches its own extension and may omit it."}}}}}}}},"/api/v1/ext_code_read":{"get":{"operationId":"get_ext_code_read","summary":"Builder Mode: read one file of an extension (deployed branch).","description":"Builder Mode: read one file of an extension (deployed branch).","x-scope":"read:code","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"extension_id","in":"query","required":false,"description":"The extension (see kphi_ext_code_list without arguments). An extension key reaches its own extension and may omit it.","schema":{"type":"string"}},{"name":"path","in":"query","required":false,"description":"File path in the repository, e.g. public/app.js","schema":{"type":"string"}}]},"post":{"operationId":"post_ext_code_read","summary":"Builder Mode: read one file of an extension (deployed branch).","description":"Builder Mode: read one file of an extension (deployed branch).","x-scope":"read:code","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"extension_id":{"type":"string","description":"The extension (see kphi_ext_code_list without arguments). An extension key reaches its own extension and may omit it."},"path":{"type":"string","description":"File path in the repository, e.g. public/app.js"}},"required":["path"]}}}}}},"/api/v1/ext_deploy":{"post":{"operationId":"post_ext_deploy","summary":"WRITE — Builder Mode: deploy code to an extension","description":"WRITE — Builder Mode: deploy code to an extension. K-Φ commits the files to the extension repository in ONE commit (full file contents, not diffs) and the extension service redeploys from it. Send only the files that change; remove lists paths to delete. Refused: .git/ and .github/, paths with .., files over 512 KB, more than 100 files or 3 MB, and any file carrying a key or token (keys live in the Render environment). Needs the write:code scope and an owner or admin (or the extension's own key). Tell the user what changed in their BUILD workspace (menu entries, pages), never a link, a repository or a commit.","x-scope":"write:code","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"extension_id":{"type":"string","description":"The extension (see kphi_ext_code_list without arguments). An extension key reaches its own extension and may omit it."},"message":{"type":"string","description":"What changed, in one line (the commit message)."},"files":{"type":"array","description":"Files to write: [{ path, content, encoding }] — encoding \"utf-8\" (default) or \"base64\" for binary.","items":{"type":"object","properties":{"path":{"type":"string"},"content":{"type":"string"},"encoding":{"type":"string","enum":["utf-8","base64"]}},"required":["path","content"]}},"remove":{"type":"array","description":"Paths to delete.","items":{"type":"string"}}},"required":["message"]}}}}}},"/api/v1/ext_restore":{"post":{"operationId":"post_ext_restore","summary":"WRITE — Builder Mode: put an extension back to an earlier version (from kphi_ext_versions)","description":"WRITE — Builder Mode: put an extension back to an earlier version (from kphi_ext_versions). K-Φ makes a NEW version with exactly the files of that one and the service redeploys; nothing is erased, so a restore can be undone the same way. Confirm with the user which version first. Needs the write:code scope and a builder (or the extension's own key).","x-scope":"write:code","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"extension_id":{"type":"string","description":"The extension (see kphi_ext_code_list without arguments). An extension key reaches its own extension and may omit it."},"version":{"type":"string","description":"The version to go back to (7 characters, from kphi_ext_versions)."}},"required":["version"]}}}}}},"/api/v1/ext_versions":{"get":{"operationId":"get_ext_versions","summary":"Builder Mode: the versions of an extension, newest first (each deploy is one version): version, what changed, who, when","description":"Builder Mode: the versions of an extension, newest first (each deploy is one version): version, what changed, who, when. Use it when the user wants to go back to an earlier state of their BUILD, then kphi_ext_restore.","x-scope":"read:code","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"extension_id","in":"query","required":false,"description":"The extension (see kphi_ext_code_list without arguments). An extension key reaches its own extension and may omit it.","schema":{"type":"string"}}]},"post":{"operationId":"post_ext_versions","summary":"Builder Mode: the versions of an extension, newest first (each deploy is one version): version, what changed, who, when","description":"Builder Mode: the versions of an extension, newest first (each deploy is one version): version, what changed, who, when. Use it when the user wants to go back to an earlier state of their BUILD, then kphi_ext_restore.","x-scope":"read:code","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"extension_id":{"type":"string","description":"The extension (see kphi_ext_code_list without arguments). An extension key reaches its own extension and may omit it."}}}}}}}},"/api/v1/get_balance_sheet":{"get":{"operationId":"get_get_balance_sheet","summary":"Get the balance sheet computed by the K-Φ engine (assets, liabilities, equity by category with per-account detail lines)","description":"Get the balance sheet computed by the K-Φ engine (assets, liabilities, equity by category with per-account detail lines). The B/S is a snapshot of the latest period in scope. Set summary_only=true to get section totals without per-account lines.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"version","in":"query","required":false,"description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version.","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Filter to a single entity code. Omit for consolidated view across all entities.","schema":{"type":"string"}},{"name":"bu","in":"query","required":false,"description":"Filter to a single business unit. Omit for all BUs.","schema":{"type":"string"}},{"name":"summary_only","in":"query","required":false,"description":"If true, return only section/total rows (cat set), skipping per-account detail.","schema":{"type":"boolean"}}]},"post":{"operationId":"post_get_balance_sheet","summary":"Get the balance sheet computed by the K-Φ engine (assets, liabilities, equity by category with per-account detail lines)","description":"Get the balance sheet computed by the K-Φ engine (assets, liabilities, equity by category with per-account detail lines). The B/S is a snapshot of the latest period in scope. Set summary_only=true to get section totals without per-account lines.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."},"period":{"type":"string","description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version."},"entity":{"type":"string","description":"Filter to a single entity code. Omit for consolidated view across all entities."},"bu":{"type":"string","description":"Filter to a single business unit. Omit for all BUs."},"summary_only":{"type":"boolean","description":"If true, return only section/total rows (cat set), skipping per-account detail."}},"additionalProperties":false}}}}}},"/api/v1/get_budgets":{"get":{"operationId":"get_get_budgets","summary":"List the budget scenarios defined in this tenant (name, year, workflow status, pinned actuals version)","description":"List the budget scenarios defined in this tenant (name, year, workflow status, pinned actuals version). Pass budget_id with include_drivers=true to get the full driver grid (driver → entity → period → value) of one scenario.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"budget_id","in":"query","required":false,"description":"Scenario id. Omit to list all scenarios.","schema":{"type":"string"}},{"name":"include_drivers","in":"query","required":false,"description":"If true (and budget_id given), include the full driver value grid.","schema":{"type":"boolean"}}]},"post":{"operationId":"post_get_budgets","summary":"List the budget scenarios defined in this tenant (name, year, workflow status, pinned actuals version)","description":"List the budget scenarios defined in this tenant (name, year, workflow status, pinned actuals version). Pass budget_id with include_drivers=true to get the full driver grid (driver → entity → period → value) of one scenario.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"budget_id":{"type":"string","description":"Scenario id. Omit to list all scenarios."},"include_drivers":{"type":"boolean","description":"If true (and budget_id given), include the full driver value grid."}},"additionalProperties":false}}}}}},"/api/v1/get_cash_flow":{"get":{"operationId":"get_get_cash_flow","summary":"Get the cash flow statement computed by the K-Φ engine (indirect method: operating / investing / financing sections per period, plus direct-method view, net change, opening/closing cash and a balance ","description":"Get the cash flow statement computed by the K-Φ engine (indirect method: operating / investing / financing sections per period, plus direct-method view, net change, opening/closing cash and a balance check). Requires at least two periods in scope (cash flow = delta between balance sheets).","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"version","in":"query","required":false,"description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version.","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Filter to a single entity code. Omit for consolidated view across all entities.","schema":{"type":"string"}},{"name":"bu","in":"query","required":false,"description":"Filter to a single business unit. Omit for all BUs.","schema":{"type":"string"}}]},"post":{"operationId":"post_get_cash_flow","summary":"Get the cash flow statement computed by the K-Φ engine (indirect method: operating / investing / financing sections per period, plus direct-method view, net change, opening/closing cash and a balance ","description":"Get the cash flow statement computed by the K-Φ engine (indirect method: operating / investing / financing sections per period, plus direct-method view, net change, opening/closing cash and a balance check). Requires at least two periods in scope (cash flow = delta between balance sheets).","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."},"period":{"type":"string","description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version."},"entity":{"type":"string","description":"Filter to a single entity code. Omit for consolidated view across all entities."},"bu":{"type":"string","description":"Filter to a single business unit. Omit for all BUs."}},"additionalProperties":false}}}}}},"/api/v1/get_forecast":{"get":{"operationId":"get_get_forecast","summary":"Get the K-Φ cash forecast projection: per-period sales, AR collections, AP payments, payroll, opex, tax, capex, debt service, scheduled flows, net flow and closing cash — driven by the tenant's config","description":"Get the K-Φ cash forecast projection: per-period sales, AR collections, AP payments, payroll, opex, tax, capex, debt service, scheduled flows, net flow and closing cash — driven by the tenant's configured flow rules (DSO/DPO timing, schedules). If no flow rules are configured, returns a blocked envelope explaining what is missing instead of fabricating numbers.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"version","in":"query","required":false,"description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version.","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Filter to a single entity code. Omit for consolidated view across all entities.","schema":{"type":"string"}},{"name":"bu","in":"query","required":false,"description":"Filter to a single business unit. Omit for all BUs.","schema":{"type":"string"}},{"name":"horizon","in":"query","required":false,"description":"Projection horizon in months (1-24, default 12).","schema":{"type":"integer"}}]},"post":{"operationId":"post_get_forecast","summary":"Get the K-Φ cash forecast projection: per-period sales, AR collections, AP payments, payroll, opex, tax, capex, debt service, scheduled flows, net flow and closing cash — driven by the tenant's config","description":"Get the K-Φ cash forecast projection: per-period sales, AR collections, AP payments, payroll, opex, tax, capex, debt service, scheduled flows, net flow and closing cash — driven by the tenant's configured flow rules (DSO/DPO timing, schedules). If no flow rules are configured, returns a blocked envelope explaining what is missing instead of fabricating numbers.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."},"period":{"type":"string","description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version."},"entity":{"type":"string","description":"Filter to a single entity code. Omit for consolidated view across all entities."},"bu":{"type":"string","description":"Filter to a single business unit. Omit for all BUs."},"horizon":{"type":"integer","description":"Projection horizon in months (1-24, default 12)."}},"additionalProperties":false}}}}}},"/api/v1/get_forecast_list":{"get":{"operationId":"get_get_forecast_list","summary":"Get the tenant Forecast List (flow preview): the staged forecast entries with plan name, entity, budget code, lever, amount, currency, due date and status — plus the live budget-code mapping (lever ty","description":"Get the tenant Forecast List (flow preview): the staged forecast entries with plan name, entity, budget code, lever, amount, currency, due date and status — plus the live budget-code mapping (lever type → budget code) used to generate them.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"source","in":"query","required":false,"description":"Filter by entry source. Default \"all\".","schema":{"type":"string"}}]},"post":{"operationId":"post_get_forecast_list","summary":"Get the tenant Forecast List (flow preview): the staged forecast entries with plan name, entity, budget code, lever, amount, currency, due date and status — plus the live budget-code mapping (lever ty","description":"Get the tenant Forecast List (flow preview): the staged forecast entries with plan name, entity, budget code, lever, amount, currency, due date and status — plus the live budget-code mapping (lever type → budget code) used to generate them.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["all","scenario","forecast","budget"],"description":"Filter by entry source. Default \"all\"."}},"additionalProperties":false}}}}}},"/api/v1/get_fpa_settings":{"get":{"operationId":"get_get_fpa_settings","summary":"The FP&A settings the figures are built on, as the tenant stored them: group structure (entities, holdings, reporting currency), period and fiscal-year close, trading partners, calendar, cost allocati","description":"The FP&A settings the figures are built on, as the tenant stored them: group structure (entities, holdings, reporting currency), period and fiscal-year close, trading partners, calendar, cost allocation, aging profiles. Pass keys to get only some; omit to get every one that is set. A key that was never set is listed under \"not_set\". Read-only. FX rates have their own tool (kphi_get_fx_rates).","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"keys","in":"query","required":false,"description":"Settings to return: group_struct = Group structure: holdings (entity, parent, ownership %), intercompany accounts, reporting (consolidation) currency; closed_fys = Closed fiscal years; fclose_data = Period close: status and checklist per period; tp_groups = Trading-partner groups; tp_rules = Trading-partner matching rules; tp_breakdown = Trading-partner breakdown settings; cal_custom = Custom calendar: fiscal-year start, holidays, payment days; alloc_rules = Cost-allocation rules; aging_profiles = Aging profiles: how receivables and payables age.","schema":{"type":"string"}}]},"post":{"operationId":"post_get_fpa_settings","summary":"The FP&A settings the figures are built on, as the tenant stored them: group structure (entities, holdings, reporting currency), period and fiscal-year close, trading partners, calendar, cost allocati","description":"The FP&A settings the figures are built on, as the tenant stored them: group structure (entities, holdings, reporting currency), period and fiscal-year close, trading partners, calendar, cost allocation, aging profiles. Pass keys to get only some; omit to get every one that is set. A key that was never set is listed under \"not_set\". Read-only. FX rates have their own tool (kphi_get_fx_rates).","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"string","enum":["group_struct","closed_fys","fclose_data","tp_groups","tp_rules","tp_breakdown","cal_custom","alloc_rules","aging_profiles"]},"description":"Settings to return: group_struct = Group structure: holdings (entity, parent, ownership %), intercompany accounts, reporting (consolidation) currency; closed_fys = Closed fiscal years; fclose_data = Period close: status and checklist per period; tp_groups = Trading-partner groups; tp_rules = Trading-partner matching rules; tp_breakdown = Trading-partner breakdown settings; cal_custom = Custom calendar: fiscal-year start, holidays, payment days; alloc_rules = Cost-allocation rules; aging_profiles = Aging profiles: how receivables and payables age."}},"additionalProperties":false}}}}}},"/api/v1/get_fx_rates":{"get":{"operationId":"get_get_fx_rates","summary":"The tenant's FX rate table as maintained in FP&A: for each currency pair (\"EUR>USD\" converts EUR into USD), the closing, average and historical rate per month","description":"The tenant's FX rate table as maintained in FP&A: for each currency pair (\"EUR>USD\" converts EUR into USD), the closing, average and historical rate per month. Also returns the group reporting currency. Filter by currency (from, to), by month range (period_from, period_to, YYYY-MM) and by rate_type. Read-only; rates are returned exactly as stored, never fetched live or inferred. If no rates have been entered it says so instead of returning defaults.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"from","in":"query","required":false,"description":"Source currency, ISO code, e.g. \"EUR\". Omit for all.","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"Target currency, ISO code, e.g. \"USD\". Omit for all.","schema":{"type":"string"}},{"name":"period_from","in":"query","required":false,"description":"First month to return, YYYY-MM.","schema":{"type":"string"}},{"name":"period_to","in":"query","required":false,"description":"Last month to return, YYYY-MM.","schema":{"type":"string"}},{"name":"rate_type","in":"query","required":false,"description":"Return only this rate type. Omit for all three.","schema":{"type":"string"}}]},"post":{"operationId":"post_get_fx_rates","summary":"The tenant's FX rate table as maintained in FP&A: for each currency pair (\"EUR>USD\" converts EUR into USD), the closing, average and historical rate per month","description":"The tenant's FX rate table as maintained in FP&A: for each currency pair (\"EUR>USD\" converts EUR into USD), the closing, average and historical rate per month. Also returns the group reporting currency. Filter by currency (from, to), by month range (period_from, period_to, YYYY-MM) and by rate_type. Read-only; rates are returned exactly as stored, never fetched live or inferred. If no rates have been entered it says so instead of returning defaults.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","description":"Source currency, ISO code, e.g. \"EUR\". Omit for all."},"to":{"type":"string","description":"Target currency, ISO code, e.g. \"USD\". Omit for all."},"period_from":{"type":"string","description":"First month to return, YYYY-MM."},"period_to":{"type":"string","description":"Last month to return, YYYY-MM."},"rate_type":{"type":"string","enum":["closing","average","historical"],"description":"Return only this rate type. Omit for all three."}},"additionalProperties":false}}}}}},"/api/v1/get_kpis":{"get":{"operationId":"get_get_kpis","summary":"Get headline financial KPIs from the tenant general ledger via the K-Φ engine","description":"Get headline financial KPIs from the tenant general ledger via the K-Φ engine. Returns net revenue, gross profit, EBITDA, net income, total assets/liabilities/equity, plus a financial-sanity warnings array. Engine runs the same code as the K-Φ web app, including French PCG classification and balance-sheet identity checks.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"version","in":"query","required":false,"description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version.","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Filter to a single entity code. Omit for consolidated view across all entities.","schema":{"type":"string"}},{"name":"bu","in":"query","required":false,"description":"Filter to a single business unit. Omit for all BUs.","schema":{"type":"string"}}]},"post":{"operationId":"post_get_kpis","summary":"Get headline financial KPIs from the tenant general ledger via the K-Φ engine","description":"Get headline financial KPIs from the tenant general ledger via the K-Φ engine. Returns net revenue, gross profit, EBITDA, net income, total assets/liabilities/equity, plus a financial-sanity warnings array. Engine runs the same code as the K-Φ web app, including French PCG classification and balance-sheet identity checks.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."},"period":{"type":"string","description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version."},"entity":{"type":"string","description":"Filter to a single entity code. Omit for consolidated view across all entities."},"bu":{"type":"string","description":"Filter to a single business unit. Omit for all BUs."}},"additionalProperties":false}}}}}},"/api/v1/get_pl":{"get":{"operationId":"get_get_pl","summary":"Get the profit & loss statement computed by the K-Φ engine (revenue, COGS, gross profit, opex, EBITDA, D&A, operating income, tax, net income — with margins and per-account detail)","description":"Get the profit & loss statement computed by the K-Φ engine (revenue, COGS, gross profit, opex, EBITDA, D&A, operating income, tax, net income — with margins and per-account detail). P&L is cumulative across all periods in scope. Set summary_only=true for section totals only.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"version","in":"query","required":false,"description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version.","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Filter to a single entity code. Omit for consolidated view across all entities.","schema":{"type":"string"}},{"name":"bu","in":"query","required":false,"description":"Filter to a single business unit. Omit for all BUs.","schema":{"type":"string"}},{"name":"summary_only","in":"query","required":false,"description":"If true, return only section/total rows, skipping per-account detail.","schema":{"type":"boolean"}}]},"post":{"operationId":"post_get_pl","summary":"Get the profit & loss statement computed by the K-Φ engine (revenue, COGS, gross profit, opex, EBITDA, D&A, operating income, tax, net income — with margins and per-account detail)","description":"Get the profit & loss statement computed by the K-Φ engine (revenue, COGS, gross profit, opex, EBITDA, D&A, operating income, tax, net income — with margins and per-account detail). P&L is cumulative across all periods in scope. Set summary_only=true for section totals only.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."},"period":{"type":"string","description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version."},"entity":{"type":"string","description":"Filter to a single entity code. Omit for consolidated view across all entities."},"bu":{"type":"string","description":"Filter to a single business unit. Omit for all BUs."},"summary_only":{"type":"boolean","description":"If true, return only section/total rows, skipping per-account detail."}},"additionalProperties":false}}}}}},"/api/v1/get_ratios":{"get":{"operationId":"get_get_ratios","summary":"Get the full financial ratio panel computed by the K-Φ engine: liquidity (current/quick/cash ratio, working capital), working-capital days (DSO/DPO/DIO/CCC with per-entity and per-BU breakdowns), marg","description":"Get the full financial ratio panel computed by the K-Φ engine: liquidity (current/quick/cash ratio, working capital), working-capital days (DSO/DPO/DIO/CCC with per-entity and per-BU breakdowns), margins, returns (ROA/ROE/ROIC), turnover, leverage (debt/equity, debt/EBITDA, interest coverage, DSCR) and a free-cash-flow proxy.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"version","in":"query","required":false,"description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version.","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Filter to a single entity code. Omit for consolidated view across all entities.","schema":{"type":"string"}},{"name":"bu","in":"query","required":false,"description":"Filter to a single business unit. Omit for all BUs.","schema":{"type":"string"}}]},"post":{"operationId":"post_get_ratios","summary":"Get the full financial ratio panel computed by the K-Φ engine: liquidity (current/quick/cash ratio, working capital), working-capital days (DSO/DPO/DIO/CCC with per-entity and per-BU breakdowns), marg","description":"Get the full financial ratio panel computed by the K-Φ engine: liquidity (current/quick/cash ratio, working capital), working-capital days (DSO/DPO/DIO/CCC with per-entity and per-BU breakdowns), margins, returns (ROA/ROE/ROIC), turnover, leverage (debt/equity, debt/EBITDA, interest coverage, DSCR) and a free-cash-flow proxy.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."},"period":{"type":"string","description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version."},"entity":{"type":"string","description":"Filter to a single entity code. Omit for consolidated view across all entities."},"bu":{"type":"string","description":"Filter to a single business unit. Omit for all BUs."}},"additionalProperties":false}}}}}},"/api/v1/get_valuation":{"get":{"operationId":"get_get_valuation","summary":"Get a company valuation: the reconciled equity value WITH its range, the value by method (DCF, comparables) and their weights, enterprise value, net debt, WACC, the key assumptions with where each cam","description":"Get a company valuation: the reconciled equity value WITH its range, the value by method (DCF, comparables) and their weights, enterprise value, net debt, WACC, the key assumptions with where each came from (the ledger, measured from invoices and bank, a market dataset, or typed by the user), warnings, and a quality block. Always quote the range with the value, name assumed inputs, and never present the result as a certified valuation.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"case_id","in":"query","required":false,"description":"The valuation case id, from kphi_list_valuations.","schema":{"type":"string"}}]},"post":{"operationId":"post_get_valuation","summary":"Get a company valuation: the reconciled equity value WITH its range, the value by method (DCF, comparables) and their weights, enterprise value, net debt, WACC, the key assumptions with where each cam","description":"Get a company valuation: the reconciled equity value WITH its range, the value by method (DCF, comparables) and their weights, enterprise value, net debt, WACC, the key assumptions with where each came from (the ledger, measured from invoices and bank, a market dataset, or typed by the user), warnings, and a quality block. Always quote the range with the value, name assumed inputs, and never present the result as a certified valuation.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"case_id":{"type":"string","description":"The valuation case id, from kphi_list_valuations."}},"required":["case_id"],"additionalProperties":false}}}}}},"/api/v1/get_variance":{"get":{"operationId":"get_get_variance","summary":"Compute budget vs actuals variance through the K-Φ budget engine: per-period and annual P&L lines (revenue, COGS, gross profit, personnel, opex, EBITDA, tax, net income) with actual, budget, variance ","description":"Compute budget vs actuals variance through the K-Φ budget engine: per-period and annual P&L lines (revenue, COGS, gross profit, personnel, opex, EBITDA, tax, net income) with actual, budget, variance and variance %. Uses a budget scenario's driver model converted to P&L — the same computation as the Variance Analysis screen.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"budget_id","in":"query","required":false,"description":"Budget scenario id (see kphi_get_budgets). Omit to use the most recent scenario.","schema":{"type":"string"}},{"name":"version","in":"query","required":false,"description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Filter both sides to one entity. Omit for the consolidated total.","schema":{"type":"string"}}]},"post":{"operationId":"post_get_variance","summary":"Compute budget vs actuals variance through the K-Φ budget engine: per-period and annual P&L lines (revenue, COGS, gross profit, personnel, opex, EBITDA, tax, net income) with actual, budget, variance ","description":"Compute budget vs actuals variance through the K-Φ budget engine: per-period and annual P&L lines (revenue, COGS, gross profit, personnel, opex, EBITDA, tax, net income) with actual, budget, variance and variance %. Uses a budget scenario's driver model converted to P&L — the same computation as the Variance Analysis screen.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"budget_id":{"type":"string","description":"Budget scenario id (see kphi_get_budgets). Omit to use the most recent scenario."},"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."},"entity":{"type":"string","description":"Filter both sides to one entity. Omit for the consolidated total."}},"additionalProperties":false}}}}}},"/api/v1/lake_health":{"get":{"operationId":"get_lake_health","summary":"Report the state of the canonical data lake BEFORE querying it: which methods are present (direct from a treasury forecast, indirect derived from the GL), the period grains, the FX bases, the GL versi","description":"Report the state of the canonical data lake BEFORE querying it: which methods are present (direct from a treasury forecast, indirect derived from the GL), the period grains, the FX bases, the GL versions, and how many lines carry an undeclared spine. Call this first. It tells you what the lake CANNOT answer as well as what it can — an aggregate that mixes FX bases, grains or GL versions is not a total, and a reconciliation needs both methods.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[]},"post":{"operationId":"post_lake_health","summary":"Report the state of the canonical data lake BEFORE querying it: which methods are present (direct from a treasury forecast, indirect derived from the GL), the period grains, the FX bases, the GL versi","description":"Report the state of the canonical data lake BEFORE querying it: which methods are present (direct from a treasury forecast, indirect derived from the GL), the period grains, the FX bases, the GL versions, and how many lines carry an undeclared spine. Call this first. It tells you what the lake CANNOT answer as well as what it can — an aggregate that mixes FX bases, grains or GL versions is not a total, and a reconciliation needs both methods.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/api/v1/list_accounts":{"get":{"operationId":"get_list_accounts","summary":"List the chart of accounts as used in a GL version: distinct account numbers with their most common description and total debit/credit movement","description":"List the chart of accounts as used in a GL version: distinct account numbers with their most common description and total debit/credit movement. Optionally filter by account prefix.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"version","in":"query","required":false,"description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.","schema":{"type":"string"}},{"name":"acct_prefix","in":"query","required":false,"description":"Account number prefix filter, e.g. \"6\" for all PCG expense accounts.","schema":{"type":"string"}}]},"post":{"operationId":"post_list_accounts","summary":"List the chart of accounts as used in a GL version: distinct account numbers with their most common description and total debit/credit movement","description":"List the chart of accounts as used in a GL version: distinct account numbers with their most common description and total debit/credit movement. Optionally filter by account prefix.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."},"acct_prefix":{"type":"string","description":"Account number prefix filter, e.g. \"6\" for all PCG expense accounts."}},"additionalProperties":false}}}}}},"/api/v1/list_dimensions":{"get":{"operationId":"get_list_dimensions","summary":"List the analytical dimensions present in a GL version: distinct entities, business units and periods, each with entry counts","description":"List the analytical dimensions present in a GL version: distinct entities, business units and periods, each with entry counts. Use this to discover valid filter values for the other tools.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"version","in":"query","required":false,"description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.","schema":{"type":"string"}}]},"post":{"operationId":"post_list_dimensions","summary":"List the analytical dimensions present in a GL version: distinct entities, business units and periods, each with entry counts","description":"List the analytical dimensions present in a GL version: distinct entities, business units and periods, each with entry counts. Use this to discover valid filter values for the other tools.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."}},"additionalProperties":false}}}}}},"/api/v1/list_scenarios":{"get":{"operationId":"get_list_scenarios","summary":"List the scenarios saved in K-Φ (the Simulation page's scenarios): id, name, created date and their levers","description":"List the scenarios saved in K-Φ (the Simulation page's scenarios): id, name, created date and their levers. Run one with kphi_run_scenario({ scenario_id }).","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[]},"post":{"operationId":"post_list_scenarios","summary":"List the scenarios saved in K-Φ (the Simulation page's scenarios): id, name, created date and their levers","description":"List the scenarios saved in K-Φ (the Simulation page's scenarios): id, name, created date and their levers. Run one with kphi_run_scenario({ scenario_id }).","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/api/v1/list_valuations":{"get":{"operationId":"get_list_valuations","summary":"List the company valuation cases of this account: name, valuation date, currency, status (draft or locked), and whether each has been computed","description":"List the company valuation cases of this account: name, valuation date, currency, status (draft or locked), and whether each has been computed. Use the case_id with the other valuation tools. Requires the Valuation add-on to be enabled for the account.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[]},"post":{"operationId":"post_list_valuations","summary":"List the company valuation cases of this account: name, valuation date, currency, status (draft or locked), and whether each has been computed","description":"List the company valuation cases of this account: name, valuation date, currency, status (draft or locked), and whether each has been computed. Use the case_id with the other valuation tools. Requires the Valuation add-on to be enabled for the account.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/api/v1/list_versions":{"get":{"operationId":"get_list_versions","summary":"List all GL versions (data vintages) loaded in this tenant: label, value date, entry count, type (ACTUALS/BUDGET) and status (draft/locked/approved)","description":"List all GL versions (data vintages) loaded in this tenant: label, value date, entry count, type (ACTUALS/BUDGET) and status (draft/locked/approved). latest_revision_of_period marks the newest revision of EACH period (so several versions carry it); newest marks the single most recent one. Use this first, and when more than one version is current, ask the user which one to use: the other tools require version then.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[]},"post":{"operationId":"post_list_versions","summary":"List all GL versions (data vintages) loaded in this tenant: label, value date, entry count, type (ACTUALS/BUDGET) and status (draft/locked/approved)","description":"List all GL versions (data vintages) loaded in this tenant: label, value date, entry count, type (ACTUALS/BUDGET) and status (draft/locked/approved). latest_revision_of_period marks the newest revision of EACH period (so several versions carry it); newest marks the single most recent one. Use this first, and when more than one version is current, ask the user which one to use: the other tools require version then.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/api/v1/open_invoices":{"get":{"operationId":"get_open_invoices","summary":"Invoices, receivables (AR, default), payables (AP) or both","description":"Invoices, receivables (AR, default), payables (AP) or both. By default the OPEN ones with their aging per currency (not due, 1-30, 31-60, 61-90, over 90 days) and the counterparties with the most overdue. With status paid or all, or a date range (by issue or due date), it lists every matching invoice with totals per currency (amount and still open). Filter by entity, counterparty or invoice number (the number gives that invoice’s detail). Use for \"who owes me money\", \"what is overdue\", \"what did customer X pay this year\", \"invoices issued in March\", \"show invoice 1042\".","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"direction","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Default open","schema":{"type":"string"}},{"name":"overdue_only","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"from","in":"query","required":false,"description":"YYYY-MM-DD","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"YYYY-MM-DD","schema":{"type":"string"}},{"name":"date_field","in":"query","required":false,"description":"Which date from / to apply to; default issue","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Entity code","schema":{"type":"string"}},{"name":"counterparty","in":"query","required":false,"description":"Customer or supplier name (part of it) or code","schema":{"type":"string"}},{"name":"number","in":"query","required":false,"description":"An invoice number: that invoice only","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1 to 100, default 25","schema":{"type":"number"}}]},"post":{"operationId":"post_open_invoices","summary":"Invoices, receivables (AR, default), payables (AP) or both","description":"Invoices, receivables (AR, default), payables (AP) or both. By default the OPEN ones with their aging per currency (not due, 1-30, 31-60, 61-90, over 90 days) and the counterparties with the most overdue. With status paid or all, or a date range (by issue or due date), it lists every matching invoice with totals per currency (amount and still open). Filter by entity, counterparty or invoice number (the number gives that invoice’s detail). Use for \"who owes me money\", \"what is overdue\", \"what did customer X pay this year\", \"invoices issued in March\", \"show invoice 1042\".","x-scope":"read:cash","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"direction":{"type":"string","enum":["AR","AP","both"]},"status":{"type":"string","enum":["open","paid","all"],"description":"Default open"},"overdue_only":{"type":"boolean"},"from":{"type":"string","description":"YYYY-MM-DD"},"to":{"type":"string","description":"YYYY-MM-DD"},"date_field":{"type":"string","enum":["issue","due"],"description":"Which date from / to apply to; default issue"},"entity":{"type":"string","description":"Entity code"},"counterparty":{"type":"string","description":"Customer or supplier name (part of it) or code"},"number":{"type":"string","description":"An invoice number: that invoice only"},"limit":{"type":"number","description":"1 to 100, default 25"}},"additionalProperties":false}}}}}},"/api/v1/query_gl":{"get":{"operationId":"get_query_gl","summary":"Query raw general-ledger entries with filters: version, period, entity, business unit, account prefix (e.g","description":"Query raw general-ledger entries with filters: version, period, entity, business unit, account prefix (e.g. \"411\" for all AR accounts under French PCG), and free-text search on the entry description. Returns matching rows (capped by limit, default 100, max 500) plus aggregates (total count, sum of debits and credits) computed over ALL matches, not just the returned page.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"version","in":"query","required":false,"description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version.","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Filter to a single entity code. Omit for consolidated view across all entities.","schema":{"type":"string"}},{"name":"bu","in":"query","required":false,"description":"Filter to a single business unit. Omit for all BUs.","schema":{"type":"string"}},{"name":"acct_prefix","in":"query","required":false,"description":"Account number prefix filter, e.g. \"411\" or \"70\".","schema":{"type":"string"}},{"name":"search","in":"query","required":false,"description":"Case-insensitive substring match on the entry description.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Max rows to return (default 100, max 500).","schema":{"type":"integer"}}]},"post":{"operationId":"post_query_gl","summary":"Query raw general-ledger entries with filters: version, period, entity, business unit, account prefix (e.g","description":"Query raw general-ledger entries with filters: version, period, entity, business unit, account prefix (e.g. \"411\" for all AR accounts under French PCG), and free-text search on the entry description. Returns matching rows (capped by limit, default 100, max 500) plus aggregates (total count, sum of debits and credits) computed over ALL matches, not just the returned page.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."},"period":{"type":"string","description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version."},"entity":{"type":"string","description":"Filter to a single entity code. Omit for consolidated view across all entities."},"bu":{"type":"string","description":"Filter to a single business unit. Omit for all BUs."},"acct_prefix":{"type":"string","description":"Account number prefix filter, e.g. \"411\" or \"70\"."},"search":{"type":"string","description":"Case-insensitive substring match on the entry description."},"limit":{"type":"integer","description":"Max rows to return (default 100, max 500)."}},"additionalProperties":false}}}}}},"/api/v1/query_lake":{"get":{"operationId":"get_query_lake","summary":"Aggregate the canonical lake over chosen dimensions (spine, entity, period, currency, method, version, grain, fx_state)","description":"Aggregate the canonical lake over chosen dimensions (spine, entity, period, currency, method, version, grain, fx_state). Returns sums plus a basis verdict. Aggregates ONLY — the lake holds far more lines than belong in a context window, and a sum answers almost every question a row dump would. Undeclared source codes appear as spine=\"unmapped\" and are never folded into a node: if that row is present, the other totals are incomplete and must be reported as such.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"dims","in":"query","required":false,"description":"Comma-separated dimensions, e.g. \"period,spine\". Default \"period,spine\".","schema":{"type":"string"}}]},"post":{"operationId":"post_query_lake","summary":"Aggregate the canonical lake over chosen dimensions (spine, entity, period, currency, method, version, grain, fx_state)","description":"Aggregate the canonical lake over chosen dimensions (spine, entity, period, currency, method, version, grain, fx_state). Returns sums plus a basis verdict. Aggregates ONLY — the lake holds far more lines than belong in a context window, and a sum answers almost every question a row dump would. Undeclared source codes appear as spine=\"unmapped\" and are never folded into a node: if that row is present, the other totals are incomplete and must be reported as such.","x-scope":"read:gl","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"dims":{"type":"string","description":"Comma-separated dimensions, e.g. \"period,spine\". Default \"period,spine\"."}},"additionalProperties":false}}}}}},"/api/v1/run_scenario":{"get":{"operationId":"get_run_scenario","summary":"Run a what-if scenario on the tenant's ledger and forecast, and return the P&L and the cash forecast, baseline vs scenario","description":"Run a what-if scenario on the tenant's ledger and forecast, and return the P&L and the cash forecast, baseline vs scenario. Give either levers ([{ type, params }], see kphi_scenario_levers) or the id of a saved scenario. Returns: the pro forma P&L over the horizon (revenue, COGS, gross margin, payroll, other opex, EBITDA, D&A, EBIT, interest, tax, net income) for the baseline and the scenario; the P&L per month (baseline and scenario); the cash impact per month and cumulated; and the cash forecast (baseline closing cash per month, and the scenario's = baseline + cumulated cash impact). Computes only; nothing is saved (use kphi_save_scenario, with the same levers and scope). The result is a PROJECTION — K-Φ's forecast summed over the horizon — not actuals: present summary_table verbatim, with its scope line, and lever_classes when a lever's account class matters. version is required when more than one exists.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"version","in":"query","required":false,"description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one.","schema":{"type":"string"}},{"name":"period","in":"query","required":false,"description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version.","schema":{"type":"string"}},{"name":"entity","in":"query","required":false,"description":"Filter to a single entity code. Omit for consolidated view across all entities.","schema":{"type":"string"}},{"name":"bu","in":"query","required":false,"description":"Filter to a single business unit. Omit for all BUs.","schema":{"type":"string"}},{"name":"levers","in":"query","required":false,"description":"The levers to simulate.","schema":{"type":"string"}},{"name":"scenario_id","in":"query","required":false,"description":"A saved scenario (kphi_list_scenarios) instead of levers.","schema":{"type":"string"}},{"name":"horizon","in":"query","required":false,"description":"Months, 1-24, default 12.","schema":{"type":"integer"}}]},"post":{"operationId":"post_run_scenario","summary":"Run a what-if scenario on the tenant's ledger and forecast, and return the P&L and the cash forecast, baseline vs scenario","description":"Run a what-if scenario on the tenant's ledger and forecast, and return the P&L and the cash forecast, baseline vs scenario. Give either levers ([{ type, params }], see kphi_scenario_levers) or the id of a saved scenario. Returns: the pro forma P&L over the horizon (revenue, COGS, gross margin, payroll, other opex, EBITDA, D&A, EBIT, interest, tax, net income) for the baseline and the scenario; the P&L per month (baseline and scenario); the cash impact per month and cumulated; and the cash forecast (baseline closing cash per month, and the scenario's = baseline + cumulated cash impact). Computes only; nothing is saved (use kphi_save_scenario, with the same levers and scope). The result is a PROJECTION — K-Φ's forecast summed over the horizon — not actuals: present summary_table verbatim, with its scope line, and lever_classes when a lever's account class matters. version is required when more than one exists.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."},"period":{"type":"string","description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version."},"entity":{"type":"string","description":"Filter to a single entity code. Omit for consolidated view across all entities."},"bu":{"type":"string","description":"Filter to a single business unit. Omit for all BUs."},"levers":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"params":{"type":"object"}},"required":["type"]},"description":"The levers to simulate."},"scenario_id":{"type":"string","description":"A saved scenario (kphi_list_scenarios) instead of levers."},"horizon":{"type":"integer","description":"Months, 1-24, default 12."}},"additionalProperties":false}}}}}},"/api/v1/save_scenario":{"post":{"operationId":"post_save_scenario","summary":"WRITE — Save a scenario in K-Φ, so it appears in the app's Simulation page with its levers (and can be run again with kphi_run_scenario)","description":"WRITE — Save a scenario in K-Φ, so it appears in the app's Simulation page with its levers (and can be run again with kphi_run_scenario). Give a name and the levers ([{ type, params }], see kphi_scenario_levers); pass scenario_id to replace the levers of a scenario saved before. Call only after kphi_run_scenario on the same levers, and pass the same scope (version, period, entity, BU): a custom lever's account class is resolved on it. The result lists the stored levers with their classes — report them. Requires the mcp:write scope.","x-scope":"write:scenarios","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"GL version label (e.g. \"2026-06\"), from kphi_list_versions. Required when more than one version exists: without it the tool answers needs_version with the list instead of picking one."},"period":{"type":"string","description":"Filter to a single period (YYYY-MM). Omit to include all periods in the version."},"entity":{"type":"string","description":"Filter to a single entity code. Omit for consolidated view across all entities."},"bu":{"type":"string","description":"Filter to a single business unit. Omit for all BUs."},"name":{"type":"string","description":"e.g. \"Salaries +10% from January\""},"levers":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"params":{"type":"object"}},"required":["type"]}},"scenario_id":{"type":"string","description":"Replace this saved scenario instead of creating one."}},"required":["name","levers"],"additionalProperties":false}}}}}},"/api/v1/scenario_levers":{"get":{"operationId":"get_scenario_levers","summary":"List the scenario levers K-Φ can simulate, with their parameters and defaults: staffing change, cost inflation, AR / AP terms (DSO / DPO), revenue change, capital expenditure, debt / financing, FX rat","description":"List the scenario levers K-Φ can simulate, with their parameters and defaults: staffing change, cost inflation, AR / AP terms (DSO / DPO), revenue change, capital expenditure, debt / financing, FX rate change, cost optimisation, and a custom GL shock (a % or a monthly amount on chosen GL accounts — e.g. \"salaries +10%\": type custom, shockType Percentage, shockPct 10, _accounts = the payroll account codes or prefixes from kphi_list_accounts). Call this before kphi_run_scenario or kphi_save_scenario.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[]},"post":{"operationId":"post_scenario_levers","summary":"List the scenario levers K-Φ can simulate, with their parameters and defaults: staffing change, cost inflation, AR / AP terms (DSO / DPO), revenue change, capital expenditure, debt / financing, FX rat","description":"List the scenario levers K-Φ can simulate, with their parameters and defaults: staffing change, cost inflation, AR / AP terms (DSO / DPO), revenue change, capital expenditure, debt / financing, FX rate change, cost optimisation, and a custom GL shock (a % or a monthly amount on chosen GL accounts — e.g. \"salaries +10%\": type custom, shockType Percentage, shockPct 10, _accounts = the payroll account codes or prefixes from kphi_list_accounts). Call this before kphi_run_scenario or kphi_save_scenario.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/api/v1/valuation_history":{"get":{"operationId":"get_valuation_history","summary":"The value of a case over time (one point per day it was computed) and the value walk from the previous point to the latest: how much each group moved the value (operating performance, working capital,","description":"The value of a case over time (one point per day it was computed) and the value walk from the previous point to the latest: how much each group moved the value (operating performance, working capital, net debt, market multiples, cost of capital, method weights), adding up to the total change. Use it to answer \"why did the value change?\".","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"case_id","in":"query","required":false,"description":"The valuation case id, from kphi_list_valuations.","schema":{"type":"string"}}]},"post":{"operationId":"post_valuation_history","summary":"The value of a case over time (one point per day it was computed) and the value walk from the previous point to the latest: how much each group moved the value (operating performance, working capital,","description":"The value of a case over time (one point per day it was computed) and the value walk from the previous point to the latest: how much each group moved the value (operating performance, working capital, net debt, market multiples, cost of capital, method weights), adding up to the total change. Use it to answer \"why did the value change?\".","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"case_id":{"type":"string","description":"The valuation case id, from kphi_list_valuations."}},"required":["case_id"],"additionalProperties":false}}}}}},"/api/v1/valuation_what_if":{"get":{"operationId":"get_valuation_what_if","summary":"Recompute a valuation with changed assumptions WITHOUT saving anything: \"what if WACC inputs, growth, margin, working capital or the terminal growth were different?\"","description":"Recompute a valuation with changed assumptions WITHOUT saving anything: \"what if WACC inputs, growth, margin, working capital or the terminal growth were different?\". Pass changes as a map of input path to value, e.g. {\"terminal.growth\": 0.025, \"cash_flows.drivers.base.ebitda_margin\": 0.22, \"market.risk_free\": 0.04}. Rates are decimals (0.025 = 2.5%). Returns the new snapshot and the change against the saved case.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"parameters":[{"name":"case_id","in":"query","required":false,"description":"The valuation case id, from kphi_list_valuations.","schema":{"type":"string"}},{"name":"changes","in":"query","required":false,"description":"Input path -> new numeric value.","schema":{"type":"string"}}]},"post":{"operationId":"post_valuation_what_if","summary":"Recompute a valuation with changed assumptions WITHOUT saving anything: \"what if WACC inputs, growth, margin, working capital or the terminal growth were different?\"","description":"Recompute a valuation with changed assumptions WITHOUT saving anything: \"what if WACC inputs, growth, margin, working capital or the terminal growth were different?\". Pass changes as a map of input path to value, e.g. {\"terminal.growth\": 0.025, \"cash_flows.drivers.base.ebitda_margin\": 0.22, \"market.risk_free\": 0.04}. Rates are decimals (0.025 = 2.5%). Returns the new snapshot and the change against the saved case.","x-scope":"read:forecast","x-extension-only":false,"security":[{"bearer":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object","properties":{"api":{"type":"string"},"capability":{"type":"string"},"at":{"type":"string"}}}}}}}},"401":{"description":"No or invalid credential"},"403":{"description":"Scope, extension or Builder Mode refused"},"422":{"description":"The capability refused the input"},"429":{"description":"Rate or daily quota reached"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"case_id":{"type":"string","description":"The valuation case id, from kphi_list_valuations."},"changes":{"type":"object","description":"Input path -> new numeric value.","additionalProperties":{"type":"number"}}},"required":["case_id","changes"],"additionalProperties":false}}}}}},"/api/v1/ext_env":{"get":{"operationId":"env_get","summary":"The names of the BUILD's own settings (secrets kept in its service environment), never a value; a builder's K-Φ session only","x-scope":"session","security":[{"bearer":[]}],"responses":{"200":{"description":"OK"}}}},"/api/v1/ext_env_put":{"post":{"operationId":"env_put","summary":"Set or remove the BUILD's own settings (API credentials, say): K-Φ puts them in the service environment and restarts it; a builder's K-Φ session only","x-scope":"session","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"vars":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["vars"]}}}},"responses":{"200":{"description":"OK"}}}},"/api/v1/ext_mine":{"get":{"operationId":"mine_get","summary":"A value of the signed-in person only (their own Dashboard layout); K-Φ sessions only","x-scope":"session","security":[{"bearer":[]}],"parameters":[{"name":"key","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/api/v1/ext_mine_put":{"post":{"operationId":"mine_put","summary":"Keep a value for the signed-in person only; K-Φ sessions only","x-scope":"session","security":[{"bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key","value"]}}}},"responses":{"200":{"description":"OK"}}}},"/api/v1/me":{"get":{"operationId":"get_me","summary":"Who this credential is: tenant, extension, scopes","security":[{"bearer":[]}],"responses":{"200":{"description":"OK"}}}},"/api/v1/ext/store/{key}":{"get":{"operationId":"store_get","x-scope":"write:ext","security":[{"bearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}},"put":{"operationId":"store_put","x-scope":"write:ext","security":[{"bearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"value":{}},"required":["value"]}}}},"responses":{"200":{"description":"OK"}}}}}}