{"version":"1","generatedAt":"2026-08-25T11:00:27.796Z","tools":[{"name":"accounting_create","description":"Creates a new journal entry in the target organization. Returns the created record on success.\n\n(Scope: accounting:write · requires CONTRIBUTOR+ · endpoint: POST /api/journal-entries)","http":{"method":"POST","path":"/api/journal-entries"},"feature":"accounting","verb":"write","scope":"accounting:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"date":{"type":"string"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}]},"legs":{"minItems":2,"type":"array","items":{"type":"object","properties":{"account":{"type":"string","enum":["CASH","AR","AP","REVENUE","EXPENSE","TAX_PAYABLE","TAX_RECEIVABLE","EQUITY","PREPAID_EXPENSE","DEFERRED_REVENUE","SALARY_EXPENSE","STATUTORY_EXPENSE","EMPLOYEE_PAYABLE","STATUTORY_PAYABLE","GOVERNMENT_RECEIVABLE","GPL_FUNDING","UNAPPLIED_PAYMENTS"]},"debit":{"type":"number","minimum":0},"credit":{"type":"number","minimum":0}},"required":["account","debit","credit"],"additionalProperties":false}}},"required":["organizationId","date","legs"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"date":{"type":"string"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"postings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"string","enum":["CASH","AR","AP","REVENUE","EXPENSE","TAX_PAYABLE","TAX_RECEIVABLE","EQUITY","PREPAID_EXPENSE","DEFERRED_REVENUE","SALARY_EXPENSE","STATUTORY_EXPENSE","EMPLOYEE_PAYABLE","STATUTORY_PAYABLE","GOVERNMENT_RECEIVABLE","GPL_FUNDING","UNAPPLIED_PAYMENTS"]},"debit":{"type":"number"},"credit":{"type":"number"}},"required":["id","account","debit","credit"],"additionalProperties":false}}},"required":["id","organizationId","date","memo","createdAt","postings"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"accounting_delete","description":"Deletes the journal entry. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: accounting:write · requires CONTRIBUTOR+ · endpoint: DELETE /api/journal-entries/{id})","http":{"method":"DELETE","path":"/api/journal-entries/{id}"},"feature":"accounting","verb":"write","scope":"accounting:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1}},"required":["id","organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"accounting_export_list","description":"Streams the caller's ledgers as a CSV file. Filter parameters scope the export the same way the list endpoint does.\n\n(Scope: accounting:read · endpoint: GET /api/ledger/export)","http":{"method":"GET","path":"/api/ledger/export"},"feature":"accounting","verb":"read","scope":"accounting:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"from":{"type":"string"},"to":{"type":"string"}},"required":["organizationId"],"additionalProperties":false},"outputSchema":null,"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"accounting_list","description":"Lists journal entries the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: accounting:read · endpoint: GET /api/journal-entries)","http":{"method":"GET","path":"/api/journal-entries"},"feature":"accounting","verb":"read","scope":"accounting:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"from":{"type":"string"},"to":{"type":"string"}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"journalEntries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"date":{"type":"string"},"memo":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"postings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"string","enum":["CASH","AR","AP","REVENUE","EXPENSE","TAX_PAYABLE","TAX_RECEIVABLE","EQUITY","PREPAID_EXPENSE","DEFERRED_REVENUE","SALARY_EXPENSE","STATUTORY_EXPENSE","EMPLOYEE_PAYABLE","STATUTORY_PAYABLE","GOVERNMENT_RECEIVABLE","GPL_FUNDING","UNAPPLIED_PAYMENTS"]},"debit":{"type":"number"},"credit":{"type":"number"}},"required":["id","account","debit","credit"],"additionalProperties":false}}},"required":["id","organizationId","date","memo","createdAt","postings"],"additionalProperties":false}}},"required":["journalEntries"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"accounting_lock_update","description":"Mutates the `lock` configuration for the ledgers feature.\n\n(Scope: accounting:write · requires MANAGER+ · endpoint: PATCH /api/ledger/lock)","http":{"method":"PATCH","path":"/api/ledger/lock"},"feature":"accounting","verb":"write","scope":"accounting:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"lockedThrough":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["organizationId","lockedThrough"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"lockedThrough":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["lockedThrough"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"accounting_postings_list","description":"Returns the `postings` data for the ledgers feature.\n\n(Scope: accounting:read · endpoint: GET /api/ledger/postings)","http":{"method":"GET","path":"/api/ledger/postings"},"feature":"accounting","verb":"read","scope":"accounting:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"from":{"type":"string"},"to":{"type":"string"},"limit":{"default":200,"type":"integer","minimum":1,"maximum":1000}},"required":["organizationId","limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"postings":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"kind":{"type":"string","enum":["document","payment","recognition","journal"]},"source":{"type":"string"},"account":{"type":"string"},"accountName":{"type":"string"},"debit":{"type":"number"},"credit":{"type":"number"}},"required":["date","kind","source","account","accountName","debit","credit"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalDebit":{"type":"number"},"totalCredit":{"type":"number"}},"required":["postings","total","totalDebit","totalCredit"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"accounting_summary_list","description":"Returns the `summary` data for the ledgers feature.\n\n(Scope: accounting:read · endpoint: GET /api/ledger/summary)","http":{"method":"GET","path":"/api/ledger/summary"},"feature":"accounting","verb":"read","scope":"accounting:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"autoObligations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"autoSettlements":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualEntries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalDebit":{"type":"number"},"totalCredit":{"type":"number"},"lockedThrough":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["autoObligations","autoSettlements","manualEntries","totalDebit","totalCredit","lockedThrough"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"api_keys_create","description":"Creates a new API key in the target organization. Returns the created record on success.\n\n(Scope: users:write · auth: SESSION only · endpoint: POST /api/api-keys)","http":{"method":"POST","path":"/api/api-keys"},"feature":"users","verb":"write","scope":"users:write","hasBody":true,"inputSchema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"scopes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","description":"`<feature>:<read|write|*>`, or `*:<verb>` for every feature. Write is not grantable on read-only features (reports). Catalog: /.well-known/oauth-authorization-server."}},"allOrgs":{"default":false,"type":"boolean"},"organizationIds":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["name","scopes","allOrgs"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"allOrgs":{"type":"boolean"},"organizationIds":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","name","prefix","scopes","allOrgs","organizationIds","expiresAt","lastUsedAt","revokedAt","createdAt"],"additionalProperties":false},"secret":{"type":"string"}},"required":["key","secret"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"api_keys_delete","description":"Deletes the API key. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: users:write · auth: SESSION only · endpoint: DELETE /api/api-keys/{id})","http":{"method":"DELETE","path":"/api/api-keys/{id}"},"feature":"users","verb":"write","scope":"users:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"revokedAt":{"type":"string"}},"required":["revokedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"api_keys_get","description":"Fetches a single API key by id. Returns 404 if the API key isn't in the caller's accessible organizations.\n\n(Scope: users:read · auth: SESSION only · endpoint: GET /api/api-keys/{id})","http":{"method":"GET","path":"/api/api-keys/{id}"},"feature":"users","verb":"read","scope":"users:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"allOrgs":{"type":"boolean"},"organizationIds":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","name","prefix","scopes","allOrgs","organizationIds","expiresAt","lastUsedAt","revokedAt","createdAt"],"additionalProperties":false}},"required":["key"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"api_keys_list","description":"Lists API keys the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: users:read · auth: SESSION only · endpoint: GET /api/api-keys)","http":{"method":"GET","path":"/api/api-keys"},"feature":"users","verb":"read","scope":"users:read","hasBody":false,"inputSchema":{"type":"object","properties":{},"additionalProperties":false},"outputSchema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"allOrgs":{"type":"boolean"},"organizationIds":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","name","prefix","scopes","allOrgs","organizationIds","expiresAt","lastUsedAt","revokedAt","createdAt"],"additionalProperties":false}}},"required":["keys"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"api_keys_update","description":"Updates an existing API key. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: users:write · auth: SESSION only · endpoint: PATCH /api/api-keys/{id})","http":{"method":"PATCH","path":"/api/api-keys/{id}"},"feature":"users","verb":"write","scope":"users:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":80},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"allOrgs":{"type":"boolean"},"organizationIds":{"type":"array","items":{"type":"string"}},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","name","prefix","scopes","allOrgs","organizationIds","expiresAt","lastUsedAt","revokedAt","createdAt"],"additionalProperties":false}},"required":["key"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"attendance_approve","description":"Performs the `approve` operation for the work sessions feature.\n\n(Scope: attendance:write · requires MANAGER+ · endpoint: POST /api/hr/attendance/approve)","http":{"method":"POST","path":"/api/hr/attendance/approve"},"feature":"attendance","verb":"write","scope":"attendance:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"}},"required":["organizationId","from","to"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"approved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Sessions left unapproved: the approver's own, and rows in a locked or already-paid month."}},"required":["approved","skipped"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"attendance_check_in","description":"Performs the `check-in` operation for the work sessions feature.\n\n(Scope: attendance:write · requires VIEWER+ · endpoint: POST /api/hr/attendance/check-in)","http":{"method":"POST","path":"/api/hr/attendance/check-in"},"feature":"attendance","verb":"write","scope":"attendance:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"employeeName":{"anyOf":[{"type":"string"},{"type":"null"}]},"startAt":{"type":"string","description":"ISO instant, server-stamped for a CLOCK punch."},"endAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"null ⟺ the session is open (law 18)."},"source":{"type":"string","enum":["CLOCK","MANUAL"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"editedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalStartAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalEndAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"hours":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","counterpartyId","employeeName","startAt","endAt","source","note","approvedAt","approvedByUserId","editedAt","originalStartAt","originalEndAt","hours"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"attendance_check_out","description":"Performs the `check-out` operation for the work sessions feature.\n\n(Scope: attendance:write · requires VIEWER+ · endpoint: POST /api/hr/attendance/check-out)","http":{"method":"POST","path":"/api/hr/attendance/check-out"},"feature":"attendance","verb":"write","scope":"attendance:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"employeeName":{"anyOf":[{"type":"string"},{"type":"null"}]},"startAt":{"type":"string","description":"ISO instant, server-stamped for a CLOCK punch."},"endAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"null ⟺ the session is open (law 18)."},"source":{"type":"string","enum":["CLOCK","MANUAL"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"editedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalStartAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalEndAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"hours":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","counterpartyId","employeeName","startAt","endAt","source","note","approvedAt","approvedByUserId","editedAt","originalStartAt","originalEndAt","hours"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"attendance_sessions_create","description":"Performs the `sessions` operation for the work sessions feature.\n\n(Scope: attendance:write · requires CONTRIBUTOR+ · endpoint: POST /api/hr/attendance/sessions)","http":{"method":"POST","path":"/api/hr/attendance/sessions"},"feature":"attendance","verb":"write","scope":"attendance:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string"},"startAt":{"type":"string"},"endAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"type":"string","minLength":1}},"required":["organizationId","startAt","note"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"employeeName":{"anyOf":[{"type":"string"},{"type":"null"}]},"startAt":{"type":"string","description":"ISO instant, server-stamped for a CLOCK punch."},"endAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"null ⟺ the session is open (law 18)."},"source":{"type":"string","enum":["CLOCK","MANUAL"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"editedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalStartAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalEndAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"hours":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","counterpartyId","employeeName","startAt","endAt","source","note","approvedAt","approvedByUserId","editedAt","originalStartAt","originalEndAt","hours"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"attendance_sessions_delete","description":"Removes the association without deleting the underlying record.\n\n(Scope: attendance:write · requires CONTRIBUTOR+ · endpoint: DELETE /api/hr/attendance/sessions/{id})","http":{"method":"DELETE","path":"/api/hr/attendance/sessions/{id}"},"feature":"attendance","verb":"write","scope":"attendance:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1}},"required":["id","organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"attendance_sessions_list","description":"Returns the `sessions` data for the work sessions feature.\n\n(Scope: attendance:read · requires VIEWER+ · endpoint: GET /api/hr/attendance/sessions)","http":{"method":"GET","path":"/api/hr/attendance/sessions"},"feature":"attendance","verb":"read","scope":"attendance:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"from":{"type":"string"},"to":{"type":"string"},"counterpartyId":{"type":"string"},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":25,"type":"integer","minimum":1,"maximum":100}},"required":["organizationId","from","to","page","limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"sessions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"employeeName":{"anyOf":[{"type":"string"},{"type":"null"}]},"startAt":{"type":"string","description":"ISO instant, server-stamped for a CLOCK punch."},"endAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"null ⟺ the session is open (law 18)."},"source":{"type":"string","enum":["CLOCK","MANUAL"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"editedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalStartAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalEndAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"hours":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","counterpartyId","employeeName","startAt","endAt","source","note","approvedAt","approvedByUserId","editedAt","originalStartAt","originalEndAt","hours"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["sessions","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"attendance_sessions_update","description":"Mutates the `sessions` attached to the given work session.\n\n(Scope: attendance:write · requires CONTRIBUTOR+ · endpoint: PATCH /api/hr/attendance/sessions/{id})","http":{"method":"PATCH","path":"/api/hr/attendance/sessions/{id}"},"feature":"attendance","verb":"write","scope":"attendance:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1},"startAt":{"type":"string"},"endAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"type":"string","minLength":1}},"required":["id","organizationId","note"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"employeeName":{"anyOf":[{"type":"string"},{"type":"null"}]},"startAt":{"type":"string","description":"ISO instant, server-stamped for a CLOCK punch."},"endAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"null ⟺ the session is open (law 18)."},"source":{"type":"string","enum":["CLOCK","MANUAL"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"editedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalStartAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalEndAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"hours":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","counterpartyId","employeeName","startAt","endAt","source","note","approvedAt","approvedByUserId","editedAt","originalStartAt","originalEndAt","hours"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"attendance_timesheets_list","description":"Lists timesheets the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: attendance:read · requires VIEWER+ · endpoint: GET /api/hr/timesheets)","http":{"method":"GET","path":"/api/hr/timesheets"},"feature":"attendance","verb":"read","scope":"attendance:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"from":{"type":"string"},"to":{"type":"string"},"counterpartyId":{"type":"string"}},"required":["organizationId","from","to"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"counterpartyId":{"type":"string"},"employeeName":{"anyOf":[{"type":"string"},{"type":"null"}]},"days":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"totalHours":{"type":"number"},"pendingHours":{"type":"number"},"openSessions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["counterpartyId","employeeName","days","totalHours","pendingHours","openSessions"],"additionalProperties":false}},"timezone":{"type":"string"},"openSessions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pendingHours":{"type":"number"},"ordinaryOnly":{"type":"boolean"},"country":{"type":"string"},"anomalies":{"type":"array","items":{"type":"object","properties":{"counterpartyId":{"type":"string"},"employeeName":{"anyOf":[{"type":"string"},{"type":"null"}]},"day":{"type":"string"},"workedHours":{"type":"number"},"leaveKind":{"type":"string"}},"required":["counterpartyId","employeeName","day","workedHours","leaveKind"],"additionalProperties":false}}},"required":["rows","timezone","openSessions","pendingHours","ordinaryOnly","country","anomalies"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"automations_catalog","description":"Returns the building blocks for authoring automations — call this BEFORE automations.create or automations.update. Three catalogs: triggers (event types usable as a TRIGGER block's ref, each with the payload JSON Schema that {{trigger.*}} bindings can reference), actions (every tool usable as an ACTION block's ref — the full MCP tool catalog plus engine-native webhook.post / email.send — each with input/output JSON Schemas for config.input), and filterCatalog (the objects, fields, and follow morphisms a FILTER block's config.spec may range over). Read-only, org-agnostic.","http":{"method":"GET","path":"/api/automations/actions"},"feature":"automations","verb":"read","scope":"automations:read","hasBody":false,"inputSchema":{"type":"object","properties":{},"additionalProperties":false},"outputSchema":{"type":"object","properties":{"triggers":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Event type — use as a TRIGGER block's ref (e.g. \"invoice.paid\", \"schedule.daily\")."},"label":{"type":"string"},"group":{"type":"string"},"payloadSchema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"JSON Schema for the trigger's event payload — the fields {{trigger.*}} bindings can reference."}},"required":["type","label","group","payloadSchema"],"additionalProperties":false},"description":"Event types usable as a TRIGGER block's ref."},"actions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Tool name — use as an ACTION block's ref (e.g. \"invoices.send\", \"webhook.post\")."},"description":{"type":"string"},"feature":{"type":"string"},"verb":{"type":"string"},"kind":{"type":"string","enum":["system","engine"],"description":"system = an API route invoked as a tool; engine = built into the worker."},"inputSchema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"JSON Schema (draft-7) for the action's input — the shape an ACTION block's config.input must satisfy."},"outputSchema":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"JSON Schema for the action's output (what downstream {{blocks.<id>.…}} bindings can read), or null for opaque/streamed results."}},"required":["name","description","feature","verb","kind","inputSchema","outputSchema"],"additionalProperties":false},"description":"Tools usable as an ACTION block's ref."},"filterCatalog":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date"]}},"required":["name","type"],"additionalProperties":false}},"morphisms":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["fields","morphisms"],"additionalProperties":false},"description":"Objects a FILTER block's config.spec may range over: object name → readable fields (with primitive types) + follow morphisms (name → target object)."}},"required":["triggers","actions","filterCatalog"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"automations_create","description":"Create an automation: a graph of blocks (nodes) joined by edges. Call automations.catalog FIRST — it lists every valid trigger event type (with the payload fields {{trigger.*}} bindings can reference), every action tool name (with its input schema), and the filterable-object catalog for FILTER blocks. A TRIGGER block sets ref to an event type (e.g. \"invoice.paid\"); an ACTION block sets ref to a tool name (e.g. \"invoices.send\" or \"webhook.post\") with its arguments in config.input, where values may embed {{…}} bindings; a FILTER block puts its query in config.spec. The graph needs at least one TRIGGER and must be acyclic. Created in DRAFT status — it does not fire yet: verify it with automations.test, then arm it with automations.enable. Requires CONTRIBUTOR+.","http":{"method":"POST","path":"/api/automations"},"feature":"automations","verb":"write","scope":"automations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"blocks":{"default":[],"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Client-chosen id, unique within the automation. Edges reference blocks by this id, and downstream blocks read this block's output via {{blocks.<id>.…}} bindings."},"kind":{"type":"string","enum":["TRIGGER","FILTER","ACTION","CUSTOM"],"description":"TRIGGER starts the flow when its event fires (every automation needs at least one); FILTER queries org data and outputs a shaped list/value; ACTION invokes a tool; CUSTOM is reserved and not executable in v1."},"ref":{"description":"What the block invokes. TRIGGER: an event type from the catalog, e.g. \"invoice.paid\" or \"schedule.daily\" (GET /api/automations/actions lists them). ACTION: an MCP tool name, e.g. \"invoices.send\", or engine-native \"webhook.post\" / \"email.send\". FILTER: omit — the query lives in config.spec.","anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"config":{"description":"Kind-specific configuration. ACTION: { input: { … } } — the arguments for the tool named by ref, matching that tool's inputSchema from the catalog; values may embed {{…}} bindings ({{trigger.*}}, {{blocks.<id>.*}}, {{item.*}} under a FOR_EACH edge, {{context.now}}, {{context.today}}, {{context.orgId}}) — a whole-string binding like \"{{trigger.total}}\" keeps the value's native type, inline bindings interpolate into the string. FILTER: { spec: { root, follows?, predicates?, aggregateBy?, extract, shape? } } over the served filter catalog. TRIGGER: ignored.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"position":{"description":"Editor canvas hint ({ x, y }). Ignored by the engine.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","kind"],"additionalProperties":false}},"edges":{"default":[],"maxItems":300,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Client-chosen id, unique within the automation."},"fromBlockId":{"type":"string","minLength":1,"description":"Id of the source block. The graph must be a DAG — self-loops and cycles are rejected."},"toBlockId":{"type":"string","minLength":1,"description":"Id of the target block. The target runs only after the source step succeeds and the cond (if any) passes."},"cond":{"description":"Optional guard — null/omitted means the edge is always followed. Leaf: { left, op, right? } with op one of eq | ne | gt | gte | lt | lte | in | nin | contains | exists | empty; compose with { all: […] }, { any: […] }, { not: … }. Operands may be literals or {{…}} bindings; comparisons are type-light (100 equals \"100\").","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"mode":{"description":"ONCE (default) passes the source output downstream as-is; FOR_EACH fans a list-valued source output out, running the target once per element (exposed as {{item.*}}) — a non-list source falls back to a single run.","type":"string","enum":["ONCE","FOR_EACH"]},"order":{"description":"Display ordering only — execution order is topological.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","fromBlockId","toBlockId"],"additionalProperties":false}}},"required":["organizationId","name","blocks","edges"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"ownerUserId":{"type":"string","description":"The run-as identity: when the automation fires, actions execute under this user's current org permissions."},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["DRAFT","ENABLED","PAUSED","PAUSED_NO_ACCESS"],"description":"DRAFT = never armed; ENABLED = armed (fires on its trigger; the free tier allows 5 enabled per org); PAUSED = manually disarmed; PAUSED_NO_ACCESS = auto-paused because the owner lost the required org access."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"blocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation. Edges reference blocks by this id, and downstream blocks read this block's output via {{blocks.<id>.…}} bindings."},"kind":{"type":"string","enum":["TRIGGER","FILTER","ACTION","CUSTOM"],"description":"TRIGGER starts the flow when its event fires (every automation needs at least one); FILTER queries org data and outputs a shaped list/value; ACTION invokes a tool; CUSTOM is reserved and not executable in v1."},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the block invokes. TRIGGER: an event type from the catalog, e.g. \"invoice.paid\" or \"schedule.daily\" (GET /api/automations/actions lists them). ACTION: an MCP tool name, e.g. \"invoices.send\", or engine-native \"webhook.post\" / \"email.send\". FILTER: omit — the query lives in config.spec."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Kind-specific configuration. ACTION: { input: { … } } — the arguments for the tool named by ref, matching that tool's inputSchema from the catalog; values may embed {{…}} bindings ({{trigger.*}}, {{blocks.<id>.*}}, {{item.*}} under a FOR_EACH edge, {{context.now}}, {{context.today}}, {{context.orgId}}) — a whole-string binding like \"{{trigger.total}}\" keeps the value's native type, inline bindings interpolate into the string. FILTER: { spec: { root, follows?, predicates?, aggregateBy?, extract, shape? } } over the served filter catalog. TRIGGER: ignored."},"position":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Editor canvas hint ({ x, y }). Ignored by the engine."}},"required":["id","kind","ref","config","position"],"additionalProperties":false}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation."},"fromBlockId":{"type":"string","description":"Id of the source block. The graph must be a DAG — self-loops and cycles are rejected."},"toBlockId":{"type":"string","description":"Id of the target block. The target runs only after the source step succeeds and the cond (if any) passes."},"cond":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Optional guard — null/omitted means the edge is always followed. Leaf: { left, op, right? } with op one of eq | ne | gt | gte | lt | lte | in | nin | contains | exists | empty; compose with { all: […] }, { any: […] }, { not: … }. Operands may be literals or {{…}} bindings; comparisons are type-light (100 equals \"100\")."},"mode":{"type":"string","enum":["ONCE","FOR_EACH"],"description":"ONCE (default) passes the source output downstream as-is; FOR_EACH fans a list-valued source output out, running the target once per element (exposed as {{item.*}}) — a non-list source falls back to a single run."},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Display ordering only — execution order is topological."}},"required":["id","fromBlockId","toBlockId","cond","mode","order"],"additionalProperties":false}}},"required":["id","organizationId","ownerUserId","name","description","status","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":true,"destructiveHint":false}},{"name":"automations_delete","description":"Permanently delete an automation, its graph, and its run history (hard delete — cannot be undone). To stop it firing without losing anything, use automations.disable instead. Requires MANAGER.","http":{"method":"DELETE","path":"/api/automations/{id}"},"feature":"automations","verb":"write","scope":"automations:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"automations_disable_create","description":"Disarm an automation (status becomes PAUSED): it stops firing on its trigger. The graph and run history are kept, and it can be re-enabled later. Requires CONTRIBUTOR+.","http":{"method":"POST","path":"/api/automations/{id}/disable"},"feature":"automations","verb":"write","scope":"automations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"ownerUserId":{"type":"string","description":"The run-as identity: when the automation fires, actions execute under this user's current org permissions."},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["DRAFT","ENABLED","PAUSED","PAUSED_NO_ACCESS"],"description":"DRAFT = never armed; ENABLED = armed (fires on its trigger; the free tier allows 5 enabled per org); PAUSED = manually disarmed; PAUSED_NO_ACCESS = auto-paused because the owner lost the required org access."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"blocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation. Edges reference blocks by this id, and downstream blocks read this block's output via {{blocks.<id>.…}} bindings."},"kind":{"type":"string","enum":["TRIGGER","FILTER","ACTION","CUSTOM"],"description":"TRIGGER starts the flow when its event fires (every automation needs at least one); FILTER queries org data and outputs a shaped list/value; ACTION invokes a tool; CUSTOM is reserved and not executable in v1."},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the block invokes. TRIGGER: an event type from the catalog, e.g. \"invoice.paid\" or \"schedule.daily\" (GET /api/automations/actions lists them). ACTION: an MCP tool name, e.g. \"invoices.send\", or engine-native \"webhook.post\" / \"email.send\". FILTER: omit — the query lives in config.spec."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Kind-specific configuration. ACTION: { input: { … } } — the arguments for the tool named by ref, matching that tool's inputSchema from the catalog; values may embed {{…}} bindings ({{trigger.*}}, {{blocks.<id>.*}}, {{item.*}} under a FOR_EACH edge, {{context.now}}, {{context.today}}, {{context.orgId}}) — a whole-string binding like \"{{trigger.total}}\" keeps the value's native type, inline bindings interpolate into the string. FILTER: { spec: { root, follows?, predicates?, aggregateBy?, extract, shape? } } over the served filter catalog. TRIGGER: ignored."},"position":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Editor canvas hint ({ x, y }). Ignored by the engine."}},"required":["id","kind","ref","config","position"],"additionalProperties":false}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation."},"fromBlockId":{"type":"string","description":"Id of the source block. The graph must be a DAG — self-loops and cycles are rejected."},"toBlockId":{"type":"string","description":"Id of the target block. The target runs only after the source step succeeds and the cond (if any) passes."},"cond":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Optional guard — null/omitted means the edge is always followed. Leaf: { left, op, right? } with op one of eq | ne | gt | gte | lt | lte | in | nin | contains | exists | empty; compose with { all: […] }, { any: […] }, { not: … }. Operands may be literals or {{…}} bindings; comparisons are type-light (100 equals \"100\")."},"mode":{"type":"string","enum":["ONCE","FOR_EACH"],"description":"ONCE (default) passes the source output downstream as-is; FOR_EACH fans a list-valued source output out, running the target once per element (exposed as {{item.*}}) — a non-list source falls back to a single run."},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Display ordering only — execution order is topological."}},"required":["id","fromBlockId","toBlockId","cond","mode","order"],"additionalProperties":false}}},"required":["id","organizationId","ownerUserId","name","description","status","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"automations_enable_create","description":"Arm an automation so it fires whenever its TRIGGER event occurs. Requires at least one TRIGGER block. The free tier allows 5 enabled automations per org — enabling past the cap returns 409 CONFLICT. Enabling an already-enabled automation is a no-op. Requires CONTRIBUTOR+.","http":{"method":"POST","path":"/api/automations/{id}/enable"},"feature":"automations","verb":"write","scope":"automations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"ownerUserId":{"type":"string","description":"The run-as identity: when the automation fires, actions execute under this user's current org permissions."},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["DRAFT","ENABLED","PAUSED","PAUSED_NO_ACCESS"],"description":"DRAFT = never armed; ENABLED = armed (fires on its trigger; the free tier allows 5 enabled per org); PAUSED = manually disarmed; PAUSED_NO_ACCESS = auto-paused because the owner lost the required org access."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"blocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation. Edges reference blocks by this id, and downstream blocks read this block's output via {{blocks.<id>.…}} bindings."},"kind":{"type":"string","enum":["TRIGGER","FILTER","ACTION","CUSTOM"],"description":"TRIGGER starts the flow when its event fires (every automation needs at least one); FILTER queries org data and outputs a shaped list/value; ACTION invokes a tool; CUSTOM is reserved and not executable in v1."},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the block invokes. TRIGGER: an event type from the catalog, e.g. \"invoice.paid\" or \"schedule.daily\" (GET /api/automations/actions lists them). ACTION: an MCP tool name, e.g. \"invoices.send\", or engine-native \"webhook.post\" / \"email.send\". FILTER: omit — the query lives in config.spec."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Kind-specific configuration. ACTION: { input: { … } } — the arguments for the tool named by ref, matching that tool's inputSchema from the catalog; values may embed {{…}} bindings ({{trigger.*}}, {{blocks.<id>.*}}, {{item.*}} under a FOR_EACH edge, {{context.now}}, {{context.today}}, {{context.orgId}}) — a whole-string binding like \"{{trigger.total}}\" keeps the value's native type, inline bindings interpolate into the string. FILTER: { spec: { root, follows?, predicates?, aggregateBy?, extract, shape? } } over the served filter catalog. TRIGGER: ignored."},"position":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Editor canvas hint ({ x, y }). Ignored by the engine."}},"required":["id","kind","ref","config","position"],"additionalProperties":false}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation."},"fromBlockId":{"type":"string","description":"Id of the source block. The graph must be a DAG — self-loops and cycles are rejected."},"toBlockId":{"type":"string","description":"Id of the target block. The target runs only after the source step succeeds and the cond (if any) passes."},"cond":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Optional guard — null/omitted means the edge is always followed. Leaf: { left, op, right? } with op one of eq | ne | gt | gte | lt | lte | in | nin | contains | exists | empty; compose with { all: […] }, { any: […] }, { not: … }. Operands may be literals or {{…}} bindings; comparisons are type-light (100 equals \"100\")."},"mode":{"type":"string","enum":["ONCE","FOR_EACH"],"description":"ONCE (default) passes the source output downstream as-is; FOR_EACH fans a list-valued source output out, running the target once per element (exposed as {{item.*}}) — a non-list source falls back to a single run."},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Display ordering only — execution order is topological."}},"required":["id","fromBlockId","toBlockId","cond","mode","order"],"additionalProperties":false}}},"required":["id","organizationId","ownerUserId","name","description","status","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"automations_get","description":"Fetches a single automation by id. Returns 404 if the automation isn't in the caller's accessible organizations.\n\n(Scope: automations:read · endpoint: GET /api/automations/{id})","http":{"method":"GET","path":"/api/automations/{id}"},"feature":"automations","verb":"read","scope":"automations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"ownerUserId":{"type":"string","description":"The run-as identity: when the automation fires, actions execute under this user's current org permissions."},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["DRAFT","ENABLED","PAUSED","PAUSED_NO_ACCESS"],"description":"DRAFT = never armed; ENABLED = armed (fires on its trigger; the free tier allows 5 enabled per org); PAUSED = manually disarmed; PAUSED_NO_ACCESS = auto-paused because the owner lost the required org access."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"blocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation. Edges reference blocks by this id, and downstream blocks read this block's output via {{blocks.<id>.…}} bindings."},"kind":{"type":"string","enum":["TRIGGER","FILTER","ACTION","CUSTOM"],"description":"TRIGGER starts the flow when its event fires (every automation needs at least one); FILTER queries org data and outputs a shaped list/value; ACTION invokes a tool; CUSTOM is reserved and not executable in v1."},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the block invokes. TRIGGER: an event type from the catalog, e.g. \"invoice.paid\" or \"schedule.daily\" (GET /api/automations/actions lists them). ACTION: an MCP tool name, e.g. \"invoices.send\", or engine-native \"webhook.post\" / \"email.send\". FILTER: omit — the query lives in config.spec."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Kind-specific configuration. ACTION: { input: { … } } — the arguments for the tool named by ref, matching that tool's inputSchema from the catalog; values may embed {{…}} bindings ({{trigger.*}}, {{blocks.<id>.*}}, {{item.*}} under a FOR_EACH edge, {{context.now}}, {{context.today}}, {{context.orgId}}) — a whole-string binding like \"{{trigger.total}}\" keeps the value's native type, inline bindings interpolate into the string. FILTER: { spec: { root, follows?, predicates?, aggregateBy?, extract, shape? } } over the served filter catalog. TRIGGER: ignored."},"position":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Editor canvas hint ({ x, y }). Ignored by the engine."}},"required":["id","kind","ref","config","position"],"additionalProperties":false}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation."},"fromBlockId":{"type":"string","description":"Id of the source block. The graph must be a DAG — self-loops and cycles are rejected."},"toBlockId":{"type":"string","description":"Id of the target block. The target runs only after the source step succeeds and the cond (if any) passes."},"cond":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Optional guard — null/omitted means the edge is always followed. Leaf: { left, op, right? } with op one of eq | ne | gt | gte | lt | lte | in | nin | contains | exists | empty; compose with { all: […] }, { any: […] }, { not: … }. Operands may be literals or {{…}} bindings; comparisons are type-light (100 equals \"100\")."},"mode":{"type":"string","enum":["ONCE","FOR_EACH"],"description":"ONCE (default) passes the source output downstream as-is; FOR_EACH fans a list-valued source output out, running the target once per element (exposed as {{item.*}}) — a non-list source falls back to a single run."},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Display ordering only — execution order is topological."}},"required":["id","fromBlockId","toBlockId","cond","mode","order"],"additionalProperties":false}}},"required":["id","organizationId","ownerUserId","name","description","status","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"automations_list","description":"Lists automations the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: automations:read · endpoint: GET /api/automations)","http":{"method":"GET","path":"/api/automations"},"feature":"automations","verb":"read","scope":"automations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"status":{"type":"string","enum":["DRAFT","ENABLED","PAUSED","PAUSED_NO_ACCESS"]},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":20,"type":"integer","minimum":1,"maximum":100}},"required":["organizationId","page","limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"automations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"ownerUserId":{"type":"string","description":"The run-as identity: when the automation fires, actions execute under this user's current org permissions."},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["DRAFT","ENABLED","PAUSED","PAUSED_NO_ACCESS"],"description":"DRAFT = never armed; ENABLED = armed (fires on its trigger; the free tier allows 5 enabled per org); PAUSED = manually disarmed; PAUSED_NO_ACCESS = auto-paused because the owner lost the required org access."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"blocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation. Edges reference blocks by this id, and downstream blocks read this block's output via {{blocks.<id>.…}} bindings."},"kind":{"type":"string","enum":["TRIGGER","FILTER","ACTION","CUSTOM"],"description":"TRIGGER starts the flow when its event fires (every automation needs at least one); FILTER queries org data and outputs a shaped list/value; ACTION invokes a tool; CUSTOM is reserved and not executable in v1."},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the block invokes. TRIGGER: an event type from the catalog, e.g. \"invoice.paid\" or \"schedule.daily\" (GET /api/automations/actions lists them). ACTION: an MCP tool name, e.g. \"invoices.send\", or engine-native \"webhook.post\" / \"email.send\". FILTER: omit — the query lives in config.spec."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Kind-specific configuration. ACTION: { input: { … } } — the arguments for the tool named by ref, matching that tool's inputSchema from the catalog; values may embed {{…}} bindings ({{trigger.*}}, {{blocks.<id>.*}}, {{item.*}} under a FOR_EACH edge, {{context.now}}, {{context.today}}, {{context.orgId}}) — a whole-string binding like \"{{trigger.total}}\" keeps the value's native type, inline bindings interpolate into the string. FILTER: { spec: { root, follows?, predicates?, aggregateBy?, extract, shape? } } over the served filter catalog. TRIGGER: ignored."},"position":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Editor canvas hint ({ x, y }). Ignored by the engine."}},"required":["id","kind","ref","config","position"],"additionalProperties":false}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation."},"fromBlockId":{"type":"string","description":"Id of the source block. The graph must be a DAG — self-loops and cycles are rejected."},"toBlockId":{"type":"string","description":"Id of the target block. The target runs only after the source step succeeds and the cond (if any) passes."},"cond":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Optional guard — null/omitted means the edge is always followed. Leaf: { left, op, right? } with op one of eq | ne | gt | gte | lt | lte | in | nin | contains | exists | empty; compose with { all: […] }, { any: […] }, { not: … }. Operands may be literals or {{…}} bindings; comparisons are type-light (100 equals \"100\")."},"mode":{"type":"string","enum":["ONCE","FOR_EACH"],"description":"ONCE (default) passes the source output downstream as-is; FOR_EACH fans a list-valued source output out, running the target once per element (exposed as {{item.*}}) — a non-list source falls back to a single run."},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Display ordering only — execution order is topological."}},"required":["id","fromBlockId","toBlockId","cond","mode","order"],"additionalProperties":false}}},"required":["id","organizationId","ownerUserId","name","description","status","createdAt","updatedAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["automations","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"automations_preview_create","description":"Dry-run a FILTER block's spec against the caller's org data: returns the match count plus up to 5 sample shaped rows (or the scalar). Use it to validate a spec before putting it in a FILTER block's config.spec. {{…}} bindings are NOT resolved here (there is no run scope at edit time) — preview with literal predicate values. Valid objects/fields/morphisms come from automations.catalog's filterCatalog.","http":{"method":"POST","path":"/api/automations/filter/preview"},"feature":"automations","verb":"read","scope":"automations:read","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"spec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"A FilterSpec: { root, follows?, predicates?, aggregateBy?, extract, shape? }. root names a filterCatalog object; predicates are { object, field, op, value } with op one of eq|ne|gt|gte|lt|lte|in|nin|contains; extract entries are { as, path: \"Object.field\", fn?: \"sum\"|\"count\" }; shape is \"objects\" (default) | \"scalars\" | \"scalar\"."}},"required":["organizationId","spec"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Number of matching rows (capped at 1000)."},"sample":{"type":"array","items":{},"description":"First 5 shaped results (empty for shape: \"scalar\")."},"scalar":{"description":"The single value when the spec's shape is \"scalar\"."}},"required":["count","sample"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"automations_replay_create","description":"Resume a FAILED run from its failed step. Steps that already succeeded are NOT re-executed — their recorded outputs are reused — and the original trigger payload is kept. Only FAILED runs are replayable. Requires CONTRIBUTOR+.","http":{"method":"POST","path":"/api/automations/{id}/runs/{runId}/replay"},"feature":"automations","verb":"write","scope":"automations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"runId":{"type":"string"}},"required":["id","runId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"automationId":{"type":"string"},"organizationId":{"type":"string"},"triggerEventId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The outbox event that fired this run; null for a manual test run."},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The trigger payload the run was seeded with — what {{trigger.*}} resolved against."},"status":{"type":"string","enum":["RUNNING","SUCCEEDED","FAILED","CANCELLED"],"description":"FAILED pauses at the first failed step; a FAILED run can be resumed via replay."},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"blockId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The block this step executed; null if that block was later edited out of the graph."},"status":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","SKIPPED"],"description":"SKIPPED = no incoming edge had a succeeded source with a passing cond."},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The block's resolved input (bindings already substituted)."},"output":{"anyOf":[{},{"type":"null"}],"description":"The block's output — what downstream {{blocks.<id>.…}} bindings read."},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-based; transient action failures are retried."},"latencyMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","blockId","status","input","output","error","attempt","latencyMs","startedAt","finishedAt"],"additionalProperties":false}}},"required":["id","automationId","organizationId","triggerEventId","input","status","error","startedAt","finishedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"automations_run","description":"Get a single run with its step-by-step timeline: each block's resolved input, output, status, error, and latency. Use it to inspect what a run actually did, or to debug a FAILED run before automations.replay.","http":{"method":"GET","path":"/api/automations/{id}/runs/{runId}"},"feature":"automations","verb":"read","scope":"automations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"runId":{"type":"string"}},"required":["id","runId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"automationId":{"type":"string"},"organizationId":{"type":"string"},"triggerEventId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The outbox event that fired this run; null for a manual test run."},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The trigger payload the run was seeded with — what {{trigger.*}} resolved against."},"status":{"type":"string","enum":["RUNNING","SUCCEEDED","FAILED","CANCELLED"],"description":"FAILED pauses at the first failed step; a FAILED run can be resumed via replay."},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"blockId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The block this step executed; null if that block was later edited out of the graph."},"status":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","SKIPPED"],"description":"SKIPPED = no incoming edge had a succeeded source with a passing cond."},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The block's resolved input (bindings already substituted)."},"output":{"anyOf":[{},{"type":"null"}],"description":"The block's output — what downstream {{blocks.<id>.…}} bindings read."},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-based; transient action failures are retried."},"latencyMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","blockId","status","input","output","error","attempt","latencyMs","startedAt","finishedAt"],"additionalProperties":false}}},"required":["id","automationId","organizationId","triggerEventId","input","status","error","startedAt","finishedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"automations_runs","description":"List one automation's runs (history), newest first. Returns ONE page — default 25 rows, max 100 via `limit` — and renders as an interactive widget that pages in place. Fetch a single page; do not call this repeatedly to walk every page unless the user explicitly asks for the full history.","http":{"method":"GET","path":"/api/automations/{id}/runs"},"feature":"automations","verb":"read","scope":"automations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":25,"type":"integer","minimum":1,"maximum":100}},"required":["id","page","limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"automationId":{"type":"string"},"organizationId":{"type":"string"},"triggerEventId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The outbox event that fired this run; null for a manual test run."},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The trigger payload the run was seeded with — what {{trigger.*}} resolved against."},"status":{"type":"string","enum":["RUNNING","SUCCEEDED","FAILED","CANCELLED"],"description":"FAILED pauses at the first failed step; a FAILED run can be resumed via replay."},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"blockId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The block this step executed; null if that block was later edited out of the graph."},"status":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","SKIPPED"],"description":"SKIPPED = no incoming edge had a succeeded source with a passing cond."},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The block's resolved input (bindings already substituted)."},"output":{"anyOf":[{},{"type":"null"}],"description":"The block's output — what downstream {{blocks.<id>.…}} bindings read."},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-based; transient action failures are retried."},"latencyMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","blockId","status","input","output","error","attempt","latencyMs","startedAt","finishedAt"],"additionalProperties":false}}},"required":["id","automationId","organizationId","triggerEventId","input","status","error","startedAt","finishedAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["runs","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false},"meta":{"ui":{"resourceUri":"ui://guliel/automation-runs"},"ui/resourceUri":"ui://guliel/automation-runs","openai/outputTemplate":"ui://guliel/automation-runs"}},{"name":"automations_test_create","description":"Execute an automation synchronously with a sample trigger payload and return the finished run with its per-step results. Works on DRAFT automations — use it to verify a flow before enabling. Pass payload shaped like the trigger's payloadSchema from automations.catalog; if omitted it defaults to {} and {{trigger.*}} bindings resolve to nothing. ACTIONS REALLY EXECUTE (this is not a dry run). Runs under the automation OWNER's permissions, so the caller must be the owner or a MANAGER.","http":{"method":"POST","path":"/api/automations/{id}/test"},"feature":"automations","verb":"write","scope":"automations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"payload":{"description":"Sample trigger payload — the value {{trigger.*}} bindings resolve against. Shape it like the trigger's payloadSchema from automations.catalog. Defaults to {}.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"automationId":{"type":"string"},"organizationId":{"type":"string"},"triggerEventId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The outbox event that fired this run; null for a manual test run."},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The trigger payload the run was seeded with — what {{trigger.*}} resolved against."},"status":{"type":"string","enum":["RUNNING","SUCCEEDED","FAILED","CANCELLED"],"description":"FAILED pauses at the first failed step; a FAILED run can be resumed via replay."},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"blockId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The block this step executed; null if that block was later edited out of the graph."},"status":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","SKIPPED"],"description":"SKIPPED = no incoming edge had a succeeded source with a passing cond."},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The block's resolved input (bindings already substituted)."},"output":{"anyOf":[{},{"type":"null"}],"description":"The block's output — what downstream {{blocks.<id>.…}} bindings read."},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"attempt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-based; transient action failures are retried."},"latencyMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","blockId","status","input","output","error","attempt","latencyMs","startedAt","finishedAt"],"additionalProperties":false}}},"required":["id","automationId","organizationId","triggerEventId","input","status","error","startedAt","finishedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"automations_update","description":"Update an automation's name/description and/or replace its graph. Graph edits are whole-graph replacement: pass BOTH blocks AND edges together (same format as automations.create — at least one TRIGGER, acyclic); passing only one of the two is a 400. Historical run steps survive a graph edit. Requires CONTRIBUTOR+.","http":{"method":"PATCH","path":"/api/automations/{id}"},"feature":"automations","verb":"write","scope":"automations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"blocks":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Client-chosen id, unique within the automation. Edges reference blocks by this id, and downstream blocks read this block's output via {{blocks.<id>.…}} bindings."},"kind":{"type":"string","enum":["TRIGGER","FILTER","ACTION","CUSTOM"],"description":"TRIGGER starts the flow when its event fires (every automation needs at least one); FILTER queries org data and outputs a shaped list/value; ACTION invokes a tool; CUSTOM is reserved and not executable in v1."},"ref":{"description":"What the block invokes. TRIGGER: an event type from the catalog, e.g. \"invoice.paid\" or \"schedule.daily\" (GET /api/automations/actions lists them). ACTION: an MCP tool name, e.g. \"invoices.send\", or engine-native \"webhook.post\" / \"email.send\". FILTER: omit — the query lives in config.spec.","anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"config":{"description":"Kind-specific configuration. ACTION: { input: { … } } — the arguments for the tool named by ref, matching that tool's inputSchema from the catalog; values may embed {{…}} bindings ({{trigger.*}}, {{blocks.<id>.*}}, {{item.*}} under a FOR_EACH edge, {{context.now}}, {{context.today}}, {{context.orgId}}) — a whole-string binding like \"{{trigger.total}}\" keeps the value's native type, inline bindings interpolate into the string. FILTER: { spec: { root, follows?, predicates?, aggregateBy?, extract, shape? } } over the served filter catalog. TRIGGER: ignored.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"position":{"description":"Editor canvas hint ({ x, y }). Ignored by the engine.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","kind"],"additionalProperties":false}},"edges":{"maxItems":300,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Client-chosen id, unique within the automation."},"fromBlockId":{"type":"string","minLength":1,"description":"Id of the source block. The graph must be a DAG — self-loops and cycles are rejected."},"toBlockId":{"type":"string","minLength":1,"description":"Id of the target block. The target runs only after the source step succeeds and the cond (if any) passes."},"cond":{"description":"Optional guard — null/omitted means the edge is always followed. Leaf: { left, op, right? } with op one of eq | ne | gt | gte | lt | lte | in | nin | contains | exists | empty; compose with { all: […] }, { any: […] }, { not: … }. Operands may be literals or {{…}} bindings; comparisons are type-light (100 equals \"100\").","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"mode":{"description":"ONCE (default) passes the source output downstream as-is; FOR_EACH fans a list-valued source output out, running the target once per element (exposed as {{item.*}}) — a non-list source falls back to a single run.","type":"string","enum":["ONCE","FOR_EACH"]},"order":{"description":"Display ordering only — execution order is topological.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","fromBlockId","toBlockId"],"additionalProperties":false}}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"ownerUserId":{"type":"string","description":"The run-as identity: when the automation fires, actions execute under this user's current org permissions."},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["DRAFT","ENABLED","PAUSED","PAUSED_NO_ACCESS"],"description":"DRAFT = never armed; ENABLED = armed (fires on its trigger; the free tier allows 5 enabled per org); PAUSED = manually disarmed; PAUSED_NO_ACCESS = auto-paused because the owner lost the required org access."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"blocks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation. Edges reference blocks by this id, and downstream blocks read this block's output via {{blocks.<id>.…}} bindings."},"kind":{"type":"string","enum":["TRIGGER","FILTER","ACTION","CUSTOM"],"description":"TRIGGER starts the flow when its event fires (every automation needs at least one); FILTER queries org data and outputs a shaped list/value; ACTION invokes a tool; CUSTOM is reserved and not executable in v1."},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the block invokes. TRIGGER: an event type from the catalog, e.g. \"invoice.paid\" or \"schedule.daily\" (GET /api/automations/actions lists them). ACTION: an MCP tool name, e.g. \"invoices.send\", or engine-native \"webhook.post\" / \"email.send\". FILTER: omit — the query lives in config.spec."},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Kind-specific configuration. ACTION: { input: { … } } — the arguments for the tool named by ref, matching that tool's inputSchema from the catalog; values may embed {{…}} bindings ({{trigger.*}}, {{blocks.<id>.*}}, {{item.*}} under a FOR_EACH edge, {{context.now}}, {{context.today}}, {{context.orgId}}) — a whole-string binding like \"{{trigger.total}}\" keeps the value's native type, inline bindings interpolate into the string. FILTER: { spec: { root, follows?, predicates?, aggregateBy?, extract, shape? } } over the served filter catalog. TRIGGER: ignored."},"position":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Editor canvas hint ({ x, y }). Ignored by the engine."}},"required":["id","kind","ref","config","position"],"additionalProperties":false}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Client-chosen id, unique within the automation."},"fromBlockId":{"type":"string","description":"Id of the source block. The graph must be a DAG — self-loops and cycles are rejected."},"toBlockId":{"type":"string","description":"Id of the target block. The target runs only after the source step succeeds and the cond (if any) passes."},"cond":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Optional guard — null/omitted means the edge is always followed. Leaf: { left, op, right? } with op one of eq | ne | gt | gte | lt | lte | in | nin | contains | exists | empty; compose with { all: […] }, { any: […] }, { not: … }. Operands may be literals or {{…}} bindings; comparisons are type-light (100 equals \"100\")."},"mode":{"type":"string","enum":["ONCE","FOR_EACH"],"description":"ONCE (default) passes the source output downstream as-is; FOR_EACH fans a list-valued source output out, running the target once per element (exposed as {{item.*}}) — a non-list source falls back to a single run."},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Display ordering only — execution order is topological."}},"required":["id","fromBlockId","toBlockId","cond","mode","order"],"additionalProperties":false}}},"required":["id","organizationId","ownerUserId","name","description","status","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":true,"destructiveHint":false}},{"name":"bank_accounts_create","description":"Creates a new bank account in the target organization. Returns the created record on success.\n\n(Scope: bank_accounts:write · requires CONTRIBUTOR+ · endpoint: POST /api/bank-accounts)","http":{"method":"POST","path":"/api/bank-accounts"},"feature":"bank_accounts","verb":"write","scope":"bank_accounts:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"accountName":{"type":"string","minLength":1},"bankName":{"type":"string","minLength":1},"accountNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"currencies":{"default":["USD"],"type":"array","items":{"type":"string"}},"branchCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"localBankCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"swiftCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"type":"string"},{"type":"null"}]},"routingNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"default":false,"type":"boolean"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["organizationId","accountName","bankName","currencies","isDefault"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"accountName":{"type":"string"},"bankName":{"type":"string"},"accountNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"currencies":{"type":"array","items":{"type":"string"}},"branchCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"localBankCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"swiftCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"type":"string"},{"type":"null"}]},"routingNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","accountName","bankName","accountNumber","currencies","branchCode","localBankCode","swiftCode","iban","routingNumber","bankAddress","bankCountry","isDefault","notes","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"bank_accounts_delete","description":"Deletes the bank account. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: bank_accounts:write · endpoint: DELETE /api/bank-accounts/{id})","http":{"method":"DELETE","path":"/api/bank-accounts/{id}"},"feature":"bank_accounts","verb":"write","scope":"bank_accounts:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"bank_accounts_get","description":"Fetches a single bank account by id. Returns 404 if the bank account isn't in the caller's accessible organizations.\n\n(Scope: bank_accounts:read · endpoint: GET /api/bank-accounts/{id})","http":{"method":"GET","path":"/api/bank-accounts/{id}"},"feature":"bank_accounts","verb":"read","scope":"bank_accounts:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"accountName":{"type":"string"},"bankName":{"type":"string"},"accountNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"currencies":{"type":"array","items":{"type":"string"}},"branchCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"localBankCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"swiftCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"type":"string"},{"type":"null"}]},"routingNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","accountName","bankName","accountNumber","currencies","branchCode","localBankCode","swiftCode","iban","routingNumber","bankAddress","bankCountry","isDefault","notes","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"bank_accounts_list","description":"Lists bank accounts the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: bank_accounts:read · endpoint: GET /api/bank-accounts)","http":{"method":"GET","path":"/api/bank-accounts"},"feature":"bank_accounts","verb":"read","scope":"bank_accounts:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"bankAccounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"accountName":{"type":"string"},"bankName":{"type":"string"},"accountNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"currencies":{"type":"array","items":{"type":"string"}},"branchCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"localBankCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"swiftCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"type":"string"},{"type":"null"}]},"routingNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","accountName","bankName","accountNumber","currencies","branchCode","localBankCode","swiftCode","iban","routingNumber","bankAddress","bankCountry","isDefault","notes","createdAt","updatedAt"],"additionalProperties":false}}},"required":["bankAccounts"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false},"meta":{"ui":{"resourceUri":"ui://guliel/bank-accounts"},"ui/resourceUri":"ui://guliel/bank-accounts","openai/outputTemplate":"ui://guliel/bank-accounts"}},{"name":"bank_accounts_update","description":"Updates an existing bank account. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: bank_accounts:write · endpoint: PATCH /api/bank-accounts/{id})","http":{"method":"PATCH","path":"/api/bank-accounts/{id}"},"feature":"bank_accounts","verb":"write","scope":"bank_accounts:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"accountName":{"type":"string","minLength":1},"bankName":{"type":"string","minLength":1},"accountNumber":{"type":"string","minLength":1},"currencies":{"type":"array","items":{"type":"string"}},"branchCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"localBankCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"swiftCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"type":"string"},{"type":"null"}]},"routingNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"accountName":{"type":"string"},"bankName":{"type":"string"},"accountNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"currencies":{"type":"array","items":{"type":"string"}},"branchCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"localBankCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"swiftCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"type":"string"},{"type":"null"}]},"routingNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","accountName","bankName","accountNumber","currencies","branchCode","localBankCode","swiftCode","iban","routingNumber","bankAddress","bankCountry","isDefault","notes","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"companion_delete_session","description":"Removes the association without deleting the underlying record.\n\n(Scope: companion:write · endpoint: DELETE /api/companion/sessions/{id})","http":{"method":"DELETE","path":"/api/companion/sessions/{id}"},"feature":"companion","verb":"write","scope":"companion:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"companion_read_export","description":"Returns every `sessions/export` row associated with the given companion session.\n\n(Scope: companion:read · endpoint: GET /api/companion/sessions/{id}/export)","http":{"method":"GET","path":"/api/companion/sessions/{id}/export"},"feature":"companion","verb":"read","scope":"companion:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"],"additionalProperties":false},"outputSchema":null,"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"companion_read_runlog","description":"Returns every `sessions/runlog` row associated with the given companion session.\n\n(Scope: companion:read · endpoint: GET /api/companion/sessions/{id}/runlog)","http":{"method":"GET","path":"/api/companion/sessions/{id}/runlog"},"feature":"companion","verb":"read","scope":"companion:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":50,"type":"integer","minimum":1,"maximum":200}},"required":["id","page","limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["TOOL","AGENT","WORKFLOW","TEXT"]},"ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input":{},"output":{"anyOf":[{},{"type":"null"}]},"status":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","SKIPPED"]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"turnRunId":{"type":"string"}},"required":["id","kind","ref","parentId","order","input","output","status","error","turnRunId"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["steps","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"companion_read_session","description":"Returns every `sessions` row associated with the given companion session.\n\n(Scope: companion:read · endpoint: GET /api/companion/sessions/{id})","http":{"method":"GET","path":"/api/companion/sessions/{id}"},"feature":"companion","verb":"read","scope":"companion:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"title":{"type":"string"},"icon":{"type":"string"},"archived":{"type":"boolean"},"lastActivityAt":{"type":"string"},"createdAt":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["user","assistant"]},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"attachments":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"size":{"type":"number"},"type":{"type":"string"},"storageKey":{"type":"string"}},"required":["name","size","type","storageKey"],"additionalProperties":false}},{"type":"null"}]},"turnRunId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","role","index","text","attachments","turnRunId","createdAt"],"additionalProperties":false}},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["TOOL","AGENT","WORKFLOW","TEXT"]},"ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input":{},"output":{"anyOf":[{},{"type":"null"}]},"status":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","SKIPPED"]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"turnRunId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","ref","parentId","order","input","output","status","error","turnRunId"],"additionalProperties":false}},"activeTurnRunId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","organizationId","title","icon","archived","lastActivityAt","createdAt","messages","steps","activeTurnRunId"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"companion_read_sessions","description":"Returns the `sessions` data for the companion sessions feature.\n\n(Scope: companion:read · endpoint: GET /api/companion/sessions)","http":{"method":"GET","path":"/api/companion/sessions"},"feature":"companion","verb":"read","scope":"companion:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"sessions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"icon":{"type":"string"},"lastActivityAt":{"type":"string"},"archived":{"type":"boolean"},"live":{"type":"boolean"}},"required":["id","title","icon","lastActivityAt","archived","live"],"additionalProperties":false}}},"required":["sessions"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"companion_read_stream","description":"Returns every `sessions/stream` row associated with the given companion session.\n\n(Scope: companion:read · endpoint: GET /api/companion/sessions/{id}/stream)","http":{"method":"GET","path":"/api/companion/sessions/{id}/stream"},"feature":"companion","verb":"read","scope":"companion:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"lastEventId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id"],"additionalProperties":false},"outputSchema":null,"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"companion_read_turn","description":"Returns every `turns` row associated with the given companion session.\n\n(Scope: companion:read · endpoint: GET /api/companion/turns/{id})","http":{"method":"GET","path":"/api/companion/turns/{id}"},"feature":"companion","verb":"read","scope":"companion:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"afterSeq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"turnRunId":{"type":"string"},"sessionId":{"type":"string"},"status":{"type":"string","enum":["RUNNING","SUCCEEDED","FAILED","CANCELLED"]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["TOOL","AGENT","WORKFLOW","TEXT"]},"ref":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input":{},"output":{"anyOf":[{},{"type":"null"}]},"status":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","SKIPPED"]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"turnRunId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","ref","parentId","order","input","output","status","error","turnRunId"],"additionalProperties":false}},"tokens":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stepId":{"anyOf":[{"type":"string"},{"type":"null"}]},"delta":{"type":"string"}},"required":["seq","stepId","delta"],"additionalProperties":false}}},"required":["turnRunId","sessionId","status","startedAt","finishedAt","error","steps","tokens"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"companion_write_cancel_turn","description":"Creates a new `turns/cancel` attached to the given companion session.\n\n(Scope: companion:write · requires CONTRIBUTOR+ · endpoint: POST /api/companion/turns/{id}/cancel)","http":{"method":"POST","path":"/api/companion/turns/{id}/cancel"},"feature":"companion","verb":"write","scope":"companion:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"companion_write_messages","description":"Creates a new `sessions/messages` attached to the given companion session.\n\n(Scope: companion:write · requires CONTRIBUTOR+ · endpoint: POST /api/companion/sessions/{id}/messages)","http":{"method":"POST","path":"/api/companion/sessions/{id}/messages"},"feature":"companion","verb":"write","scope":"companion:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"text":{"type":"string","minLength":1},"attachments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"size":{"type":"number"},"type":{"type":"string"},"storageKey":{"type":"string"}},"required":["name","size","type","storageKey"],"additionalProperties":false}}},"required":["id","text"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"turnRunId":{"type":"string"}},"required":["turnRunId"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"companion_write_session","description":"Mutates the `sessions` attached to the given companion session.\n\n(Scope: companion:write · endpoint: PATCH /api/companion/sessions/{id})","http":{"method":"PATCH","path":"/api/companion/sessions/{id}"},"feature":"companion","verb":"write","scope":"companion:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"title":{"type":"string","minLength":1}},"required":["id","title"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"icon":{"type":"string"},"lastActivityAt":{"type":"string"},"archived":{"type":"boolean"},"live":{"type":"boolean"}},"required":["id","title","icon","lastActivityAt","archived","live"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"companion_write_sessions","description":"Performs the `sessions` operation for the companion sessions feature.\n\n(Scope: companion:write · requires CONTRIBUTOR+ · endpoint: POST /api/companion/sessions)","http":{"method":"POST","path":"/api/companion/sessions"},"feature":"companion","verb":"write","scope":"companion:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"sessionId":{"type":"string","minLength":1},"text":{"type":"string","minLength":1},"title":{"type":"string"},"icon":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"size":{"type":"number"},"type":{"type":"string"},"storageKey":{"type":"string"}},"required":["name","size","type","storageKey"],"additionalProperties":false}}},"required":["organizationId","sessionId","text"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"sessionId":{"type":"string"},"turnRunId":{"type":"string"}},"required":["sessionId","turnRunId"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"customers_create","description":"Creates a new customer in the target organization. Returns the created record on success.\n\n(Scope: customers:write · requires CONTRIBUTOR+ · endpoint: POST /api/customers)","http":{"method":"POST","path":"/api/customers"},"feature":"customers","verb":"write","scope":"customers:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"email":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"phone":{"type":"string"},"address":{"type":"string"},"country":{"type":"string","minLength":1},"registrationNumber":{"type":"string"},"defaultCurrencies":{"default":["USD"],"type":"array","items":{"type":"string"}},"kind":{"default":"ORGANIZATION","type":"string","enum":["ORGANIZATION","INDIVIDUAL"]}},"required":["organizationId","name","country","defaultCurrencies","kind"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"organizationId":{"type":"string"},"kind":{"anyOf":[{"type":"string","enum":["ORGANIZATION","INDIVIDUAL"]},{"type":"null"}],"description":"Which party kind this counterparty edge points at."},"displayName":{"type":"string","description":"Resolved through the consolidation morphism — from the linked Organization or Individual."},"displayAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayRegistrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"activeOrderCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalOrderCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"_count":{"type":"object","properties":{"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoices"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","email","phone","address","country","registrationNumber","defaultCurrencies","organizationId","kind","displayName","displayAddress","displayCountry","displayRegistrationNumber","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"customers_delete","description":"Deletes the customer. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: customers:write · endpoint: DELETE /api/customers/{id})","http":{"method":"DELETE","path":"/api/customers/{id}"},"feature":"customers","verb":"write","scope":"customers:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"customers_get","description":"Fetches a single customer by id. Returns 404 if the customer isn't in the caller's accessible organizations.\n\n(Scope: customers:read · endpoint: GET /api/customers/{id})","http":{"method":"GET","path":"/api/customers/{id}"},"feature":"customers","verb":"read","scope":"customers:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"organizationId":{"type":"string"},"kind":{"anyOf":[{"type":"string","enum":["ORGANIZATION","INDIVIDUAL"]},{"type":"null"}],"description":"Which party kind this counterparty edge points at."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["PENDING","ACTIVE","INACTIVE"]},"displayName":{"type":"string"},"displayAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayRegistrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"_count":{"type":"object","properties":{"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoices"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","email","phone","address","country","registrationNumber","defaultCurrencies","organizationId","kind","notes","status","displayName","displayAddress","displayCountry","displayRegistrationNumber","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false},"meta":{"ui":{"resourceUri":"ui://guliel/customer-detail"},"ui/resourceUri":"ui://guliel/customer-detail","openai/outputTemplate":"ui://guliel/customer-detail"}},{"name":"customers_list","description":"Lists customers the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: customers:read · endpoint: GET /api/customers)","http":{"method":"GET","path":"/api/customers"},"feature":"customers","verb":"read","scope":"customers:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":10,"type":"integer","minimum":1,"maximum":100},"search":{"default":"","type":"string"},"inSystem":{"anyOf":[{"type":"string","const":"true"},{"type":"string","const":"false"},{"type":"string","const":""}]},"kind":{"type":"string","enum":["ORGANIZATION","INDIVIDUAL"]},"sortBy":{"default":"createdAt","type":"string","enum":["name","email","createdAt","updatedAt"]},"sortOrder":{"default":"desc","type":"string","enum":["asc","desc"]}},"required":["organizationId","page","limit","search","sortBy","sortOrder"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"organizationId":{"type":"string"},"kind":{"anyOf":[{"type":"string","enum":["ORGANIZATION","INDIVIDUAL"]},{"type":"null"}],"description":"Which party kind this counterparty edge points at."},"displayName":{"type":"string","description":"Resolved through the consolidation morphism — from the linked Organization or Individual."},"displayAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayRegistrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"activeOrderCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalOrderCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"_count":{"type":"object","properties":{"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoices"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","email","phone","address","country","registrationNumber","defaultCurrencies","organizationId","kind","displayName","displayAddress","displayCountry","displayRegistrationNumber","createdAt","updatedAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["customers","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"customers_recipients_create","description":"Creates a new `recipients` attached to the given customer.\n\n(Scope: customers:write · endpoint: POST /api/customers/{id}/recipients)","http":{"method":"POST","path":"/api/customers/{id}/recipients"},"feature":"customers","verb":"write","scope":"customers:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string"}},"required":["id","email"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"customerId":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","customerId","email","name","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"customers_recipients_delete","description":"Removes the association without deleting the underlying record.\n\n(Scope: customers:write · endpoint: DELETE /api/customers/{id}/recipients)","http":{"method":"DELETE","path":"/api/customers/{id}/recipients"},"feature":"customers","verb":"write","scope":"customers:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"recipientId":{"type":"string"}},"required":["id","recipientId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"customers_recipients_list","description":"Returns every `recipients` row associated with the given customer.\n\n(Scope: customers:read · endpoint: GET /api/customers/{id}/recipients)","http":{"method":"GET","path":"/api/customers/{id}/recipients"},"feature":"customers","verb":"read","scope":"customers:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"customerId":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","customerId","email","name","createdAt","updatedAt"],"additionalProperties":false}},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"customers_replace","description":"Replaces an existing customer. All required fields must be supplied — omitted fields revert to their schema defaults.\n\n(Scope: customers:write · endpoint: PUT /api/customers/{id})","http":{"method":"PUT","path":"/api/customers/{id}"},"feature":"customers","verb":"write","scope":"customers:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"type":"string","minLength":1},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["PENDING","ACTIVE","INACTIVE"]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"organizationId":{"type":"string"},"kind":{"anyOf":[{"type":"string","enum":["ORGANIZATION","INDIVIDUAL"]},{"type":"null"}],"description":"Which party kind this counterparty edge points at."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["PENDING","ACTIVE","INACTIVE"]},"displayName":{"type":"string"},"displayAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayRegistrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"_count":{"type":"object","properties":{"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoices"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","email","phone","address","country","registrationNumber","defaultCurrencies","organizationId","kind","notes","status","displayName","displayAddress","displayCountry","displayRegistrationNumber","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"customers_update","description":"Updates an existing customer. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: customers:write · endpoint: PATCH /api/customers/{id})","http":{"method":"PATCH","path":"/api/customers/{id}"},"feature":"customers","verb":"write","scope":"customers:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"type":"string","minLength":1},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["PENDING","ACTIVE","INACTIVE"]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"organizationId":{"type":"string"},"kind":{"anyOf":[{"type":"string","enum":["ORGANIZATION","INDIVIDUAL"]},{"type":"null"}],"description":"Which party kind this counterparty edge points at."},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["PENDING","ACTIVE","INACTIVE"]},"displayName":{"type":"string"},"displayAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayRegistrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"_count":{"type":"object","properties":{"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoices"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","email","phone","address","country","registrationNumber","defaultCurrencies","organizationId","kind","notes","status","displayName","displayAddress","displayCountry","displayRegistrationNumber","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"dashboard_get","description":"Lists dashboard summaries the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: invoices:read · endpoint: GET /api/dashboard)","http":{"method":"GET","path":"/api/dashboard"},"feature":"invoices","verb":"read","scope":"invoices:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"year":{"type":"integer","minimum":2000,"maximum":2100},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"totalInvoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalRevenue":{"type":"number"},"outstandingAmount":{"type":"number"},"pendingAmount":{"type":"number"},"invoicesByStatus":{"type":"object","properties":{"draft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["draft","unsent","sent","paid"],"additionalProperties":false,"description":"Per-status counts of the org's invoices for the requested year."},"revenueByMonth":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string"},"revenue":{"type":"number"},"sent":{"type":"number"},"unsent":{"type":"number"},"draft":{"type":"number"}},"required":["month","revenue","sent","unsent","draft"],"additionalProperties":false}},"revenueByCustomer":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"revenue":{"type":"number"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name","revenue","count"],"additionalProperties":false},"description":"Top customers by revenue, sorted descending. Currency-converted to `displayCurrency`. `count` is that client's own number of PAID invoices."},"growth":{"type":"number","description":"YoY revenue growth percentage."},"displayCurrency":{"type":"string","description":"Currency that all monetary fields are converted to (the organization's primary currency)."},"exchangeRateDate":{"type":"string","description":"Date of the FX-rate snapshot used for conversions."},"pendingPaymentsList":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Open invoices awaiting payment, sorted by due date."},"expenseTotal":{"type":"number"},"expensesByMonth":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"expensesByVendor":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"expensesByEmployee":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"amount":{"type":"number"}},"required":["name","amount"],"additionalProperties":false},"description":"Employer payroll cost per employee (Σ EARNING + Σ EMPR_CONTRIBUTION over APPROVED+PAID payslips), converted to displayCurrency, sorted descending. A distinct party edge from vendors — PAYROLL_PLAN.md rule 8b. Σ(expensesByVendor) + Σ(expensesByEmployee) = approved expense total. Payroll-sensitive (HR ARCHITECTURE law 33c): without scope `payroll:read` AND role MANAGER this collapses to a single aggregate `Payroll (n employees)` row of the same total."},"paidInvoicesCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"approvedExpensesCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expenseGrowth":{"type":"number"},"netTotal":{"type":"number","description":"Revenue minus expenses, in displayCurrency."},"netGrowth":{"type":"number"},"marginPercent":{"type":"number"},"pendingExpensesTotal":{"type":"number"},"pendingExpensesCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pendingExpensesGrowth":{"type":"number"},"cashFlowByMonth":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"lowStockItemsCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activeItemsCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fxIncomplete":{"description":"True when one or more source currencies could not be converted to `displayCurrency` (missing FX rate). Those amounts were summed at face value — totals are approximate. Surfaced in ALL environments (data quality, not a diagnostic).","type":"boolean"},"fxMissingCurrencies":{"description":"Source currencies that lacked a usable rate to `displayCurrency`. Present (and non-empty) iff `fxIncomplete` is true.","type":"array","items":{"type":"string"}},"_diagnostics":{"description":"Only present in non-production environments — surfaces errors that were caught and logged but didn't abort the response.","type":"array","items":{"type":"string"}}},"required":["totalInvoices","totalRevenue","outstandingAmount","pendingAmount","invoicesByStatus","revenueByMonth","revenueByCustomer","growth","displayCurrency","exchangeRateDate","pendingPaymentsList","expenseTotal","expensesByMonth","expensesByVendor","expensesByEmployee","paidInvoicesCount","approvedExpensesCount","expenseGrowth","netTotal","netGrowth","marginPercent","pendingExpensesTotal","pendingExpensesCount","pendingExpensesGrowth","cashFlowByMonth","lowStockItemsCount","activeItemsCount"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false},"meta":{"ui":{"resourceUri":"ui://guliel/dashboard"},"ui/resourceUri":"ui://guliel/dashboard","openai/outputTemplate":"ui://guliel/dashboard"}},{"name":"expense_categories_create","description":"Creates a new expense category in the target organization. Returns the created record on success.\n\n(Scope: expenses:write · requires CONTRIBUTOR+ · endpoint: POST /api/expense-categories)","http":{"method":"POST","path":"/api/expense-categories"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"color":{"type":"string"}},"required":["organizationId","name"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isFallback":{"type":"boolean"},"_count":{"type":"object","properties":{"expenses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["expenses"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","color","isDefault","isFallback","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expense_categories_delete","description":"Deletes the expense category. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: expenses:write · endpoint: DELETE /api/expense-categories/{id})","http":{"method":"DELETE","path":"/api/expense-categories/{id}"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"expense_categories_list","description":"Lists expense categories the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: expenses:read · endpoint: GET /api/expense-categories)","http":{"method":"GET","path":"/api/expense-categories"},"feature":"expenses","verb":"read","scope":"expenses:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isFallback":{"type":"boolean"},"_count":{"type":"object","properties":{"expenses":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["expenses"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","color","isDefault","isFallback","createdAt","updatedAt"],"additionalProperties":false}}},"required":["categories"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"expense_categories_replace","description":"Replaces an existing expense category. All required fields must be supplied — omitted fields revert to their schema defaults.\n\n(Scope: expenses:write · endpoint: PUT /api/expense-categories/{id})","http":{"method":"PUT","path":"/api/expense-categories/{id}"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"color":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isFallback":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","color","isDefault","isFallback","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expense_categories_update","description":"Updates an existing expense category. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: expenses:write · endpoint: PATCH /api/expense-categories/{id})","http":{"method":"PATCH","path":"/api/expense-categories/{id}"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"color":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isFallback":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","color","isDefault","isFallback","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_attachments_get","description":"Serves the raw attached file for an expense. The URL embeds a signed token; clients shouldn't construct it directly.\n\n(Scope: expenses:read · endpoint: GET /api/expenses/attachments/{id})","http":{"method":"GET","path":"/api/expenses/attachments/{id}"},"feature":"expenses","verb":"read","scope":"expenses:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":null,"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_create","description":"Creates a new expense in the target organization. Returns the created record on success.\n\n(Scope: expenses:write · requires CONTRIBUTOR+ · endpoint: POST /api/expenses)","http":{"method":"POST","path":"/api/expenses"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"title":{"type":"string"},"vendor":{"type":"string"},"amount":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","minLength":1},"date":{"type":"string","minLength":1},"categoryId":{"type":"string"},"notes":{"type":"string"},"taxAmount":{"type":"number"},"taxRate":{"type":"number"},"paymentMethod":{"type":"string"},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"default":"MANUAL","type":"string","enum":["MANUAL","SCAN","EMAIL"]},"documentType":{"default":"INVOICE","type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST","CREDIT_MEMO","DEBIT_MEMO","FINE_NOTICE","CHARGE_CONFIRMATION","STATEMENT","SUMMARY"]},"officialDocumentNumber":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"customerIds":{"type":"array","items":{"type":"string"}},"employeeCounterpartyId":{"description":"Attribute this expense to an employee (a Counterparty id, isEmployee).","anyOf":[{"type":"string"},{"type":"null"}]},"paidByEmployee":{"description":"The employee fronted the money, so it is owed to THEM, not the vendor. Requires `employeeCounterpartyId`.","type":"boolean"},"benefitType":{"description":"Benefit-in-kind class; must be one of the country's benefit catalogue values.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["organizationId","amount","currency","date","source","documentType"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"subtotal":{"type":"number"},"currency":{"type":"string"},"date":{"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidAmount":{"type":"number"},"openBalance":{"type":"number"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"allocated":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","amount","allocated","paidAt","method"],"additionalProperties":false}},"source":{"type":"string"},"status":{"type":"string"},"documentType":{"type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST","CREDIT_MEMO","DEBIT_MEMO","FINE_NOTICE","CHARGE_CONFIRMATION","STATEMENT","SUMMARY"]},"officialDocumentNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountingTreatment":{"type":"string","enum":["BOOKABLE","OBLIGATION","PAYMENT_EVIDENCE","AGGREGATE"]},"obligationState":{"type":"string","enum":["OPEN","PARTIALLY_FULFILLED","FULFILLED","NOT_APPLICABLE"]},"fulfilledAmount":{"type":"number"},"identifiers":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"evidenceLinks":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"lineItems":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"attachments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"customers":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string"},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["customerId","customer"],"additionalProperties":false}},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"employeeCounterpartyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidByEmployee":{"type":"boolean"},"benefitType":{"anyOf":[{"type":"string"},{"type":"null"}]},"claimKind":{"type":"string","enum":["NONE","REIMBURSEMENT","BENEFIT","TAXABLE_REIMBURSEMENT"]},"employee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","description","amount","subtotal","currency","date","category","vendor","paymentMethod","recognitionStart","recognitionEnd","paidAmount","openBalance","payments","source","status","documentType","officialDocumentNumber","accountingTreatment","obligationState","fulfilledAmount","identifiers","evidenceLinks","lineItems","createdBy","employeeCounterpartyId","paidByEmployee","benefitType","claimKind","employee","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_csv_list","description":"Streams the caller's expenses as a CSV file. Filter parameters scope the export the same way the list endpoint does.\n\n(Scope: expenses:read · endpoint: GET /api/expenses/export/csv)","http":{"method":"GET","path":"/api/expenses/export/csv"},"feature":"expenses","verb":"read","scope":"expenses:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"status":{"type":"string"},"source":{"type":"string"},"categoryId":{"type":"string"},"treatment":{"type":"string","enum":["BOOKABLE","OBLIGATION","PAYMENT_EVIDENCE","AGGREGATE"]},"dateFrom":{"type":"string"},"dateTo":{"type":"string"},"employeeCounterpartyId":{"type":"string"},"claims":{"type":"string","enum":["true","false"]},"claimKind":{"type":"string","enum":["NONE","REIMBURSEMENT","BENEFIT","TAXABLE_REIMBURSEMENT"]}},"required":["organizationId"],"additionalProperties":false},"outputSchema":null,"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_customers_create","description":"Creates a new `customers` attached to the given expense.\n\n(Scope: expenses:write · endpoint: POST /api/expenses/{id}/customers)","http":{"method":"POST","path":"/api/expenses/{id}/customers"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"customerIds":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}}},"required":["id","customerIds"],"additionalProperties":false},"outputSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Updated expense with its full `customers` relation. See /api/expenses/[id] GET for the canonical shape."},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_customers_delete","description":"Removes the association without deleting the underlying record.\n\n(Scope: expenses:write · endpoint: DELETE /api/expenses/{id}/customers)","http":{"method":"DELETE","path":"/api/expenses/{id}/customers"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"customerId":{"type":"string","minLength":1}},"required":["id","customerId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"expenses_delete","description":"Deletes the expense. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: expenses:write · endpoint: DELETE /api/expenses/{id})","http":{"method":"DELETE","path":"/api/expenses/{id}"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"expenses_email_poll_create","description":"Pulls newly-arrived receipts from the connected mailbox and creates expenses for each one.\n\n(Scope: expenses:write · requires CONTRIBUTOR+ · endpoint: POST /api/expenses/email-poll)","http":{"method":"POST","path":"/api/expenses/email-poll"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"dateFrom":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"dateTo":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["organizationId","connectionId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"runId":{"type":"string","description":"IngestionRun id — poll /api/expenses/fetch-logs to track it."},"status":{"type":"string","enum":["PENDING"],"description":"Always PENDING — queued for the worker; never executes in this request."}},"required":["runId","status"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":true,"destructiveHint":false}},{"name":"expenses_get","description":"Fetches a single expense by id. Returns 404 if the expense isn't in the caller's accessible organizations.\n\n(Scope: expenses:read · endpoint: GET /api/expenses/{id})","http":{"method":"GET","path":"/api/expenses/{id}"},"feature":"expenses","verb":"read","scope":"expenses:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"subtotal":{"type":"number"},"currency":{"type":"string"},"date":{"type":"string"},"status":{"type":"string"},"documentType":{"type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST","CREDIT_MEMO","DEBIT_MEMO","FINE_NOTICE","CHARGE_CONFIRMATION","STATEMENT","SUMMARY"]},"officialDocumentNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountingTreatment":{"type":"string","enum":["BOOKABLE","OBLIGATION","PAYMENT_EVIDENCE","AGGREGATE"]},"obligationState":{"type":"string","enum":["OPEN","PARTIALLY_FULFILLED","FULFILLED","NOT_APPLICABLE"]},"fulfilledAmount":{"type":"number"},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidAmount":{"type":"number"},"openBalance":{"type":"number"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"allocated":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","amount","allocated","paidAt","method"],"additionalProperties":false}},"taxAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"emailMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","color"],"additionalProperties":false},{"type":"null"}]},"identifiers":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"evidenceLinks":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"lineItems":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"customers":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string"},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["customerId","customer"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"employeeCounterpartyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidByEmployee":{"type":"boolean"},"benefitType":{"anyOf":[{"type":"string"},{"type":"null"}]},"claimKind":{"type":"string","enum":["NONE","REIMBURSEMENT","BENEFIT","TAXABLE_REIMBURSEMENT"]},"employee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"order":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"orderNumber":{"type":"string"},"status":{"type":"string"},"subtotal":{"type":"number"},"currency":{"type":"string"},"orderDate":{"type":"string"},"supplier":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"supplierOrganization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","supplierOrganization"],"additionalProperties":false},{"type":"null"}]}},"required":["id","orderNumber","status","subtotal","currency","orderDate","supplier"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","title","description","vendor","amount","subtotal","currency","date","status","documentType","officialDocumentNumber","accountingTreatment","obligationState","fulfilledAmount","paymentMethod","paidAmount","openBalance","payments","taxAmount","taxRate","recognitionStart","recognitionEnd","notes","source","emailMessageId","category","identifiers","evidenceLinks","lineItems","customers","attachments","createdBy","employeeCounterpartyId","paidByEmployee","benefitType","claimKind","employee","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_links_update","description":"Mutates the `links` attached to the given expense.\n\n(Scope: expenses:write · endpoint: PATCH /api/expenses/{id}/links/{linkId})","http":{"method":"PATCH","path":"/api/expenses/{id}/links/{linkId}"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"linkId":{"type":"string"},"status":{"type":"string","enum":["CONFIRMED","REJECTED"]},"allocatedAmount":{"type":"number","exclusiveMinimum":0}},"required":["id","linkId","status"],"additionalProperties":false},"outputSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_list","description":"List an organization's expenses (incoming documents), newest first. Returns ONE page — default 25 rows, max 100 via `limit` — and renders as an interactive widget that pages in place. Fetch a single page and let the user page within the widget; do not call this repeatedly to walk every page unless they explicitly ask to export or total the entire list.","http":{"method":"GET","path":"/api/expenses"},"feature":"expenses","verb":"read","scope":"expenses:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":25,"type":"integer","minimum":1,"maximum":100},"search":{"default":"","type":"string"},"categoryId":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"documentType":{"type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST","CREDIT_MEMO","DEBIT_MEMO","FINE_NOTICE","CHARGE_CONFIRMATION","STATEMENT","SUMMARY"]},"treatment":{"type":"string","enum":["BOOKABLE","OBLIGATION","PAYMENT_EVIDENCE","AGGREGATE"]},"dateFrom":{"type":"string"},"dateTo":{"type":"string"},"minAmount":{"type":"string"},"maxAmount":{"type":"string"},"customerId":{"type":"string"},"employeeCounterpartyId":{"description":"Only expenses attributed to this employee (a Counterparty id).","type":"string"},"claims":{"description":"`true` ⇒ only expenses attributed to some employee.","type":"string","enum":["true","false"]},"claimKind":{"description":"The attribution quadrant, deduced from (paid out of pocket, benefit class): NONE / REIMBURSEMENT / BENEFIT / TAXABLE_REIMBURSEMENT.","type":"string","enum":["NONE","REIMBURSEMENT","BENEFIT","TAXABLE_REIMBURSEMENT"]},"sortBy":{"default":"date","type":"string","enum":["date","amount","vendor","createdAt"]},"sortOrder":{"default":"desc","type":"string","enum":["asc","desc"]}},"required":["organizationId","page","limit","search","sortBy","sortOrder"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"subtotal":{"type":"number"},"currency":{"type":"string"},"date":{"type":"string"},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidAmount":{"type":"number"},"openBalance":{"type":"number"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"allocated":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","amount","allocated","paidAt","method"],"additionalProperties":false}},"source":{"type":"string"},"status":{"type":"string"},"documentType":{"type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST","CREDIT_MEMO","DEBIT_MEMO","FINE_NOTICE","CHARGE_CONFIRMATION","STATEMENT","SUMMARY"]},"officialDocumentNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountingTreatment":{"type":"string","enum":["BOOKABLE","OBLIGATION","PAYMENT_EVIDENCE","AGGREGATE"]},"obligationState":{"type":"string","enum":["OPEN","PARTIALLY_FULFILLED","FULFILLED","NOT_APPLICABLE"]},"fulfilledAmount":{"type":"number"},"identifiers":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"evidenceLinks":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"lineItems":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"attachments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"customers":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string"},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["customerId","customer"],"additionalProperties":false}},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"employeeCounterpartyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidByEmployee":{"type":"boolean"},"benefitType":{"anyOf":[{"type":"string"},{"type":"null"}]},"claimKind":{"type":"string","enum":["NONE","REIMBURSEMENT","BENEFIT","TAXABLE_REIMBURSEMENT"]},"employee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","description","amount","subtotal","currency","date","category","vendor","paymentMethod","recognitionStart","recognitionEnd","paidAmount","openBalance","payments","source","status","documentType","officialDocumentNumber","accountingTreatment","obligationState","fulfilledAmount","identifiers","evidenceLinks","lineItems","createdBy","employeeCounterpartyId","paidByEmployee","benefitType","claimKind","employee","createdAt","updatedAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["expenses","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false},"meta":{"ui":{"resourceUri":"ui://guliel/expenses-list"},"ui/resourceUri":"ui://guliel/expenses-list","openai/outputTemplate":"ui://guliel/expenses-list"}},{"name":"expenses_manifest_list","description":"Streams the caller's expenses as a MANIFEST file. Filter parameters scope the export the same way the list endpoint does.\n\n(Scope: expenses:read · endpoint: GET /api/expenses/export/manifest)","http":{"method":"GET","path":"/api/expenses/export/manifest"},"feature":"expenses","verb":"read","scope":"expenses:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"ids":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"categoryId":{"type":"string"},"treatment":{"type":"string","enum":["BOOKABLE","OBLIGATION","PAYMENT_EVIDENCE","AGGREGATE"]},"dateFrom":{"type":"string"},"dateTo":{"type":"string"}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"generatedAt":{"type":"string"},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"string","description":"Decimal serialized as string to avoid float drift."},"currency":{"type":"string"},"taxAmount":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxRate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"source":{"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"fileType":{"anyOf":[{"type":"string"},{"type":"null"}]},"fileSize":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","fileName","fileType","fileSize"],"additionalProperties":false}},"createdBy":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}]}},"required":["id","date","vendor","title","category","amount","currency","taxAmount","taxRate","paymentMethod","status"],"additionalProperties":false}}},"required":["organization","generatedAt","expenses"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_match_review_create","description":"Performs the `match-review` operation for the expenses feature.\n\n(Scope: expenses:write · requires MANAGER+ · endpoint: POST /api/expenses/match-review)","http":{"method":"POST","path":"/api/expenses/match-review"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"cursor":{"type":"string","maxLength":2000},"limit":{"default":10,"type":"integer","minimum":1,"maximum":20}},"required":["organizationId","limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"forcedMode":{"type":"string","const":"suggest"},"processed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"succeeded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"candidateCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"linksWritten":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"done":{"type":"boolean"}},"required":["forcedMode","processed","succeeded","failed","candidateCount","linksWritten","nextCursor","done"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_match_review_list","description":"Returns the `match-review` data for the expenses feature.\n\n(Scope: expenses:read · requires MANAGER+ · endpoint: GET /api/expenses/match-review)","http":{"method":"GET","path":"/api/expenses/match-review"},"feature":"expenses","verb":"read","scope":"expenses:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":25,"type":"integer","minimum":1,"maximum":50}},"required":["organizationId","page","limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"runtimeMode":{"type":"string","enum":["report","suggest","auto"]},"suggestions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["FULFILLS","EVIDENCES_PAYMENT","SUMMARIZES"]},"status":{"type":"string","const":"SUGGESTED"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}]},"method":{"type":"string","enum":["EXACT_REFERENCE","SCORING"]},"matcherVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"evidence":{"type":"object","properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"runnerUpScore":{"anyOf":[{"type":"number"},{"type":"null"}]},"margin":{"anyOf":[{"type":"number"},{"type":"null"}]},"exactReference":{"type":"boolean"},"signals":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"points":{"type":"number"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","points","detail"],"additionalProperties":false}},"blockers":{"type":"array","items":{"type":"string"}}},"required":["score","runnerUpScore","margin","exactReference","signals","blockers"],"additionalProperties":false},"fromDocument":{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentType":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string"},"issueDate":{"type":"string"}},"required":["id","title","vendor","documentType","total","currency","issueDate"],"additionalProperties":false},"toDocument":{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentType":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string"},"issueDate":{"type":"string"}},"required":["id","title","vendor","documentType","total","currency","issueDate"],"additionalProperties":false}},"required":["id","type","status","confidence","method","matcherVersion","createdAt","updatedAt","evidence","fromDocument","toDocument"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false},"summary":{"type":"object","properties":{"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"confirmed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reviewed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acceptanceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"automaticConfirmed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"byRelation":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["FULFILLS","EVIDENCES_PAYMENT","SUMMARIZES"]},"pending":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"confirmed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rejected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reviewed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"acceptanceRate":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["type","pending","confirmed","rejected","reviewed","acceptanceRate"],"additionalProperties":false}}},"required":["pending","confirmed","rejected","reviewed","acceptanceRate","automaticConfirmed","byRelation"],"additionalProperties":false}},"required":["runtimeMode","suggestions","pagination","summary"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_payments_create","description":"Creates a new `payments` attached to the given expense.\n\n(Scope: expenses:write · requires CONTRIBUTOR+ · endpoint: POST /api/expenses/{id}/payments)","http":{"method":"POST","path":"/api/expenses/{id}/payments"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number","exclusiveMinimum":0},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"allowUnallocated":{"type":"boolean"}},"required":["id","amount","paidAt"],"additionalProperties":false},"outputSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Updated expense row after settlement."},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_replace","description":"Replaces an existing expense. All required fields must be supplied — omitted fields revert to their schema defaults.\n\n(Scope: expenses:write · endpoint: PUT /api/expenses/{id})","http":{"method":"PUT","path":"/api/expenses/{id}"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","minLength":1},"date":{"type":"string"},"documentType":{"type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST","CREDIT_MEMO","DEBIT_MEMO","FINE_NOTICE","CHARGE_CONFIRMATION","STATEMENT","SUMMARY"]},"officialDocumentNumber":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"categoryId":{"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"employeeCounterpartyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidByEmployee":{"type":"boolean"},"benefitType":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"subtotal":{"type":"number"},"currency":{"type":"string"},"date":{"type":"string"},"status":{"type":"string"},"documentType":{"type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST","CREDIT_MEMO","DEBIT_MEMO","FINE_NOTICE","CHARGE_CONFIRMATION","STATEMENT","SUMMARY"]},"officialDocumentNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountingTreatment":{"type":"string","enum":["BOOKABLE","OBLIGATION","PAYMENT_EVIDENCE","AGGREGATE"]},"obligationState":{"type":"string","enum":["OPEN","PARTIALLY_FULFILLED","FULFILLED","NOT_APPLICABLE"]},"fulfilledAmount":{"type":"number"},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidAmount":{"type":"number"},"openBalance":{"type":"number"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"allocated":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","amount","allocated","paidAt","method"],"additionalProperties":false}},"taxAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"emailMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","color"],"additionalProperties":false},{"type":"null"}]},"identifiers":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"evidenceLinks":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"lineItems":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"customers":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string"},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["customerId","customer"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"employeeCounterpartyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidByEmployee":{"type":"boolean"},"benefitType":{"anyOf":[{"type":"string"},{"type":"null"}]},"claimKind":{"type":"string","enum":["NONE","REIMBURSEMENT","BENEFIT","TAXABLE_REIMBURSEMENT"]},"employee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"order":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"orderNumber":{"type":"string"},"status":{"type":"string"},"subtotal":{"type":"number"},"currency":{"type":"string"},"orderDate":{"type":"string"},"supplier":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"supplierOrganization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","supplierOrganization"],"additionalProperties":false},{"type":"null"}]}},"required":["id","orderNumber","status","subtotal","currency","orderDate","supplier"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","title","description","vendor","amount","subtotal","currency","date","status","documentType","officialDocumentNumber","accountingTreatment","obligationState","fulfilledAmount","paymentMethod","paidAmount","openBalance","payments","taxAmount","taxRate","recognitionStart","recognitionEnd","notes","source","emailMessageId","category","identifiers","evidenceLinks","lineItems","customers","attachments","createdBy","employeeCounterpartyId","paidByEmployee","benefitType","claimKind","employee","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_scan_create","description":"Performs the `scan` operation for the expenses feature.\n\n(Scope: expenses:write · endpoint: POST /api/expenses/scan)","http":{"method":"POST","path":"/api/expenses/scan"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"attachmentId":{"type":"string","minLength":1}},"required":["attachmentId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"expenseId":{"type":"string","description":"Id of the scanned expense document."},"mergedIntoOrder":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"orderNumber":{"type":"string"}},"required":["id","orderNumber"],"additionalProperties":false},{"type":"null"}],"description":"When the scan matched an open purchase order, the order it was linked to — the scanned document joins that order's document chain."},"orderTransition":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extractedData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Raw OCR / AI extraction output (vendor, line items, totals, etc.). Empty object when the scan failed."},"vendorMatch":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"providerId":{"type":"string"},"processingTimeMs":{"type":"number"},"scanStatus":{"type":"string","enum":["COMPLETED","FAILED"],"description":"Whether the scan produced usable data and fields were applied (COMPLETED) or not (FAILED — empty/unreadable result, unsupported type, provider error, or duplicate)."},"scanError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Human-readable reason when scanStatus is FAILED; null on success."},"duplicateOfId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the scan was rejected as a duplicate (same org + externalDocId + vendor), the id of the existing document it duplicates; null otherwise."},"matching":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["expenseId","mergedIntoOrder","extractedData","providerId","processingTimeMs","scanStatus","scanError","duplicateOfId"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_status_update","description":"Mutates the state machine of the expense. Some transitions are restricted by role.\n\n(Scope: expenses:write · endpoint: PATCH /api/expenses/{id}/status)","http":{"method":"PATCH","path":"/api/expenses/{id}/status"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["DRAFT","PENDING_REVIEW","APPROVED","REJECTED"]},"reason":{"type":"string"}},"required":["id","status"],"additionalProperties":false},"outputSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Updated expense row with category/customers/attachments joined. See /api/expenses/[id] GET for the canonical shape."},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_update","description":"Updates an existing expense. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: expenses:write · endpoint: PATCH /api/expenses/{id})","http":{"method":"PATCH","path":"/api/expenses/{id}"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","minLength":1},"date":{"type":"string"},"documentType":{"type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST","CREDIT_MEMO","DEBIT_MEMO","FINE_NOTICE","CHARGE_CONFIRMATION","STATEMENT","SUMMARY"]},"officialDocumentNumber":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"categoryId":{"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"employeeCounterpartyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidByEmployee":{"type":"boolean"},"benefitType":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"},"subtotal":{"type":"number"},"currency":{"type":"string"},"date":{"type":"string"},"status":{"type":"string"},"documentType":{"type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST","CREDIT_MEMO","DEBIT_MEMO","FINE_NOTICE","CHARGE_CONFIRMATION","STATEMENT","SUMMARY"]},"officialDocumentNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountingTreatment":{"type":"string","enum":["BOOKABLE","OBLIGATION","PAYMENT_EVIDENCE","AGGREGATE"]},"obligationState":{"type":"string","enum":["OPEN","PARTIALLY_FULFILLED","FULFILLED","NOT_APPLICABLE"]},"fulfilledAmount":{"type":"number"},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidAmount":{"type":"number"},"openBalance":{"type":"number"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"allocated":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","amount","allocated","paidAt","method"],"additionalProperties":false}},"taxAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"type":"string"},"emailMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","color"],"additionalProperties":false},{"type":"null"}]},"identifiers":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"evidenceLinks":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"lineItems":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"customers":{"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string"},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["customerId","customer"],"additionalProperties":false}},"attachments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"employeeCounterpartyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidByEmployee":{"type":"boolean"},"benefitType":{"anyOf":[{"type":"string"},{"type":"null"}]},"claimKind":{"type":"string","enum":["NONE","REIMBURSEMENT","BENEFIT","TAXABLE_REIMBURSEMENT"]},"employee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"order":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"orderNumber":{"type":"string"},"status":{"type":"string"},"subtotal":{"type":"number"},"currency":{"type":"string"},"orderDate":{"type":"string"},"supplier":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"supplierOrganization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","supplierOrganization"],"additionalProperties":false},{"type":"null"}]}},"required":["id","orderNumber","status","subtotal","currency","orderDate","supplier"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","title","description","vendor","amount","subtotal","currency","date","status","documentType","officialDocumentNumber","accountingTreatment","obligationState","fulfilledAmount","paymentMethod","paidAmount","openBalance","payments","taxAmount","taxRate","recognitionStart","recognitionEnd","notes","source","emailMessageId","category","identifiers","evidenceLinks","lineItems","customers","attachments","createdBy","employeeCounterpartyId","paidByEmployee","benefitType","claimKind","employee","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_upload_create","description":"Performs the `upload` operation for the expenses feature.\n\n(Scope: expenses:write · endpoint: POST /api/expenses/upload)","http":{"method":"POST","path":"/api/expenses/upload"},"feature":"expenses","verb":"write","scope":"expenses:write","hasBody":true,"inputSchema":{"type":"object","properties":{},"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"expenseId":{"type":"string"},"fileName":{"type":"string"},"fileType":{"anyOf":[{"type":"string"},{"type":"null"}]},"fileSize":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"storageUrl":{"type":"string"}},"required":["id","expenseId","fileName","fileType","fileSize","storageUrl"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"expenses_usage_list","description":"Returns the caller's recent request log for the expense (last 7 days by default).\n\n(Scope: expenses:read · endpoint: GET /api/expenses/usage)","http":{"method":"GET","path":"/api/expenses/usage"},"feature":"expenses","verb":"read","scope":"expenses:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Scans consumed in the current billing period."},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Allowed scans for the org's plan."},"period":{"type":"string","description":"Billing period the counters cover, e.g. \"2026-05\"."}},"required":["used","limit","period"],"additionalProperties":false,"description":"Snapshot of the org's monthly OCR/scan quota usage."},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_employee_events_create","description":"Creates a new employee event in the target organization. Returns the created record on success.\n\n(Scope: hr:write · requires MANAGER+ · endpoint: POST /api/hr/employee-events)","http":{"method":"POST","path":"/api/hr/employee-events"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string","minLength":1},"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["organizationId","counterpartyId","body"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_employee_events_delete","description":"Deletes the employee event. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: hr:write · requires MANAGER+ · endpoint: DELETE /api/hr/employee-events)","http":{"method":"DELETE","path":"/api/hr/employee-events"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"id":{"type":"string","minLength":1}},"required":["organizationId","id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"hr_employee_events_list","description":"Lists employee events the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: hr:read · requires MANAGER+ · endpoint: GET /api/hr/employee-events)","http":{"method":"GET","path":"/api/hr/employee-events"},"feature":"hr","verb":"read","scope":"hr:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string","minLength":1},"cursor":{"description":"The id of the last row of the previous page.","type":"string"},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["organizationId","counterpartyId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"body":{"type":"string"},"actorUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"actorName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","createdAt","body","actorUserId","actorName"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["notes","nextCursor"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_employees_create","description":"Creates a new employee in the target organization. Returns the created record on success.\n\n(Scope: hr:write · requires CONTRIBUTOR+ · endpoint: POST /api/employees)","http":{"method":"POST","path":"/api/employees"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"email":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"dateOfBirth":{"anyOf":[{"type":"string"},{"type":"null"}]},"employeeCode":{"type":"string","maxLength":64},"probationEndsOn":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string","enum":["FEMALE","MALE","OTHER"]},{"type":"null"}]},"nationalId":{"anyOf":[{"type":"string"},{"type":"null"}]},"personData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"title":{"description":"Job title of the first position.","anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"basis":{"description":"Pay basis; defaults to MONTHLY.","type":"string","enum":["MONTHLY","HOURLY"]},"startDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}]},"rate":{"description":"Monthly wage, or hourly wage when `basis` is HOURLY.","anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"currency":{"type":"string"},"employmentData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["organizationId","name"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string","description":"The Counterparty id — an employee is a Counterparty edge."},"individualId":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateOfBirth":{"anyOf":[{"type":"string"},{"type":"null"}]},"employmentStart":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First day of the earliest employment term."},"employmentEnd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The LAST EMPLOYED DAY; null while any term is open (law 2b)."},"active":{"type":"boolean","description":"Some employment term covers today."},"currentTerm":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The INCLUSIVE last employed day; null while the term is open (law 2b)."},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Monthly wage for MONTHLY, hourly wage for HOURLY."},"currency":{"type":"string"},"employmentData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","title","startDate","lastDay","basis","rate","currency","employmentData"],"additionalProperties":false},{"type":"null"}],"description":"The open term, else the most recent closed one."},"employeeCode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"This tenant's employee number — unique per org, never reassigned (law 30)."},"gender":{"anyOf":[{"type":"string","enum":["FEMALE","MALE","OTHER"]},{"type":"null"}],"description":"Statutory eligibility input; MANAGER write, member read."},"probationEndsOn":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Probation end (exclusive)."},"inProbation":{"type":"boolean","description":"Fold: employmentStart ≤ today < probationEndsOn."},"maskedNationalId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The DEFAULT projection of the national identifier (law 32) — the mask, on every surface including lists, exports, MCP and the admin panel."},"nationalId":{"type":"string"},"personData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"photoAssetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"selfServiceActive":{"type":"boolean"}},"required":["id","individualId","name","email","dateOfBirth","employmentStart","employmentEnd","active","currentTerm","employeeCode","gender","probationEndsOn","inProbation","maskedNationalId","photoAssetId","selfServiceActive"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_employees_delete","description":"Deletes the employee. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: hr:write · endpoint: DELETE /api/employees/{id})","http":{"method":"DELETE","path":"/api/employees/{id}"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"lastDay":{"type":"string"},"purge":{"description":"MANAGER only — permanently delete a deactivated employee with no ledger history.","type":"string","enum":["true","false"]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string","description":"The Counterparty id — an employee is a Counterparty edge."},"individualId":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateOfBirth":{"anyOf":[{"type":"string"},{"type":"null"}]},"employmentStart":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First day of the earliest employment term."},"employmentEnd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The LAST EMPLOYED DAY; null while any term is open (law 2b)."},"active":{"type":"boolean","description":"Some employment term covers today."},"currentTerm":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The INCLUSIVE last employed day; null while the term is open (law 2b)."},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Monthly wage for MONTHLY, hourly wage for HOURLY."},"currency":{"type":"string"},"employmentData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","title","startDate","lastDay","basis","rate","currency","employmentData"],"additionalProperties":false},{"type":"null"}],"description":"The open term, else the most recent closed one."},"employeeCode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"This tenant's employee number — unique per org, never reassigned (law 30)."},"gender":{"anyOf":[{"type":"string","enum":["FEMALE","MALE","OTHER"]},{"type":"null"}],"description":"Statutory eligibility input; MANAGER write, member read."},"probationEndsOn":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Probation end (exclusive)."},"inProbation":{"type":"boolean","description":"Fold: employmentStart ≤ today < probationEndsOn."},"maskedNationalId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The DEFAULT projection of the national identifier (law 32) — the mask, on every surface including lists, exports, MCP and the admin panel."},"nationalId":{"type":"string"},"personData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"photoAssetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"selfServiceActive":{"type":"boolean"}},"required":["id","individualId","name","email","dateOfBirth","employmentStart","employmentEnd","active","currentTerm","employeeCode","gender","probationEndsOn","inProbation","maskedNationalId","photoAssetId","selfServiceActive"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"hr_employees_get","description":"Fetches a single employee by id. Returns 404 if the employee isn't in the caller's accessible organizations.\n\n(Scope: hr:read · endpoint: GET /api/employees/{id})","http":{"method":"GET","path":"/api/employees/{id}"},"feature":"hr","verb":"read","scope":"hr:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"reveal":{"description":"MANAGER only — return the unmasked national identifier (law 32).","type":"string","enum":["true","false"]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string","description":"The Counterparty id — an employee is a Counterparty edge."},"individualId":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateOfBirth":{"anyOf":[{"type":"string"},{"type":"null"}]},"employmentStart":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First day of the earliest employment term."},"employmentEnd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The LAST EMPLOYED DAY; null while any term is open (law 2b)."},"active":{"type":"boolean","description":"Some employment term covers today."},"currentTerm":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The INCLUSIVE last employed day; null while the term is open (law 2b)."},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Monthly wage for MONTHLY, hourly wage for HOURLY."},"currency":{"type":"string"},"employmentData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","title","startDate","lastDay","basis","rate","currency","employmentData"],"additionalProperties":false},{"type":"null"}],"description":"The open term, else the most recent closed one."},"employeeCode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"This tenant's employee number — unique per org, never reassigned (law 30)."},"gender":{"anyOf":[{"type":"string","enum":["FEMALE","MALE","OTHER"]},{"type":"null"}],"description":"Statutory eligibility input; MANAGER write, member read."},"probationEndsOn":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Probation end (exclusive)."},"inProbation":{"type":"boolean","description":"Fold: employmentStart ≤ today < probationEndsOn."},"maskedNationalId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The DEFAULT projection of the national identifier (law 32) — the mask, on every surface including lists, exports, MCP and the admin panel."},"nationalId":{"type":"string"},"personData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"photoAssetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"selfServiceActive":{"type":"boolean"}},"required":["id","individualId","name","email","dateOfBirth","employmentStart","employmentEnd","active","currentTerm","employeeCode","gender","probationEndsOn","inProbation","maskedNationalId","photoAssetId","selfServiceActive"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_employees_list","description":"Lists employees the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: hr:read · endpoint: GET /api/employees)","http":{"method":"GET","path":"/api/employees"},"feature":"hr","verb":"read","scope":"hr:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"search":{"default":"","type":"string"},"includeInactive":{"type":"string","enum":["true","false"]}},"required":["organizationId","search"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"employees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The Counterparty id — an employee is a Counterparty edge."},"individualId":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateOfBirth":{"anyOf":[{"type":"string"},{"type":"null"}]},"employmentStart":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First day of the earliest employment term."},"employmentEnd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The LAST EMPLOYED DAY; null while any term is open (law 2b)."},"active":{"type":"boolean","description":"Some employment term covers today."},"currentTerm":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The INCLUSIVE last employed day; null while the term is open (law 2b)."},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Monthly wage for MONTHLY, hourly wage for HOURLY."},"currency":{"type":"string"},"employmentData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","title","startDate","lastDay","basis","rate","currency","employmentData"],"additionalProperties":false},{"type":"null"}],"description":"The open term, else the most recent closed one."},"employeeCode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"This tenant's employee number — unique per org, never reassigned (law 30)."},"gender":{"anyOf":[{"type":"string","enum":["FEMALE","MALE","OTHER"]},{"type":"null"}],"description":"Statutory eligibility input; MANAGER write, member read."},"probationEndsOn":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Probation end (exclusive)."},"inProbation":{"type":"boolean","description":"Fold: employmentStart ≤ today < probationEndsOn."},"maskedNationalId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The DEFAULT projection of the national identifier (law 32) — the mask, on every surface including lists, exports, MCP and the admin panel."},"nationalId":{"type":"string"},"personData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"photoAssetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"selfServiceActive":{"type":"boolean"}},"required":["id","individualId","name","email","dateOfBirth","employmentStart","employmentEnd","active","currentTerm","employeeCode","gender","probationEndsOn","inProbation","maskedNationalId","photoAssetId","selfServiceActive"],"additionalProperties":false}}},"required":["employees"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_employees_photo_delete","description":"Removes the association without deleting the underlying record.\n\n(Scope: hr:write · endpoint: DELETE /api/employees/{id}/photo)","http":{"method":"DELETE","path":"/api/employees/{id}/photo"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"hr_employees_photo_get","description":"Returns every `photo` row associated with the given employee.\n\n(Scope: hr:read · endpoint: GET /api/employees/{id}/photo)","http":{"method":"GET","path":"/api/employees/{id}/photo"},"feature":"hr","verb":"read","scope":"hr:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"asset":{"description":"The asset id; the URL is immutable per asset.","type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":null,"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_employees_photo_upload","description":"Creates a new `photo` attached to the given employee.\n\n(Scope: hr:write · endpoint: POST /api/employees/{id}/photo)","http":{"method":"POST","path":"/api/employees/{id}/photo"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"photoAssetId":{"type":"string"},"url":{"type":"string","description":"Same-origin URL where the freshly-uploaded photo can be fetched."}},"required":["photoAssetId","url"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_employees_update","description":"Updates an existing employee. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: hr:write · endpoint: PATCH /api/employees/{id})","http":{"method":"PATCH","path":"/api/employees/{id}"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"email":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},"dateOfBirth":{"anyOf":[{"type":"string"},{"type":"null"}]},"employeeCode":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"probationEndsOn":{"anyOf":[{"type":"string"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string","enum":["FEMALE","MALE","OTHER"]},{"type":"null"}]},"nationalId":{"anyOf":[{"type":"string"},{"type":"null"}]},"personData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"startDate":{"type":"string"},"lastDay":{"type":"string"},"rate":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"currency":{"type":"string"},"employmentData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"rehireFrom":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string","description":"The Counterparty id — an employee is a Counterparty edge."},"individualId":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"dateOfBirth":{"anyOf":[{"type":"string"},{"type":"null"}]},"employmentStart":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"First day of the earliest employment term."},"employmentEnd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The LAST EMPLOYED DAY; null while any term is open (law 2b)."},"active":{"type":"boolean","description":"Some employment term covers today."},"currentTerm":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The INCLUSIVE last employed day; null while the term is open (law 2b)."},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Monthly wage for MONTHLY, hourly wage for HOURLY."},"currency":{"type":"string"},"employmentData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","title","startDate","lastDay","basis","rate","currency","employmentData"],"additionalProperties":false},{"type":"null"}],"description":"The open term, else the most recent closed one."},"employeeCode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"This tenant's employee number — unique per org, never reassigned (law 30)."},"gender":{"anyOf":[{"type":"string","enum":["FEMALE","MALE","OTHER"]},{"type":"null"}],"description":"Statutory eligibility input; MANAGER write, member read."},"probationEndsOn":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Probation end (exclusive)."},"inProbation":{"type":"boolean","description":"Fold: employmentStart ≤ today < probationEndsOn."},"maskedNationalId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The DEFAULT projection of the national identifier (law 32) — the mask, on every surface including lists, exports, MCP and the admin panel."},"nationalId":{"type":"string"},"personData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"photoAssetId":{"anyOf":[{"type":"string"},{"type":"null"}]},"selfServiceActive":{"type":"boolean"}},"required":["id","individualId","name","email","dateOfBirth","employmentStart","employmentEnd","active","currentTerm","employeeCode","gender","probationEndsOn","inProbation","maskedNationalId","photoAssetId","selfServiceActive"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_leaves_balances","description":"Returns the `balances` data for the leave requests feature.\n\n(Scope: hr:read · endpoint: GET /api/hr/leaves/balances)","http":{"method":"GET","path":"/api/hr/leaves/balances"},"feature":"hr","verb":"read","scope":"hr:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string","minLength":1},"at":{"type":"string"}},"required":["organizationId","counterpartyId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"counterpartyId":{"type":"string"},"basis":{"type":"string","enum":["STATUTORY","COMPANY_POLICY"]},"balances":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"label":{"type":"string"},"windowStart":{"type":"string"},"windowEnd":{"type":"string"},"entitled":{"type":"number"},"carriedIn":{"type":"number"},"used":{"type":"number"},"balance":{"type":"number"},"capped":{"type":"boolean"}},"required":["kind","label","windowStart","windowEnd","entitled","carriedIn","used","balance","capped"],"additionalProperties":false}}},"required":["counterpartyId","basis","balances"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_leaves_cancel","description":"Creates a new `cancel` attached to the given leave request.\n\n(Scope: hr:write · requires CONTRIBUTOR+ · endpoint: POST /api/hr/leaves/{id}/cancel)","http":{"method":"POST","path":"/api/hr/leaves/{id}/cancel"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"id":{"type":"string","minLength":1},"decisionNote":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["organizationId","id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","const":"CANCELLED"}},"required":["id","status"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"hr_leaves_create","description":"Creates a new leave request in the target organization. Returns the created record on success.\n\n(Scope: hr:write · requires CONTRIBUTOR+ · endpoint: POST /api/hr/leaves)","http":{"method":"POST","path":"/api/hr/leaves"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string","minLength":1},"kind":{"type":"string","minLength":1},"startDate":{"type":"string"},"lastDay":{"type":"string"},"days":{"type":"number","exclusiveMinimum":0},"hours":{"type":"number","exclusiveMinimum":0},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["organizationId","counterpartyId","kind","startDate","lastDay","days"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_leaves_decide","description":"Creates a new `decide` attached to the given leave request.\n\n(Scope: hr:write · requires MANAGER+ · endpoint: POST /api/hr/leaves/{id}/decide)","http":{"method":"POST","path":"/api/hr/leaves/{id}/decide"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"id":{"type":"string","minLength":1},"status":{"type":"string","enum":["APPROVED","REJECTED"]},"decisionNote":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["organizationId","id","status"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["APPROVED","REJECTED"]}},"required":["id","status"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_leaves_get","description":"Fetches a single leave request by id. Returns 404 if the leave request isn't in the caller's accessible organizations.\n\n(Scope: hr:read · endpoint: GET /api/hr/leaves/{id})","http":{"method":"GET","path":"/api/hr/leaves/{id}"},"feature":"hr","verb":"read","scope":"hr:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"id":{"type":"string","minLength":1}},"required":["organizationId","id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"employeeName":{"type":"string"},"kind":{"type":"string"},"startDate":{"type":"string"},"lastDay":{"type":"string"},"days":{"type":"number"},"hours":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","enum":["REQUESTED","APPROVED","REJECTED","CANCELLED"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"decisionNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","counterpartyId","employeeName","kind","startDate","lastDay","days","hours","status","note","decidedAt","decisionNote"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_leaves_list","description":"Lists leave requests the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: hr:read · endpoint: GET /api/hr/leaves)","http":{"method":"GET","path":"/api/hr/leaves"},"feature":"hr","verb":"read","scope":"hr:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string"},"status":{"type":"string","enum":["REQUESTED","APPROVED","REJECTED","CANCELLED"]},"from":{"type":"string"},"to":{"type":"string"}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"leaves":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"employeeName":{"type":"string"},"kind":{"type":"string"},"startDate":{"type":"string"},"lastDay":{"type":"string"},"days":{"type":"number"},"hours":{"anyOf":[{"type":"number"},{"type":"null"}]},"status":{"type":"string","enum":["REQUESTED","APPROVED","REJECTED","CANCELLED"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"decisionNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","counterpartyId","employeeName","kind","startDate","lastDay","days","hours","status","note","decidedAt","decisionNote"],"additionalProperties":false}}},"required":["leaves"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_leaves_update","description":"Updates an existing leave request. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: hr:write · requires CONTRIBUTOR+ · endpoint: PATCH /api/hr/leaves/{id})","http":{"method":"PATCH","path":"/api/hr/leaves/{id}"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"id":{"type":"string","minLength":1},"startDate":{"type":"string"},"lastDay":{"type":"string"},"days":{"type":"number","exclusiveMinimum":0},"hours":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["organizationId","id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_me_get","description":"Lists own employee records the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: hr:read · requires VIEWER+ · endpoint: GET /api/hr/me)","http":{"method":"GET","path":"/api/hr/me"},"feature":"hr","verb":"read","scope":"hr:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"from":{"type":"string"},"to":{"type":"string"}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"counterpartyId":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"employeeCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"openSession":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"employeeName":{"anyOf":[{"type":"string"},{"type":"null"}]},"startAt":{"type":"string","description":"ISO instant, server-stamped for a CLOCK punch."},"endAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"null ⟺ the session is open (law 18)."},"source":{"type":"string","enum":["CLOCK","MANUAL"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"editedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalStartAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"originalEndAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"hours":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","counterpartyId","employeeName","startAt","endAt","source","note","approvedAt","approvedByUserId","editedAt","originalStartAt","originalEndAt","hours"],"additionalProperties":false},{"type":"null"}]},"todayHours":{"type":"number"},"periodHours":{"type":"number"},"timezone":{"type":"string"}},"required":["counterpartyId","name","employeeCode","openSession","todayHours","periodHours","timezone"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_me_payslips_list","description":"Returns the `payslips` data for the own employee records feature.\n\n(Scope: payroll:read · endpoint: GET /api/hr/me/payslips)","http":{"method":"GET","path":"/api/hr/me/payslips"},"feature":"payroll","verb":"read","scope":"payroll:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"year":{"type":"integer","minimum":2000,"maximum":2200}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"payslips":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"total":{"type":"number"},"periodStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"issueDate":{"type":"string"}},"required":["id","status","currency","total","periodStart","periodEnd","issueDate"],"additionalProperties":false}}},"required":["payslips"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_self_service_set","description":"Creates a new self service in the target organization. Returns the created record on success.\n\n(Scope: hr:write · requires MANAGER+ · auth: SESSION only · endpoint: POST /api/hr/self-service)","http":{"method":"POST","path":"/api/hr/self-service"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string","minLength":1},"enabled":{"type":"boolean"}},"required":["organizationId","counterpartyId","enabled"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userId":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"invited":{"type":"boolean"}},"required":["enabled","userId","email","invited"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_terms_create","description":"Creates a new employment term in the target organization. Returns the created record on success.\n\n(Scope: hr:write · requires MANAGER+ · endpoint: POST /api/hr/terms)","http":{"method":"POST","path":"/api/hr/terms"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string","minLength":1},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"currency":{"type":"string"},"employmentData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"leaveGrants":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["organizationId","counterpartyId","startDate"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"terms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The INCLUSIVE last employed day; null while the term is open (law 2b)."},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Monthly wage for MONTHLY, hourly wage for HOURLY."},"currency":{"type":"string"},"employmentData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"leaveGrants":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["id","title","startDate","lastDay","basis","rate","currency","employmentData","leaveGrants"],"additionalProperties":false}},"positions":{"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last day held; null while the position is current."},"current":{"type":"boolean"},"termIds":{"type":"array","items":{"type":"string"},"description":"The terms coalesced into this position, in order — join against `terms`."}},"required":["title","startDate","lastDay","current","termIds"],"additionalProperties":false}},"careerEvents":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HIRED","REHIRED","TITLE_CHANGE","TRACK_CHANGE","RATE_CHANGE","TERMINATED"]},"date":{"type":"string","description":"The day the change took effect; for TERMINATED, the last employed day."},"termId":{"type":"string"},"facts":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"}},"required":["title","basis","rate","currency"],"additionalProperties":false},"previous":{"anyOf":[{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"}},"required":["title","basis","rate","currency"],"additionalProperties":false},{"type":"null"}],"description":"The preceding term's facts; null at HIRED / REHIRED."}},"required":["type","date","termId","facts","previous"],"additionalProperties":false}}},"required":["terms","positions","careerEvents"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_terms_delete","description":"Deletes the employment term. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: hr:write · requires MANAGER+ · endpoint: DELETE /api/hr/terms/{id})","http":{"method":"DELETE","path":"/api/hr/terms/{id}"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string","minLength":1}},"required":["id","organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"terms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The INCLUSIVE last employed day; null while the term is open (law 2b)."},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Monthly wage for MONTHLY, hourly wage for HOURLY."},"currency":{"type":"string"},"employmentData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"leaveGrants":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["id","title","startDate","lastDay","basis","rate","currency","employmentData","leaveGrants"],"additionalProperties":false}},"positions":{"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last day held; null while the position is current."},"current":{"type":"boolean"},"termIds":{"type":"array","items":{"type":"string"},"description":"The terms coalesced into this position, in order — join against `terms`."}},"required":["title","startDate","lastDay","current","termIds"],"additionalProperties":false}},"careerEvents":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HIRED","REHIRED","TITLE_CHANGE","TRACK_CHANGE","RATE_CHANGE","TERMINATED"]},"date":{"type":"string","description":"The day the change took effect; for TERMINATED, the last employed day."},"termId":{"type":"string"},"facts":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"}},"required":["title","basis","rate","currency"],"additionalProperties":false},"previous":{"anyOf":[{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"}},"required":["title","basis","rate","currency"],"additionalProperties":false},{"type":"null"}],"description":"The preceding term's facts; null at HIRED / REHIRED."}},"required":["type","date","termId","facts","previous"],"additionalProperties":false}}},"required":["terms","positions","careerEvents"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"hr_terms_list","description":"Lists employment terms the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: hr:read · endpoint: GET /api/hr/terms)","http":{"method":"GET","path":"/api/hr/terms"},"feature":"hr","verb":"read","scope":"hr:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string","minLength":1}},"required":["organizationId","counterpartyId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"terms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The INCLUSIVE last employed day; null while the term is open (law 2b)."},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Monthly wage for MONTHLY, hourly wage for HOURLY."},"currency":{"type":"string"},"employmentData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"leaveGrants":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["id","title","startDate","lastDay","basis","rate","currency","employmentData","leaveGrants"],"additionalProperties":false}},"positions":{"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last day held; null while the position is current."},"current":{"type":"boolean"},"termIds":{"type":"array","items":{"type":"string"},"description":"The terms coalesced into this position, in order — join against `terms`."}},"required":["title","startDate","lastDay","current","termIds"],"additionalProperties":false}},"careerEvents":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HIRED","REHIRED","TITLE_CHANGE","TRACK_CHANGE","RATE_CHANGE","TERMINATED"]},"date":{"type":"string","description":"The day the change took effect; for TERMINATED, the last employed day."},"termId":{"type":"string"},"facts":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"}},"required":["title","basis","rate","currency"],"additionalProperties":false},"previous":{"anyOf":[{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"}},"required":["title","basis","rate","currency"],"additionalProperties":false},{"type":"null"}],"description":"The preceding term's facts; null at HIRED / REHIRED."}},"required":["type","date","termId","facts","previous"],"additionalProperties":false}}},"required":["terms","positions","careerEvents"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"hr_terms_update","description":"Updates an existing employment term. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: hr:write · requires MANAGER+ · endpoint: PATCH /api/hr/terms/{id})","http":{"method":"PATCH","path":"/api/hr/terms/{id}"},"feature":"hr","verb":"write","scope":"hr:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string","minLength":1},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"currency":{"type":"string"},"employmentData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"leaveGrants":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["id","organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"terms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The INCLUSIVE last employed day; null while the term is open (law 2b)."},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Monthly wage for MONTHLY, hourly wage for HOURLY."},"currency":{"type":"string"},"employmentData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"leaveGrants":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["id","title","startDate","lastDay","basis","rate","currency","employmentData","leaveGrants"],"additionalProperties":false}},"positions":{"type":"array","items":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"lastDay":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last day held; null while the position is current."},"current":{"type":"boolean"},"termIds":{"type":"array","items":{"type":"string"},"description":"The terms coalesced into this position, in order — join against `terms`."}},"required":["title","startDate","lastDay","current","termIds"],"additionalProperties":false}},"careerEvents":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HIRED","REHIRED","TITLE_CHANGE","TRACK_CHANGE","RATE_CHANGE","TERMINATED"]},"date":{"type":"string","description":"The day the change took effect; for TERMINATED, the last employed day."},"termId":{"type":"string"},"facts":{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"}},"required":["title","basis","rate","currency"],"additionalProperties":false},"previous":{"anyOf":[{"type":"object","properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"basis":{"type":"string","enum":["MONTHLY","HOURLY"]},"rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"}},"required":["title","basis","rate","currency"],"additionalProperties":false},{"type":"null"}],"description":"The preceding term's facts; null at HIRED / REHIRED."}},"required":["type","date","termId","facts","previous"],"additionalProperties":false}}},"required":["terms","positions","careerEvents"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"imports_cancel_create","description":"Creates a new `cancel` attached to the given import run.\n\n(Scope: imports:write · requires MANAGER+ · endpoint: POST /api/imports/{id}/cancel)","http":{"method":"POST","path":"/api/imports/{id}/cancel"},"feature":"imports","verb":"write","scope":"imports:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"imports_columns_list","description":"Returns every `upload/columns` row associated with the given import run.\n\n(Scope: imports:read · requires MANAGER+ · endpoint: GET /api/imports/upload/{id}/columns)","http":{"method":"GET","path":"/api/imports/upload/{id}/columns"},"feature":"imports","verb":"read","scope":"imports:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1},"profileId":{"type":"string","minLength":1}},"required":["id","organizationId","profileId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"headers":{"type":"array","items":{"type":"string"}},"rowCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mapped":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"missingRequired":{"type":"array","items":{"type":"string"}},"unmapped":{"type":"array","items":{"type":"string"}}},"required":["headers","rowCount","mapped","missingRequired","unmapped"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"imports_commit_create","description":"Creates a new `commit` attached to the given import run.\n\n(Scope: imports:write · requires MANAGER+ · endpoint: POST /api/imports/{id}/commit)","http":{"method":"POST","path":"/api/imports/{id}/commit"},"feature":"imports","verb":"write","scope":"imports:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"committed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","status","committed","skipped","failed"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"imports_create","description":"Creates a new import run in the target organization. Returns the created record on success.\n\n(Scope: imports:write · requires MANAGER+ · endpoint: POST /api/imports)","http":{"method":"POST","path":"/api/imports"},"feature":"imports","verb":"write","scope":"imports:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"sourceId":{"type":"string","minLength":1},"scope":{"type":"object","properties":{"entityTypes":{"minItems":1,"type":"array","items":{"type":"string","enum":["CLIENT","ITEM","DOCUMENT","EXPENSE"]}}},"required":["entityTypes"],"additionalProperties":false},"uploadId":{"type":"string"},"profileId":{"type":"string"}},"required":["organizationId","sourceId","scope"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"run":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"sourceId":{"type":"string"},"status":{"type":"string"},"entityTypes":{"type":"array","items":{"type":"string"}},"uploadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"profileId":{"anyOf":[{"type":"string"},{"type":"null"}]},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"fetched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"staged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["fetched","staged","invalid"],"additionalProperties":false}},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","organizationId","sourceId","status","entityTypes","uploadId","profileId","counts","errorMessage","startedAt","completedAt"],"additionalProperties":false}},"required":["run"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"imports_get","description":"Fetches a single import run by id. Returns 404 if the import run isn't in the caller's accessible organizations.\n\n(Scope: imports:read · endpoint: GET /api/imports/{id})","http":{"method":"GET","path":"/api/imports/{id}"},"feature":"imports","verb":"read","scope":"imports:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"run":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"sourceId":{"type":"string"},"status":{"type":"string"},"entityTypes":{"type":"array","items":{"type":"string"}},"uploadId":{"anyOf":[{"type":"string"},{"type":"null"}]},"profileId":{"anyOf":[{"type":"string"},{"type":"null"}]},"counts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"fetched":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"staged":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invalid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["fetched","staged","invalid"],"additionalProperties":false}},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","organizationId","sourceId","status","entityTypes","uploadId","profileId","counts","errorMessage","startedAt","completedAt"],"additionalProperties":false},"records":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"willImport":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"byClassification":{"type":"object","propertyNames":{"type":"string","enum":["NEW","EXACT_DUPLICATE","PROBABLE_MATCH","INVALID"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["NEW","EXACT_DUPLICATE","PROBABLE_MATCH","INVALID"]},"byDecision":{"type":"object","propertyNames":{"type":"string","enum":["PENDING","IMPORT","SKIP","MERGE"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["PENDING","IMPORT","SKIP","MERGE"]}},"required":["total","willImport","byClassification","byDecision"],"additionalProperties":false}},"required":["run","records"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"imports_records_list","description":"Returns every `records` row associated with the given import run.\n\n(Scope: imports:read · endpoint: GET /api/imports/{id}/records)","http":{"method":"GET","path":"/api/imports/{id}/records"},"feature":"imports","verb":"read","scope":"imports:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"entityType":{"type":"string","enum":["CLIENT","ITEM","DOCUMENT","EXPENSE"]},"classification":{"type":"string","enum":["NEW","EXACT_DUPLICATE","PROBABLE_MATCH","INVALID"]},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":10,"type":"integer","minimum":1,"maximum":200}},"required":["id","page","limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"entityType":{"type":"string"},"externalId":{"type":"string"},"normalized":{},"classification":{"type":"string"},"matchedLocalId":{"anyOf":[{"type":"string"},{"type":"null"}]},"matchConfidence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"matchEvidence":{"anyOf":[{},{"type":"null"}]},"decision":{"type":"string"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}]},"localId":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","entityType","externalId","normalized","classification","matchedLocalId","matchConfidence","matchEvidence","decision","outcome","localId","errorMessage"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["records","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"imports_records_update","description":"Mutates the `records` attached to the given import run.\n\n(Scope: imports:write · requires MANAGER+ · endpoint: PATCH /api/imports/{id}/records)","http":{"method":"PATCH","path":"/api/imports/{id}/records"},"feature":"imports","verb":"write","scope":"imports:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"decision":{"type":"string","enum":["IMPORT","SKIP","MERGE"]},"entityType":{"type":"string","enum":["CLIENT","ITEM","DOCUMENT","EXPENSE"]},"classification":{"type":"string","enum":["NEW","EXACT_DUPLICATE","PROBABLE_MATCH","INVALID"]},"recordIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}}},"required":["id","decision"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["updated"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"imports_upload_create","description":"Performs the `upload` operation for the import runs feature.\n\n(Scope: imports:write · requires MANAGER+ · endpoint: POST /api/imports/upload)","http":{"method":"POST","path":"/api/imports/upload"},"feature":"imports","verb":"write","scope":"imports:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"upload":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"byteSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string"}},"required":["id","filename","byteSize","storageKey"],"additionalProperties":false}},"required":["upload"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_auto_scan_create","description":"Turn scheduled inbox auto-scan on (DAILY/WEEKLY/MONTHLY) or off (OFF) for an email connection. ON seeds + enables an ordinary automation (schedule.* → expenses.email_poll) that counts toward the per-org automation cap; past the cap returns 409. OFF deletes it.","http":{"method":"POST","path":"/api/expenses/email-settings/{id}/auto-scan"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"id":{"type":"string","minLength":1},"cadence":{"type":"string","enum":["OFF","DAILY","WEEKLY","MONTHLY"]}},"required":["organizationId","id","cadence"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"connectionId":{"type":"string"},"automationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cadence":{"type":"string","enum":["OFF","DAILY","WEEKLY","MONTHLY"]},"automationStatus":{"anyOf":[{"type":"string","enum":["ENABLED","DISABLED","PAUSED_NO_ACCESS"]},{"type":"null"}]}},"required":["connectionId","automationId","cadence","automationStatus"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_auto_scan_delete","description":"Removes the association without deleting the underlying record.\n\n(Scope: integrations:write · requires CONTRIBUTOR+ · endpoint: DELETE /api/expenses/email-settings/{id}/auto-scan)","http":{"method":"DELETE","path":"/api/expenses/email-settings/{id}/auto-scan"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"id":{"type":"string","minLength":1}},"required":["organizationId","id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"connectionId":{"type":"string"},"automationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cadence":{"type":"string","enum":["OFF","DAILY","WEEKLY","MONTHLY"]},"automationStatus":{"anyOf":[{"type":"string","enum":["ENABLED","DISABLED","PAUSED_NO_ACCESS"]},{"type":"null"}]}},"required":["connectionId","automationId","cadence","automationStatus"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"integrations_auto_scan_list","description":"Returns every `email-settings/auto-scan` row associated with the given expense.\n\n(Scope: integrations:read · requires VIEWER+ · endpoint: GET /api/expenses/email-settings/{id}/auto-scan)","http":{"method":"GET","path":"/api/expenses/email-settings/{id}/auto-scan"},"feature":"integrations","verb":"read","scope":"integrations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"id":{"type":"string","minLength":1}},"required":["organizationId","id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"connectionId":{"type":"string"},"automationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cadence":{"type":"string","enum":["OFF","DAILY","WEEKLY","MONTHLY"]},"automationStatus":{"anyOf":[{"type":"string","enum":["ENABLED","DISABLED","PAUSED_NO_ACCESS"]},{"type":"null"}]}},"required":["connectionId","automationId","cadence","automationStatus"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_connect_create","description":"Creates a new `connections/connect` attached to the given organization.\n\n(Scope: integrations:write · requires MANAGER+ · auth: SESSION only · endpoint: POST /api/organizations/{id}/connections/{providerId}/connect)","http":{"method":"POST","path":"/api/organizations/{id}/connections/{providerId}/connect"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"providerId":{"type":"string"},"environment":{"type":"string","enum":["sandbox","production"]}},"required":["id","providerId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"authorizeUrl":{"type":"string","description":"URL the browser opens (popup) to start the provider's OAuth consent flow."}},"required":["authorizeUrl"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":true,"destructiveHint":false}},{"name":"integrations_connections_delete","description":"Removes the association without deleting the underlying record.\n\n(Scope: integrations:write · requires MANAGER+ · auth: SESSION only · endpoint: DELETE /api/organizations/{id}/connections/{providerId})","http":{"method":"DELETE","path":"/api/organizations/{id}/connections/{providerId}"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"providerId":{"type":"string"},"environment":{"type":"string","enum":["sandbox","production"]}},"required":["id","providerId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":true,"destructiveHint":true}},{"name":"integrations_connections_list","description":"Returns every `connections` row associated with the given organization.\n\n(Scope: integrations:read · endpoint: GET /api/organizations/{id}/connections)","http":{"method":"GET","path":"/api/organizations/{id}/connections"},"feature":"integrations","verb":"read","scope":"integrations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"environment":{"type":"string","enum":["sandbox","production"]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"connections":{"type":"array","items":{"type":"object","properties":{"providerId":{"type":"string"},"displayName":{"type":"string"},"category":{"type":"string","enum":["TAX_AUTHORITY","EMAIL_INBOX","ACCOUNTING","OTHER"]},"authKind":{"type":"string","enum":["OAUTH_AUTHORIZATION_CODE","OAUTH_CLIENT_CREDENTIALS","API_KEY","BASIC"]},"environment":{"type":"string","enum":["sandbox","production"]},"required":{"type":"boolean","description":"Deduced from the org country handler (R1)"},"isConfigured":{"type":"boolean","description":"Platform env config present for this provider"},"status":{"type":"string","enum":["ACTIVE","NEEDS_RECONNECT","DISABLED","NOT_CONNECTED"]},"severity":{"anyOf":[{"type":"string","enum":["ok","expiring","reconnect"]},{"type":"null"}]},"statusReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO timestamp of the lifecycle wall"},"daysLeft":{"anyOf":[{"type":"number"},{"type":"null"}]},"connectedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastRefreshedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"scopes":{"type":"array","items":{"type":"string"}},"fields":{"description":"Static-credential form fields (non-OAuth providers only)","type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","password"]},"required":{"type":"boolean"},"placeholder":{"type":"string"}},"required":["key","label","type","required"],"additionalProperties":false}}},"required":["providerId","displayName","category","authKind","environment","required","isConfigured","status","severity","statusReason","expiresAt","daysLeft","connectedAt","lastRefreshedAt","lastUsedAt","lastError","scopes"],"additionalProperties":false}}},"required":["connections"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_credentials_replace","description":"Mutates the `connections/credentials` attached to the given organization.\n\n(Scope: integrations:write · requires MANAGER+ · auth: SESSION only · endpoint: PUT /api/organizations/{id}/connections/{providerId}/credentials)","http":{"method":"PUT","path":"/api/organizations/{id}/connections/{providerId}/credentials"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"providerId":{"type":"string"},"environment":{"type":"string","enum":["sandbox","production"]},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","providerId","fields"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":true,"destructiveHint":false}},{"name":"integrations_email_settings_create","description":"Performs the `email-settings` operation for the expenses feature.\n\n(Scope: integrations:write · requires MANAGER+ · endpoint: POST /api/expenses/email-settings)","http":{"method":"POST","path":"/api/expenses/email-settings"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["GMAIL","OUTLOOK","IMAP","POP3"]},"enabled":{"type":"boolean"},"host":{"anyOf":[{"type":"string"},{"type":"null"}]},"port":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"useTls":{"type":"boolean"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"password":{"anyOf":[{"type":"string"},{"type":"null"}]},"folderOrLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"subjectFilter":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderWhitelist":{"type":"array","items":{"type":"string"}},"autoPollEnabled":{"type":"boolean"},"pollIntervalDays":{"type":"integer","minimum":1,"maximum":365}},"required":["organizationId","name","provider"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string"},"enabled":{"type":"boolean"},"tokenExpiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"host":{"anyOf":[{"type":"string"},{"type":"null"}]},"port":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"useTls":{"type":"boolean"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasPassword":{"type":"boolean","description":"Whether an IMAP/POP3 password is stored. The password itself is never returned."},"folderOrLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"subjectFilter":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderWhitelist":{"type":"array","items":{"type":"string"}},"autoPollEnabled":{"type":"boolean"},"pollIntervalDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastPolledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","provider","enabled","tokenExpiresAt","host","port","useTls","username","hasPassword","folderOrLabel","subjectFilter","senderWhitelist","autoPollEnabled","pollIntervalDays","lastPolledAt","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_email_settings_delete","description":"Removes the `email-settings` configuration for the expenses feature.\n\n(Scope: integrations:write · requires MANAGER+ · endpoint: DELETE /api/expenses/email-settings)","http":{"method":"DELETE","path":"/api/expenses/email-settings"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1}},"required":["id","organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"integrations_email_settings_list","description":"Returns the `email-settings` data for the expenses feature.\n\n(Scope: integrations:read · endpoint: GET /api/expenses/email-settings)","http":{"method":"GET","path":"/api/expenses/email-settings"},"feature":"integrations","verb":"read","scope":"integrations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"id":{"type":"string"}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"anyOf":[{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string"},"enabled":{"type":"boolean"},"tokenExpiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"host":{"anyOf":[{"type":"string"},{"type":"null"}]},"port":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"useTls":{"type":"boolean"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasPassword":{"type":"boolean","description":"Whether an IMAP/POP3 password is stored. The password itself is never returned."},"folderOrLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"subjectFilter":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderWhitelist":{"type":"array","items":{"type":"string"}},"autoPollEnabled":{"type":"boolean"},"pollIntervalDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastPolledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","provider","enabled","tokenExpiresAt","host","port","useTls","username","hasPassword","folderOrLabel","subjectFilter","senderWhitelist","autoPollEnabled","pollIntervalDays","lastPolledAt","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},{"type":"object","properties":{"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string"},"enabled":{"type":"boolean"},"tokenExpiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"host":{"anyOf":[{"type":"string"},{"type":"null"}]},"port":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"useTls":{"type":"boolean"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasPassword":{"type":"boolean","description":"Whether an IMAP/POP3 password is stored. The password itself is never returned."},"folderOrLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"subjectFilter":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderWhitelist":{"type":"array","items":{"type":"string"}},"autoPollEnabled":{"type":"boolean"},"pollIntervalDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastPolledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","provider","enabled","tokenExpiresAt","host","port","useTls","username","hasPassword","folderOrLabel","subjectFilter","senderWhitelist","autoPollEnabled","pollIntervalDays","lastPolledAt","createdAt","updatedAt"],"additionalProperties":false}}},"required":["connections"],"additionalProperties":false}],"description":"Returns a single connection (when `id` is given) or `{ connections: [...] }` for the list view. Secrets are never included; `hasPassword` reports whether a credential is on file."},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_email_settings_replace","description":"Mutates the `email-settings` configuration for the expenses feature.\n\n(Scope: integrations:write · requires MANAGER+ · endpoint: PUT /api/expenses/email-settings)","http":{"method":"PUT","path":"/api/expenses/email-settings"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"host":{"anyOf":[{"type":"string"},{"type":"null"}]},"port":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"useTls":{"type":"boolean"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"password":{"anyOf":[{"type":"string"},{"type":"null"}]},"folderOrLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"subjectFilter":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderWhitelist":{"type":"array","items":{"type":"string"}},"autoPollEnabled":{"type":"boolean"},"pollIntervalDays":{"type":"integer","minimum":1,"maximum":365},"provider":{"type":"string","enum":["GMAIL","OUTLOOK","IMAP","POP3"]}},"required":["id","organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string"},"enabled":{"type":"boolean"},"tokenExpiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"host":{"anyOf":[{"type":"string"},{"type":"null"}]},"port":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"useTls":{"type":"boolean"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasPassword":{"type":"boolean","description":"Whether an IMAP/POP3 password is stored. The password itself is never returned."},"folderOrLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"subjectFilter":{"anyOf":[{"type":"string"},{"type":"null"}]},"senderWhitelist":{"type":"array","items":{"type":"string"}},"autoPollEnabled":{"type":"boolean"},"pollIntervalDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastPolledAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","provider","enabled","tokenExpiresAt","host","port","useTls","username","hasPassword","folderOrLabel","subjectFilter","senderWhitelist","autoPollEnabled","pollIntervalDays","lastPolledAt","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_fetch_logs_list","description":"Returns the `fetch-logs` data for the expenses feature.\n\n(Scope: integrations:read · endpoint: GET /api/expenses/fetch-logs)","http":{"method":"GET","path":"/api/expenses/fetch-logs"},"feature":"integrations","verb":"read","scope":"integrations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"connectionId":{"type":"string"}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"connectionId":{"type":"string"},"status":{"type":"string","enum":["PENDING","RUNNING","DONE","ERROR","MANUAL_STOP"]},"dateFrom":{"type":"string"},"dateTo":{"type":"string"},"emailsScanned":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emailsDetected":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expensesCreated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"claimedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When a worker claimed the run; null on a legacy sync run"},"lastProgressAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Heartbeat — bumped per processed message"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"messageId":{"type":"string"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"outcome":{"type":"string","enum":["CREATED","DUPLICATE","SKIPPED_NOT_EXPENSE","DROPPED_NO_DATA","FAILED"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Short human-readable disposition reason"},"processedAt":{"type":"string"}},"required":["id","messageId","subject","outcome","reason","processedAt"],"additionalProperties":false}}},"required":["id","connectionId","status","dateFrom","dateTo","emailsScanned","emailsDetected","expensesCreated","errorMessage","startedAt","completedAt","claimedAt","lastProgressAt","messages"],"additionalProperties":false}}},"required":["runs"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_gmail_create","description":"Performs the `email-connect/gmail` operation for the expenses feature.\n\n(Scope: integrations:write · requires CONTRIBUTOR+ · auth: SESSION only · endpoint: POST /api/expenses/email-connect/gmail)","http":{"method":"POST","path":"/api/expenses/email-connect/gmail"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"name":{"default":"Gmail","type":"string","minLength":1}},"required":["organizationId","name"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"authorizeUrl":{"type":"string","description":"URL the browser opens to start the Gmail OAuth flow."},"state":{"type":"string","description":"Signed CSRF state token — round-tripped on the callback."}},"required":["authorizeUrl","state"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":true,"destructiveHint":false}},{"name":"integrations_health_list","description":"Returns every `connections/health` row associated with the given organization.\n\n(Scope: integrations:read · endpoint: GET /api/organizations/{id}/connections/health)","http":{"method":"GET","path":"/api/organizations/{id}/connections/health"},"feature":"integrations","verb":"read","scope":"integrations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"environment":{"type":"string","enum":["sandbox","production"]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"providerId":{"type":"string"},"displayName":{"type":"string"},"severity":{"type":"string","enum":["missing","expiring","reconnect"]},"daysLeft":{"type":"number"},"environment":{"type":"string"}},"required":["providerId","displayName","severity","environment"],"additionalProperties":false}}},"required":["issues"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_outlook_create","description":"Performs the `email-connect/outlook` operation for the expenses feature.\n\n(Scope: integrations:write · requires CONTRIBUTOR+ · auth: SESSION only · endpoint: POST /api/expenses/email-connect/outlook)","http":{"method":"POST","path":"/api/expenses/email-connect/outlook"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"name":{"default":"Outlook","type":"string","minLength":1}},"required":["organizationId","name"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"authorizeUrl":{"type":"string","description":"URL the browser opens to start the Outlook OAuth flow."},"state":{"type":"string","description":"Signed CSRF state token — round-tripped on the callback."}},"required":["authorizeUrl","state"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":true,"destructiveHint":false}},{"name":"integrations_probe_create","description":"Creates a new `connections/probe` attached to the given organization.\n\n(Scope: integrations:write · requires MANAGER+ · auth: SESSION only · endpoint: POST /api/organizations/{id}/connections/{providerId}/probe)","http":{"method":"POST","path":"/api/organizations/{id}/connections/{providerId}/probe"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"providerId":{"type":"string"},"environment":{"type":"string","enum":["sandbox","production"]}},"required":["id","providerId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"ok":{"type":"boolean"},"errorClass":{"type":"string","enum":["PERMANENT_GRANT","PLATFORM_CONFIG","TRANSIENT"]},"detail":{"type":"string"}},"required":["ok"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":true,"destructiveHint":false}},{"name":"integrations_stop_create","description":"Creates a new `fetch-logs/stop` attached to the given expense.\n\n(Scope: integrations:write · endpoint: POST /api/expenses/fetch-logs/{id}/stop)","http":{"method":"POST","path":"/api/expenses/fetch-logs/{id}/stop"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"integrations_tax_authority_create","description":"Creates a new `tax-authority` attached to the given organization.\n\n(Scope: integrations:write · requires MANAGER+ · endpoint: POST /api/organizations/{id}/tax-authority/{integrationId})","http":{"method":"POST","path":"/api/organizations/{id}/tax-authority/{integrationId}"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"integrationId":{"type":"string"},"credentials":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"environment":{"default":"sandbox","type":"string","enum":["sandbox","production"]}},"required":["id","integrationId","credentials","environment"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"message":{"type":"string"}},"required":["success","message"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_tax_authority_delete","description":"Removes the association without deleting the underlying record.\n\n(Scope: integrations:write · requires MANAGER+ · endpoint: DELETE /api/organizations/{id}/tax-authority/{integrationId})","http":{"method":"DELETE","path":"/api/organizations/{id}/tax-authority/{integrationId}"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"integrationId":{"type":"string"}},"required":["id","integrationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"message":{"type":"string"}},"required":["success","message"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"integrations_tax_authority_get","description":"Returns every `tax-authority` row associated with the given organization.\n\n(Scope: integrations:read · requires MANAGER+ · endpoint: GET /api/organizations/{id}/tax-authority/{integrationId})","http":{"method":"GET","path":"/api/organizations/{id}/tax-authority/{integrationId}"},"feature":"integrations","verb":"read","scope":"integrations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"integrationId":{"type":"string"}},"required":["id","integrationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"integrationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"requiredFields":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"environment":{"type":"string","description":"sandbox | production"},"status":{"type":"object","properties":{"exists":{"type":"boolean"},"isActive":{"type":"boolean"},"isValidated":{"type":"boolean"},"lastValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"validationError":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["exists","isActive","isValidated","lastValidatedAt","validationError"],"additionalProperties":false}},"required":["integrationId","name","description","requiredFields","environment","status"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_tax_authority_list","description":"Returns every `tax-authority` row associated with the given organization.\n\n(Scope: integrations:read · endpoint: GET /api/organizations/{id}/tax-authority)","http":{"method":"GET","path":"/api/organizations/{id}/tax-authority"},"feature":"integrations","verb":"read","scope":"integrations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"integrations":{"type":"array","items":{"type":"object","properties":{"integrationId":{"type":"string","description":"Stable identifier of the tax-authority integration (e.g. \"israel-shaam\")."},"name":{"type":"string"},"country":{"type":"string"},"connected":{"type":"boolean"},"lastValidatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["integrationId","name","country","connected","lastValidatedAt"],"additionalProperties":false}}},"required":["integrations"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"integrations_validate_create","description":"Creates a new `tax-authority/validate` attached to the given organization.\n\n(Scope: integrations:write · requires MANAGER+ · endpoint: POST /api/organizations/{id}/tax-authority/{integrationId}/validate)","http":{"method":"POST","path":"/api/organizations/{id}/tax-authority/{integrationId}/validate"},"feature":"integrations","verb":"write","scope":"integrations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"integrationId":{"type":"string"}},"required":["id","integrationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"valid":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"details":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["valid"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"invitations_create","description":"Creates a new invitation in the target organization. Returns the created record on success.\n\n(Scope: users:write · requires MANAGER+ · endpoint: POST /api/invitations)","http":{"method":"POST","path":"/api/invitations"},"feature":"users","verb":"write","scope":"users:write","hasBody":true,"inputSchema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string"},"role":{"type":"string","enum":["MANAGER","CONTRIBUTOR","VIEWER"]},"organizationId":{"type":"string"}},"required":["email","role","organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string"},"token":{"type":"string","description":"Pre-signed acceptance token — never expose to the invitee in the UI directly; deliver via email link only."},"status":{"type":"string","description":"PENDING | ACCEPTED | DECLINED | EXPIRED"},"invitedById":{"type":"string"},"acceptedById":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"invitedBy":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}]},"acceptedBy":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}]},"organization":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","organizationId","email","name","role","token","status","invitedById","acceptedById","expiresAt","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"invitations_delete","description":"Deletes the invitation. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: users:write · endpoint: DELETE /api/invitations/{id})","http":{"method":"DELETE","path":"/api/invitations/{id}"},"feature":"users","verb":"write","scope":"users:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"invitations_list","description":"Lists invitations the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: users:read · requires MANAGER+ · endpoint: GET /api/invitations)","http":{"method":"GET","path":"/api/invitations"},"feature":"users","verb":"read","scope":"users:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string"},"token":{"type":"string","description":"Pre-signed acceptance token — never expose to the invitee in the UI directly; deliver via email link only."},"status":{"type":"string","description":"PENDING | ACCEPTED | DECLINED | EXPIRED"},"invitedById":{"type":"string"},"acceptedById":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"invitedBy":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}]},"acceptedBy":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}]},"organization":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","organizationId","email","name","role","token","status","invitedById","acceptedById","expiresAt","createdAt","updatedAt"],"additionalProperties":false}}},"required":["invitations"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_cancel_create","description":"Creates a new `cancel` attached to the given document.\n\n(Scope: invoices:write · endpoint: POST /api/documents/{id}/cancel)","http":{"method":"POST","path":"/api/documents/{id}/cancel"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","maxLength":500},"restock":{"type":"boolean"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"voidedAt":{"type":"string"},"cancellationDocument":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"cancellationClearance":{"type":"object","properties":{"required":{"type":"boolean"},"status":{"type":"string"},"stale":{"type":"boolean"},"allocationNumber":{"type":"string"}},"required":["required","status"],"additionalProperties":false}},"required":["success","voidedAt","cancellationDocument"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"invoices_clearance_create","description":"Creates a new `clearance` attached to the given document.\n\n(Scope: invoices:write · endpoint: POST /api/documents/{id}/clearance)","http":{"method":"POST","path":"/api/documents/{id}/clearance"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string","enum":["submit","retry"]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","description":"True iff the country handler reports APPROVED on this submission."},"result":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Full clearance result from the country handler."}},"required":["success","result"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_clearance_list","description":"Returns every `clearance` row associated with the given document.\n\n(Scope: invoices:read · endpoint: GET /api/documents/{id}/clearance)","http":{"method":"GET","path":"/api/documents/{id}/clearance"},"feature":"invoices","verb":"read","scope":"invoices:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Country-specific clearance status — fields depend on the country handler (Israel returns `status`, `vatAllocationNumber`, `submittedAt`, etc.). See `clearanceService.getClearanceStatus`."},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_create","description":"Creates a new document in the target organization. Returns the created record on success.\n\n(Scope: invoices:write · requires CONTRIBUTOR+ · endpoint: POST /api/documents)","http":{"method":"POST","path":"/api/documents"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"customerId":{"type":"string","minLength":1},"bankAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string","minLength":1},"status":{"default":"DRAFT","type":"string","enum":["DRAFT","UNSENT","SENT","PAID"]},"documentType":{"default":"INVOICE","type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST"]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"payUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"itemId":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string","minLength":1},"quantity":{"type":"number","minimum":0},"unitPrice":{"type":"number","minimum":0},"amount":{"type":"number"}},"required":["id","description","quantity","unitPrice","amount"],"additionalProperties":false}},"subtotal":{"type":"number"},"taxRate":{"type":"number"},"taxAmount":{"type":"number"},"total":{"type":"number"},"countrySpecificData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["organizationId","customerId","currency","status","documentType","items","subtotal","taxRate","taxAmount","total"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"customerId":{"type":"string"},"documentType":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"inDispute":{"type":"boolean"},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelsDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"exchangeRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"subtotal":{"type":"number"},"taxAmount":{"type":"number"},"total":{"type":"number"},"paidAmount":{"type":"number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"vatAllocationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"allocationPending":{"type":"boolean"},"generatorVersion":{"type":"string"},"renderProfileSnapshot":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"number"},"amount":{"type":"number"}},"required":["id","description","quantity","unitPrice","amount"],"additionalProperties":false}},"payments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"attachments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"clearance":{"description":"Present only when a clearance flow applies to this document (spec §7.3).","type":"object","properties":{"required":{"type":"boolean"},"status":{"type":"string","description":"APPROVED | PENDING | ERROR | REJECTED | MANUAL | NOT_REQUIRED"},"reason":{"description":"\"reconnect_required\" | \"held\" | an ITA error code","type":"string"},"details":{"type":"array","items":{"type":"string"}},"allocationNumber":{"type":"string"},"stale":{"type":"boolean"}},"required":["required","status"],"additionalProperties":false}},"required":["id","organizationId","customerId","documentType","invoiceNumber","status","inDispute","cancelled","cancellationDocumentId","cancelsDocumentId","invoiceDate","dueDate","recognitionStart","recognitionEnd","currency","exchangeRate","subtotal","taxAmount","total","paidAmount","notes","vatAllocationNumber","allocationPending","generatorVersion","renderProfileSnapshot","createdAt","updatedAt","customer","items","createdBy"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_delete","description":"Deletes the document. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: invoices:write · endpoint: DELETE /api/documents/{id})","http":{"method":"DELETE","path":"/api/documents/{id}"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"invoices_events_create","description":"Creates a new `events` attached to the given document.\n\n(Scope: invoices:write · endpoint: POST /api/documents/{id}/events)","http":{"method":"POST","path":"/api/documents/{id}/events"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["DISPUTED","DISPUTE_COUNTERED","DISPUTE_RESOLVED","COMMENTED","APPROVED","REJECTED"]},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"organizationId":{"type":"string"},"type":{"type":"string","description":"DocumentEventType — see DOCUMENT_EVENTS.md §4."},"actorUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"null = a system event."},"actor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"payload":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Event-specific data — shape depends on `type` (§4)."},"createdAt":{"type":"string"}},"required":["id","documentId","organizationId","type","actorUserId","actor","payload","createdAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_events_list","description":"Returns every `events` row associated with the given document.\n\n(Scope: invoices:read · endpoint: GET /api/documents/{id}/events)","http":{"method":"GET","path":"/api/documents/{id}/events"},"feature":"invoices","verb":"read","scope":"invoices:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":50,"type":"integer","minimum":1,"maximum":100}},"required":["id","page","limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"organizationId":{"type":"string"},"type":{"type":"string","description":"DocumentEventType — see DOCUMENT_EVENTS.md §4."},"actorUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"null = a system event."},"actor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"payload":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"Event-specific data — shape depends on `type` (§4)."},"createdAt":{"type":"string"}},"required":["id","documentId","organizationId","type","actorUserId","actor","payload","createdAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["events","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_get","description":"Fetches a single document by id. Returns 404 if the document isn't in the caller's accessible organizations.\n\n(Scope: invoices:read · endpoint: GET /api/documents/{id})","http":{"method":"GET","path":"/api/documents/{id}"},"feature":"invoices","verb":"read","scope":"invoices:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"customerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentType":{"type":"string"},"status":{"type":"string"},"direction":{"type":"string"},"inDispute":{"type":"boolean"},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelsDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"exchangeRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"issueDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"payUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiptNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"issueDate":{"type":"string"},"paymentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","invoiceNumber","total","issueDate","paymentId","paymentDate","paymentMethod","cancelled","cancellationDocumentId"],"additionalProperties":false}},"relatedDocument":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentType":{"type":"string"}},"required":["id","invoiceNumber","documentType"],"additionalProperties":false},{"type":"null"}]},"receiptEmailRecipients":{"type":"array","items":{"type":"string"}},"subtotal":{"type":"number"},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxAmount":{"type":"number"},"total":{"type":"number"},"paidAmount":{"type":"number"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"allocated":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","amount","allocated","paidAt","method","documentId"],"additionalProperties":false}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"generatorVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"renderProfileSnapshot":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"vatAllocationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"organization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"documentDesignProfile":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","name","country","registrationNumber","address","icon","countrySpecificData","documentDesignProfile"],"additionalProperties":false},{"type":"null"}]},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","phone","address","country","registrationNumber"],"additionalProperties":false},{"type":"null"}]},"bankAccount":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"storageUrl":{"type":"string"},"evidenceKind":{"type":"string","enum":["SUPPORTING","OFFICIAL_DOCUMENT","INLINE_OFFICIAL_CONTENT"]}},"required":["id","fileName","fileType","storageUrl","evidenceKind"],"additionalProperties":false}},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","customerId","bankAccountId","invoiceNumber","documentType","status","direction","inDispute","cancelled","cancellationDocumentId","cancelsDocumentId","currency","exchangeRate","issueDate","dueDate","payUntil","recognitionStart","recognitionEnd","paymentMethod","paymentDate","receiptNumber","subtotal","taxRate","taxAmount","total","paidAmount","payments","notes","generatorVersion","renderProfileSnapshot","vatAllocationNumber","countrySpecificData","items","organization","customer","bankAccount","createdBy","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false},"meta":{"ui":{"resourceUri":"ui://guliel/invoice-detail"},"ui/resourceUri":"ui://guliel/invoice-detail","openai/outputTemplate":"ui://guliel/invoice-detail"}},{"name":"invoices_invoice_create","description":"Creates a new `invoice` attached to the given order.\n\n(Scope: invoices:write · requires CONTRIBUTOR+ · endpoint: POST /api/orders/{id}/invoice)","http":{"method":"POST","path":"/api/orders/{id}/invoice"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"invoice":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The freshly-created invoice. See /api/documents/[id] GET for the canonical shape."},"redirectUrl":{"type":"string","description":"Path the UI should navigate to so the user can edit the new invoice."}},"required":["invoice","redirectUrl"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_list","description":"List an organization's documents (invoices & receipts), newest first. Returns ONE page — default 25 rows, max 100 via `limit` — and renders as an interactive widget that pages in place. Fetch a single page and let the user page within the widget; do not call this repeatedly to walk every page unless they explicitly ask to export or total the entire list.","http":{"method":"GET","path":"/api/documents"},"feature":"invoices","verb":"read","scope":"invoices:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":25,"type":"integer","minimum":1,"maximum":100},"status":{"type":"string","enum":["DRAFT","UNSENT","SENT","PAID"]},"documentType":{"type":"string"},"search":{"default":"","type":"string"},"customerId":{"type":"string"},"disputed":{"type":"string","enum":["true","false"]},"sortBy":{"default":"issueDate","type":"string","enum":["issueDate","dueDate","total","status","documentNumber","customerName"]},"sortOrder":{"default":"desc","type":"string","enum":["asc","desc"]}},"required":["organizationId","page","limit","search","sortBy","sortOrder"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"customerId":{"type":"string"},"documentType":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"inDispute":{"type":"boolean"},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelsDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"exchangeRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"subtotal":{"type":"number"},"taxAmount":{"type":"number"},"total":{"type":"number"},"paidAmount":{"type":"number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"vatAllocationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"allocationPending":{"type":"boolean"},"generatorVersion":{"type":"string"},"renderProfileSnapshot":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"number"},"amount":{"type":"number"}},"required":["id","description","quantity","unitPrice","amount"],"additionalProperties":false}},"payments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"attachments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]}},"required":["id","organizationId","customerId","documentType","invoiceNumber","status","inDispute","cancelled","cancellationDocumentId","cancelsDocumentId","invoiceDate","dueDate","recognitionStart","recognitionEnd","currency","exchangeRate","subtotal","taxAmount","total","paidAmount","notes","vatAllocationNumber","allocationPending","generatorVersion","renderProfileSnapshot","createdAt","updatedAt","customer","items","createdBy"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["invoices","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false},"meta":{"ui":{"resourceUri":"ui://guliel/documents-list"},"ui/resourceUri":"ui://guliel/documents-list","openai/outputTemplate":"ui://guliel/documents-list"}},{"name":"invoices_manual_allocation_create","description":"Creates a new `manual-allocation` attached to the given document.\n\n(Scope: invoices:write · endpoint: POST /api/documents/{id}/manual-allocation)","http":{"method":"POST","path":"/api/documents/{id}/manual-allocation"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"allocationNumber":{"type":"string","minLength":9}},"required":["id","allocationNumber"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"allocationNumber":{"type":"string","description":"Digits-only allocation number after stripping non-digit characters."}},"required":["success","allocationNumber"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_mark_paid_create","description":"Mutates the state machine of the document. Some transitions are restricted by role.\n\n(Scope: invoices:write · endpoint: POST /api/documents/{id}/mark-paid)","http":{"method":"POST","path":"/api/documents/{id}/mark-paid"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"paymentDate":{"type":"string"},"paymentMethod":{"type":"string"},"generateReceipt":{"type":"boolean"},"generateTaxFreeReceipt":{"type":"boolean"},"sendReceiptEmail":{"default":false,"type":"boolean"}},"required":["id","paymentDate","paymentMethod","sendReceiptEmail"],"additionalProperties":false},"outputSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Updated invoice row plus `receiptNumber`, `emailsSent`, `emailsFailed` counts. See /api/documents/[id] GET for the canonical invoice shape."},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_payments_create","description":"Creates a new `payments` attached to the given document.\n\n(Scope: invoices:write · endpoint: POST /api/documents/{id}/payments)","http":{"method":"POST","path":"/api/documents/{id}/payments"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number","exclusiveMinimum":0},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"generateReceipt":{"default":true,"type":"boolean"},"sendReceiptEmail":{"default":false,"type":"boolean"},"additionalEmails":{"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"required":["id","amount","paidAt","generateReceipt","sendReceiptEmail"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"payment":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"amount":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"allocations":{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string"},"amount":{"type":"number"}},"required":["lineId","amount"],"additionalProperties":false}},"unallocated":{"type":"number"},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"paidAmount":{"type":"number"},"total":{"type":"number"}},"required":["id","status","paidAmount","total"],"additionalProperties":false}},"receiptNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiptDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","organizationId","amount","paidAt","method","allocations","unallocated","documents","receiptNumber","receiptDocumentId"],"additionalProperties":false},"sourceDocument":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"customerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNumber":{"type":"string"},"documentType":{"type":"string"},"status":{"type":"string"},"direction":{"type":"string"},"inDispute":{"type":"boolean"},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelsDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"exchangeRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"issueDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"payUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiptNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"issueDate":{"type":"string"},"paymentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","invoiceNumber","total","issueDate","paymentId","paymentDate","paymentMethod","cancelled","cancellationDocumentId"],"additionalProperties":false}},"subtotal":{"type":"number"},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxAmount":{"type":"number"},"total":{"type":"number"},"paidAmount":{"type":"number"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"allocated":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","amount","allocated","paidAt","method","documentId"],"additionalProperties":false}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"generatorVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"renderProfileSnapshot":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"organization":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","phone","address","country","registrationNumber"],"additionalProperties":false},{"type":"null"}]},"bankAccount":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","customerId","bankAccountId","invoiceNumber","documentNumber","documentType","status","direction","inDispute","cancelled","cancellationDocumentId","cancelsDocumentId","currency","exchangeRate","issueDate","dueDate","payUntil","recognitionStart","recognitionEnd","paymentMethod","paymentDate","receiptNumber","receipts","subtotal","taxRate","taxAmount","total","paidAmount","payments","notes","generatorVersion","renderProfileSnapshot","countrySpecificData","items","organization","customer","bankAccount","createdBy","createdAt","updatedAt"],"additionalProperties":false},"receipt":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"customerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNumber":{"type":"string"},"documentType":{"type":"string"},"status":{"type":"string"},"direction":{"type":"string"},"inDispute":{"type":"boolean"},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelsDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"exchangeRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"issueDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"payUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiptNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"issueDate":{"type":"string"},"paymentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","invoiceNumber","total","issueDate","paymentId","paymentDate","paymentMethod","cancelled","cancellationDocumentId"],"additionalProperties":false}},"subtotal":{"type":"number"},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxAmount":{"type":"number"},"total":{"type":"number"},"paidAmount":{"type":"number"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"allocated":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","amount","allocated","paidAt","method","documentId"],"additionalProperties":false}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"generatorVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"renderProfileSnapshot":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"organization":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","phone","address","country","registrationNumber"],"additionalProperties":false},{"type":"null"}]},"bankAccount":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","customerId","bankAccountId","invoiceNumber","documentNumber","documentType","status","direction","inDispute","cancelled","cancellationDocumentId","cancelsDocumentId","currency","exchangeRate","issueDate","dueDate","payUntil","recognitionStart","recognitionEnd","paymentMethod","paymentDate","receiptNumber","receipts","subtotal","taxRate","taxAmount","total","paidAmount","payments","notes","generatorVersion","renderProfileSnapshot","countrySpecificData","items","organization","customer","bankAccount","createdBy","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"emailsSent":{"type":"number"},"emailsFailed":{"type":"number"}},"required":["payment","sourceDocument","receipt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_replace","description":"Replaces an existing document. All required fields must be supplied — omitted fields revert to their schema defaults.\n\n(Scope: invoices:write · endpoint: PUT /api/documents/{id})","http":{"method":"PUT","path":"/api/documents/{id}"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"customerId":{"type":"string","minLength":1},"bankAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string","minLength":1},"status":{"type":"string","enum":["DRAFT","UNSENT","SENT","PAID"]},"documentType":{"type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST"]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"payUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"itemId":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string","minLength":1},"quantity":{"type":"number","minimum":0},"unitPrice":{"type":"number","minimum":0},"amount":{"type":"number"}},"required":["id","description","quantity","unitPrice","amount"],"additionalProperties":false}},"subtotal":{"type":"number"},"taxRate":{"type":"number"},"taxAmount":{"type":"number"},"total":{"type":"number"},"countrySpecificData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"clearReceiptInfo":{"type":"boolean"},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"customerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentType":{"type":"string"},"status":{"type":"string"},"direction":{"type":"string"},"inDispute":{"type":"boolean"},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelsDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"exchangeRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"issueDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"payUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiptNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"issueDate":{"type":"string"},"paymentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","invoiceNumber","total","issueDate","paymentId","paymentDate","paymentMethod","cancelled","cancellationDocumentId"],"additionalProperties":false}},"relatedDocument":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentType":{"type":"string"}},"required":["id","invoiceNumber","documentType"],"additionalProperties":false},{"type":"null"}]},"receiptEmailRecipients":{"type":"array","items":{"type":"string"}},"subtotal":{"type":"number"},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxAmount":{"type":"number"},"total":{"type":"number"},"paidAmount":{"type":"number"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"allocated":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","amount","allocated","paidAt","method","documentId"],"additionalProperties":false}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"generatorVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"renderProfileSnapshot":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"vatAllocationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"organization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"documentDesignProfile":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","name","country","registrationNumber","address","icon","countrySpecificData","documentDesignProfile"],"additionalProperties":false},{"type":"null"}]},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","phone","address","country","registrationNumber"],"additionalProperties":false},{"type":"null"}]},"bankAccount":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"storageUrl":{"type":"string"},"evidenceKind":{"type":"string","enum":["SUPPORTING","OFFICIAL_DOCUMENT","INLINE_OFFICIAL_CONTENT"]}},"required":["id","fileName","fileType","storageUrl","evidenceKind"],"additionalProperties":false}},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"clearance":{"description":"Present only when a clearance flow applies to this document (spec §7.3).","type":"object","properties":{"required":{"type":"boolean"},"status":{"type":"string","description":"APPROVED | PENDING | ERROR | REJECTED | MANUAL | NOT_REQUIRED"},"reason":{"description":"\"reconnect_required\" | \"held\" | an ITA error code","type":"string"},"details":{"type":"array","items":{"type":"string"}},"allocationNumber":{"type":"string"},"stale":{"type":"boolean"}},"required":["required","status"],"additionalProperties":false}},"required":["id","organizationId","customerId","bankAccountId","invoiceNumber","documentType","status","direction","inDispute","currency","exchangeRate","issueDate","dueDate","payUntil","recognitionStart","recognitionEnd","paymentMethod","paymentDate","receiptNumber","subtotal","taxRate","taxAmount","total","paidAmount","payments","notes","generatorVersion","renderProfileSnapshot","vatAllocationNumber","countrySpecificData","items","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_send_create","description":"Renders the document as a PDF, attaches it, and emails it to the configured recipients.\n\n(Scope: invoices:write · endpoint: POST /api/documents/{id}/send)","http":{"method":"POST","path":"/api/documents/{id}/send"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalRecipients":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["success","sent","failed","totalRecipients"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":true,"destructiveHint":false}},{"name":"invoices_update","description":"Updates an existing document. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: invoices:write · endpoint: PATCH /api/documents/{id})","http":{"method":"PATCH","path":"/api/documents/{id}"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"customerId":{"type":"string","minLength":1},"bankAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string","minLength":1},"status":{"type":"string","enum":["DRAFT","UNSENT","SENT","PAID"]},"documentType":{"type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST"]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"payUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"itemId":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string","minLength":1},"quantity":{"type":"number","minimum":0},"unitPrice":{"type":"number","minimum":0},"amount":{"type":"number"}},"required":["id","description","quantity","unitPrice","amount"],"additionalProperties":false}},"subtotal":{"type":"number"},"taxRate":{"type":"number"},"taxAmount":{"type":"number"},"total":{"type":"number"},"countrySpecificData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"clearReceiptInfo":{"type":"boolean"},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"customerId":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentType":{"type":"string"},"status":{"type":"string"},"direction":{"type":"string"},"inDispute":{"type":"boolean"},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelsDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"exchangeRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"issueDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"payUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"recognitionEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiptNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"issueDate":{"type":"string"},"paymentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","invoiceNumber","total","issueDate","paymentId","paymentDate","paymentMethod","cancelled","cancellationDocumentId"],"additionalProperties":false}},"relatedDocument":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentType":{"type":"string"}},"required":["id","invoiceNumber","documentType"],"additionalProperties":false},{"type":"null"}]},"receiptEmailRecipients":{"type":"array","items":{"type":"string"}},"subtotal":{"type":"number"},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxAmount":{"type":"number"},"total":{"type":"number"},"paidAmount":{"type":"number"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"allocated":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","amount","allocated","paidAt","method","documentId"],"additionalProperties":false}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"generatorVersion":{"anyOf":[{"type":"string"},{"type":"null"}]},"renderProfileSnapshot":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"vatAllocationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"organization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"documentDesignProfile":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","name","country","registrationNumber","address","icon","countrySpecificData","documentDesignProfile"],"additionalProperties":false},{"type":"null"}]},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","phone","address","country","registrationNumber"],"additionalProperties":false},{"type":"null"}]},"bankAccount":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"storageUrl":{"type":"string"},"evidenceKind":{"type":"string","enum":["SUPPORTING","OFFICIAL_DOCUMENT","INLINE_OFFICIAL_CONTENT"]}},"required":["id","fileName","fileType","storageUrl","evidenceKind"],"additionalProperties":false}},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"clearance":{"description":"Present only when a clearance flow applies to this document (spec §7.3).","type":"object","properties":{"required":{"type":"boolean"},"status":{"type":"string","description":"APPROVED | PENDING | ERROR | REJECTED | MANUAL | NOT_REQUIRED"},"reason":{"description":"\"reconnect_required\" | \"held\" | an ITA error code","type":"string"},"details":{"type":"array","items":{"type":"string"}},"allocationNumber":{"type":"string"},"stale":{"type":"boolean"}},"required":["required","status"],"additionalProperties":false}},"required":["id","organizationId","customerId","bankAccountId","invoiceNumber","documentType","status","direction","inDispute","currency","exchangeRate","issueDate","dueDate","payUntil","recognitionStart","recognitionEnd","paymentMethod","paymentDate","receiptNumber","subtotal","taxRate","taxAmount","total","paidAmount","payments","notes","generatorVersion","renderProfileSnapshot","vatAllocationNumber","countrySpecificData","items","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"invoices_void_create","description":"Creates a new `void` attached to the given document.\n\n(Scope: invoices:write · endpoint: POST /api/documents/{id}/void)","http":{"method":"POST","path":"/api/documents/{id}/void"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"logistics_create","description":"Creates a new item in the target organization. Returns the created record on success.\n\n(Scope: logistics:write · requires CONTRIBUTOR+ · endpoint: POST /api/items)","http":{"method":"POST","path":"/api/items"},"feature":"logistics","verb":"write","scope":"logistics:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":"string"},"sku":{"type":"string"},"unitPrice":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"currency":{"default":"USD","type":"string"},"quantity":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"lowStockThreshold":{"default":5,"type":"integer","minimum":0,"maximum":9007199254740991},"availableForExternalOrder":{"default":false,"type":"boolean"}},"required":["organizationId","name","currency","lowStockThreshold","availableForExternalOrder"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitPrice":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Unit price in `currency`; null when the item has no default price."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Stock on hand. Null means the item is not stock-tracked."},"lowStockThreshold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"isActive":{"type":"boolean"},"availableForExternalOrder":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","sku","unitPrice","currency","quantity","lowStockThreshold","isActive","availableForExternalOrder","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"logistics_delete","description":"Deletes the item. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: logistics:write · endpoint: DELETE /api/items/{id})","http":{"method":"DELETE","path":"/api/items/{id}"},"feature":"logistics","verb":"write","scope":"logistics:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"logistics_get","description":"Fetches a single item by id. Returns 404 if the item isn't in the caller's accessible organizations.\n\n(Scope: logistics:read · endpoint: GET /api/items/{id})","http":{"method":"GET","path":"/api/items/{id}"},"feature":"logistics","verb":"read","scope":"logistics:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitPrice":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"lowStockThreshold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"isActive":{"type":"boolean"},"availableForExternalOrder":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","sku","unitPrice","currency","quantity","lowStockThreshold","isActive","availableForExternalOrder","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"logistics_list","description":"List an organization's inventory items with stock levels and low-stock flags. Returns ONE page — default 25 rows, max 100 via `limit` — and renders as an interactive widget that pages in place. Fetch a single page and let the user page within the widget; do not call this repeatedly to walk every page unless they explicitly ask to export or total the entire list.","http":{"method":"GET","path":"/api/items"},"feature":"logistics","verb":"read","scope":"logistics:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":25,"type":"integer","minimum":1,"maximum":100},"search":{"default":"","type":"string"},"isActive":{"type":"string"},"hasStock":{"type":"string"},"currency":{"type":"string"},"sortBy":{"default":"name","type":"string","enum":["name","sku","unitPrice","quantity","createdAt","updatedAt"]},"sortOrder":{"default":"asc","type":"string","enum":["asc","desc"]}},"required":["organizationId","page","limit","search","sortBy","sortOrder"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitPrice":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Unit price in `currency`; null when the item has no default price."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Stock on hand. Null means the item is not stock-tracked."},"lowStockThreshold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"isActive":{"type":"boolean"},"availableForExternalOrder":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","sku","unitPrice","currency","quantity","lowStockThreshold","isActive","availableForExternalOrder","createdAt","updatedAt"],"additionalProperties":false}},"lowStockCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many active stock-tracked items are at or below their lowStockThreshold."},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["items","lowStockCount","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false},"meta":{"ui":{"resourceUri":"ui://guliel/inventory"},"ui/resourceUri":"ui://guliel/inventory","openai/outputTemplate":"ui://guliel/inventory"}},{"name":"logistics_movements_list","description":"Returns every `movements` row associated with the given item.\n\n(Scope: logistics:read · endpoint: GET /api/items/{id}/movements)","http":{"method":"GET","path":"/api/items/{id}/movements"},"feature":"logistics","verb":"read","scope":"logistics:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":20,"type":"integer","minimum":1,"maximum":100}},"required":["id","page","limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"movements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"itemId":{"type":"string"},"type":{"type":"string","description":"INVOICE_DEDUCT | INVOICE_RESTORE | MANUAL_ADD | MANUAL_SET | RECEIPT | etc."},"delta":{"type":"number"},"quantityBefore":{"type":"number"},"quantityAfter":{"type":"number"},"referenceId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdById":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","itemId","type","delta","quantityBefore","quantityAfter","referenceId","createdById","createdAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["movements","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"logistics_replace","description":"Replaces an existing item. All required fields must be supplied — omitted fields revert to their schema defaults.\n\n(Scope: logistics:write · endpoint: PUT /api/items/{id})","http":{"method":"PUT","path":"/api/items/{id}"},"feature":"logistics","verb":"write","scope":"logistics:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitPrice":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"currency":{"type":"string"},"lowStockThreshold":{"type":"integer","minimum":0,"maximum":9007199254740991},"isActive":{"type":"boolean"},"availableForExternalOrder":{"type":"boolean"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitPrice":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"lowStockThreshold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"isActive":{"type":"boolean"},"availableForExternalOrder":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","sku","unitPrice","currency","quantity","lowStockThreshold","isActive","availableForExternalOrder","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"logistics_stock_create","description":"Creates a new `stock` attached to the given item.\n\n(Scope: logistics:write · endpoint: POST /api/items/{id}/stock)","http":{"method":"POST","path":"/api/items/{id}/stock"},"feature":"logistics","verb":"write","scope":"logistics:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"add":{"type":"number","exclusiveMinimum":0},"set":{"type":"number","minimum":0},"note":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Updated item row with the new `quantity`. See /api/items/[id] GET for the canonical shape."},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"logistics_update","description":"Updates an existing item. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: logistics:write · endpoint: PATCH /api/items/{id})","http":{"method":"PATCH","path":"/api/items/{id}"},"feature":"logistics","verb":"write","scope":"logistics:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitPrice":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"currency":{"type":"string"},"lowStockThreshold":{"type":"integer","minimum":0,"maximum":9007199254740991},"isActive":{"type":"boolean"},"availableForExternalOrder":{"type":"boolean"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitPrice":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"lowStockThreshold":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"isActive":{"type":"boolean"},"availableForExternalOrder":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","sku","unitPrice","currency","quantity","lowStockThreshold","isActive","availableForExternalOrder","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"notifications_delete","description":"Deletes the notification. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: users:write · endpoint: DELETE /api/notifications/{id})","http":{"method":"DELETE","path":"/api/notifications/{id}"},"feature":"users","verb":"write","scope":"users:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"notifications_list","description":"Lists notifications the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: users:read · endpoint: GET /api/notifications)","http":{"method":"GET","path":"/api/notifications"},"feature":"users","verb":"read","scope":"users:read","hasBody":false,"inputSchema":{"type":"object","properties":{"status":{"type":"string","enum":["UNREAD","READ","ARCHIVED"]},"type":{"type":"string"},"organizationId":{"type":"string","minLength":1},"limit":{"default":50,"type":"integer","minimum":1,"maximum":100}},"required":["limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"notifications":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"},"status":{"type":"string","description":"UNREAD | READ | ARCHIVED"},"actionUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"relatedType":{"anyOf":[{"type":"string"},{"type":"null"}]},"relatedId":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"},"readAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","userId","organizationId","type","title","message","status","actionUrl","relatedType","relatedId","metadata","createdAt","readAt"],"additionalProperties":false}},"unreadCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unreadCountsByOrg":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"Per-org unread counts. The key `_null` holds notifications without an org (global)."}},"required":["notifications","unreadCount","unreadCountsByOrg"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"notifications_update","description":"Updates an existing notification. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: users:write · endpoint: PATCH /api/notifications/{id})","http":{"method":"PATCH","path":"/api/notifications/{id}"},"feature":"users","verb":"write","scope":"users:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["READ","ARCHIVED"]}},"required":["id","status"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"},"status":{"type":"string"},"actionUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"relatedType":{"anyOf":[{"type":"string"},{"type":"null"}]},"relatedId":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"},"readAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","userId","organizationId","type","title","message","status","actionUrl","relatedType","relatedId","metadata","createdAt","readAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"oauth_authorizations_delete","description":"Deletes the OAuth authorization. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: users:write · auth: SESSION only · endpoint: DELETE /api/oauth-authorizations/{id})","http":{"method":"DELETE","path":"/api/oauth-authorizations/{id}"},"feature":"users","verb":"write","scope":"users:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"revokedAt":{"type":"string"},"revokedTokenCount":{"type":"number"}},"required":["revokedAt","revokedTokenCount"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"oauth_authorizations_get","description":"Fetches a single OAuth authorization by id. Returns 404 if the OAuth authorization isn't in the caller's accessible organizations.\n\n(Scope: users:read · auth: SESSION only · endpoint: GET /api/oauth-authorizations/{id})","http":{"method":"GET","path":"/api/oauth-authorizations/{id}"},"feature":"users","verb":"read","scope":"users:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"authorization":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"clientName":{"type":"string"},"clientLogoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"clientHomepageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"clientDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"isFirstParty":{"type":"boolean"},"scopes":{"type":"array","items":{"type":"string"}},"allOrgs":{"type":"boolean"},"organizationIds":{"type":"array","items":{"type":"string"}},"tokens":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"prefix":{"type":"string"},"expiresAt":{"type":"string"},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","prefix","expiresAt","lastUsedAt","createdAt"],"additionalProperties":false}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","clientId","clientName","clientLogoUrl","clientHomepageUrl","clientDescription","isFirstParty","scopes","allOrgs","organizationIds","tokens","createdAt","updatedAt"],"additionalProperties":false}},"required":["authorization"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"oauth_authorizations_list","description":"Lists OAuth authorizations the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: users:read · auth: SESSION only · endpoint: GET /api/oauth-authorizations)","http":{"method":"GET","path":"/api/oauth-authorizations"},"feature":"users","verb":"read","scope":"users:read","hasBody":false,"inputSchema":{"type":"object","properties":{},"additionalProperties":false},"outputSchema":{"type":"object","properties":{"authorizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"clientName":{"type":"string"},"clientLogoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"clientHomepageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"isFirstParty":{"type":"boolean"},"scopes":{"type":"array","items":{"type":"string"}},"allOrgs":{"type":"boolean"},"organizationIds":{"type":"array","items":{"type":"string"}},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"activeTokenCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","clientId","clientName","clientLogoUrl","clientHomepageUrl","isFirstParty","scopes","allOrgs","organizationIds","lastUsedAt","activeTokenCount","createdAt","updatedAt"],"additionalProperties":false}}},"required":["authorizations"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"orders_create","description":"Creates a new order in the target organization. Returns the created record on success.\n\n(Scope: orders:write · requires CONTRIBUTOR+ · endpoint: POST /api/orders)","http":{"method":"POST","path":"/api/orders"},"feature":"orders","verb":"write","scope":"orders:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"supplierId":{"type":"string","minLength":1},"currency":{"type":"string","minLength":1},"notes":{"type":"string"},"expectedDate":{"type":"string"},"items":{"minItems":1,"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string"},"description":{"type":"string","minLength":1},"quantity":{"type":"number","exclusiveMinimum":0},"unitPrice":{"type":"number","minimum":0}},"required":["description","quantity","unitPrice"],"additionalProperties":false}}},"required":["organizationId","supplierId","currency","items"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"supplierId":{"type":"string"},"orderNumber":{"type":"string"},"status":{"type":"string","description":"DRAFT | SENT | APPROVED | INVOICED | REJECTED | PAID"},"currency":{"type":"string"},"subtotal":{"type":"number"},"totalAmount":{"type":"number"},"orderDate":{"type":"string"},"expectedDeliveryDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"supplierOrganizationId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","supplierOrganizationId"],"additionalProperties":false},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","supplierId","orderNumber","status","currency","subtotal","totalAmount","orderDate","expectedDeliveryDate","notes","supplier","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"orders_delete","description":"Deletes the order. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: orders:write · endpoint: DELETE /api/orders/{id})","http":{"method":"DELETE","path":"/api/orders/{id}"},"feature":"orders","verb":"write","scope":"orders:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"orders_get","description":"Fetches a single order by id. Returns 404 if the order isn't in the caller's accessible organizations.\n\n(Scope: orders:read · endpoint: GET /api/orders/{id})","http":{"method":"GET","path":"/api/orders/{id}"},"feature":"orders","verb":"read","scope":"orders:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"supplierId":{"type":"string"},"orderNumber":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"subtotal":{"type":"number"},"totalAmount":{"type":"number"},"orderDate":{"type":"string"},"expectedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"supplierOrganization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","country","registrationNumber","address"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","email","status","supplierOrganization"],"additionalProperties":false},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"itemId":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"number"},"amount":{"type":"number"},"item":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","sku"],"additionalProperties":false},{"type":"null"}]}},"required":["id","itemId","description","quantity","unitPrice","amount","item"],"additionalProperties":false}},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"type":"string"},"status":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string"}},"required":["id","invoiceNumber","status","total","currency"],"additionalProperties":false}},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"}},"required":["id","status","amount","currency"],"additionalProperties":false},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","supplierId","orderNumber","status","currency","subtotal","totalAmount","orderDate","expectedDate","notes","supplier","items","invoices","expense","createdBy","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"orders_list","description":"Lists orders the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: orders:read · endpoint: GET /api/orders)","http":{"method":"GET","path":"/api/orders"},"feature":"orders","verb":"read","scope":"orders:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":20,"type":"integer","minimum":1,"maximum":100},"search":{"default":"","type":"string"},"status":{"type":"string"},"supplierId":{"type":"string"},"sortBy":{"default":"createdAt","type":"string","enum":["orderNumber","orderDate","subtotal","status","createdAt"]},"sortOrder":{"default":"desc","type":"string","enum":["asc","desc"]}},"required":["organizationId","page","limit","search","sortBy","sortOrder"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"orders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"supplierId":{"type":"string"},"orderNumber":{"type":"string"},"status":{"type":"string","description":"DRAFT | SENT | APPROVED | INVOICED | REJECTED | PAID"},"currency":{"type":"string"},"subtotal":{"type":"number"},"totalAmount":{"type":"number"},"orderDate":{"type":"string"},"expectedDeliveryDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"supplierOrganizationId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","supplierOrganizationId"],"additionalProperties":false},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","supplierId","orderNumber","status","currency","subtotal","totalAmount","orderDate","expectedDeliveryDate","notes","supplier","createdAt","updatedAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["orders","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"orders_replace","description":"Replaces an existing order. All required fields must be supplied — omitted fields revert to their schema defaults.\n\n(Scope: orders:write · endpoint: PUT /api/orders/{id})","http":{"method":"PUT","path":"/api/orders/{id}"},"feature":"orders","verb":"write","scope":"orders:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string","minLength":1},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"minItems":1,"type":"array","items":{"type":"object","properties":{"itemId":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string","minLength":1},"quantity":{"type":"number","exclusiveMinimum":0},"unitPrice":{"type":"number","minimum":0}},"required":["description","quantity","unitPrice"],"additionalProperties":false}}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"supplierId":{"type":"string"},"orderNumber":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"subtotal":{"type":"number"},"totalAmount":{"type":"number"},"orderDate":{"type":"string"},"expectedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"supplierOrganization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","country","registrationNumber","address"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","email","status","supplierOrganization"],"additionalProperties":false},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"itemId":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"number"},"amount":{"type":"number"},"item":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","sku"],"additionalProperties":false},{"type":"null"}]}},"required":["id","itemId","description","quantity","unitPrice","amount","item"],"additionalProperties":false}},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"type":"string"},"status":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string"}},"required":["id","invoiceNumber","status","total","currency"],"additionalProperties":false}},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"}},"required":["id","status","amount","currency"],"additionalProperties":false},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","supplierId","orderNumber","status","currency","subtotal","totalAmount","orderDate","expectedDate","notes","supplier","items","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"orders_status_create","description":"Mutates the state machine of the order. Some transitions are restricted by role.\n\n(Scope: orders:write · requires CONTRIBUTOR+ · endpoint: POST /api/orders/{id}/status)","http":{"method":"POST","path":"/api/orders/{id}/status"},"feature":"orders","verb":"write","scope":"orders:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["APPROVED","REJECTED"]},"note":{"type":"string"}},"required":["id","status"],"additionalProperties":false},"outputSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Updated order row with relations rebuilt — see /api/orders/[id] GET for the canonical shape."},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"orders_update","description":"Updates an existing order. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: orders:write · endpoint: PATCH /api/orders/{id})","http":{"method":"PATCH","path":"/api/orders/{id}"},"feature":"orders","verb":"write","scope":"orders:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"currency":{"type":"string","minLength":1},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"minItems":1,"type":"array","items":{"type":"object","properties":{"itemId":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string","minLength":1},"quantity":{"type":"number","exclusiveMinimum":0},"unitPrice":{"type":"number","minimum":0}},"required":["description","quantity","unitPrice"],"additionalProperties":false}}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"supplierId":{"type":"string"},"orderNumber":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"subtotal":{"type":"number"},"totalAmount":{"type":"number"},"orderDate":{"type":"string"},"expectedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"supplierOrganization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","country","registrationNumber","address"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","email","status","supplierOrganization"],"additionalProperties":false},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"itemId":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"number"},"amount":{"type":"number"},"item":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","sku"],"additionalProperties":false},{"type":"null"}]}},"required":["id","itemId","description","quantity","unitPrice","amount","item"],"additionalProperties":false}},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"type":"string"},"status":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string"}},"required":["id","invoiceNumber","status","total","currency"],"additionalProperties":false}},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"}},"required":["id","status","amount","currency"],"additionalProperties":false},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","supplierId","orderNumber","status","currency","subtotal","totalAmount","orderDate","expectedDate","notes","supplier","items","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"organizations_create","description":"Creates a new organization in the target organization. Returns the created record on success.\n\n(Scope: organizations:write · endpoint: POST /api/organizations)","http":{"method":"POST","path":"/api/organizations"},"feature":"organizations","verb":"write","scope":"organizations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"country":{"type":"string","enum":["ISRAEL","SINGAPORE","USA","GERMANY","NETHERLANDS","SWEDEN","AUSTRIA","FINLAND","DENMARK","SPAIN","SLOVAKIA","IRELAND","LUXEMBOURG","CYPRUS","MALTA","SLOVENIA","CZECH_REPUBLIC","LITHUANIA","LATVIA","ESTONIA","NORWAY","ICELAND","UNITED_KINGDOM","SWITZERLAND","CANADA","AUSTRALIA","NEW_ZEALAND","UAE","BAHRAIN","OMAN","QATAR","KUWAIT","JAPAN","HONG_KONG","TAIWAN","THAILAND","INDONESIA","SOUTH_AFRICA","NIGERIA"]},"registrationNumber":{"type":"string","minLength":1},"address":{"type":"string"},"countrySpecificData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"documentDesignProfile":{"type":"object","properties":{"schemaVersion":{"default":1,"type":"number","const":1},"template":{"default":"minimal","type":"string","enum":["minimal","classic","bold","elegant","compact","tech"]},"accentColor":{"default":"#6A00FF","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"showLogo":{"default":true,"type":"boolean"},"headerLayout":{"default":"left","type":"string","enum":["left","center","right"]},"tableStyle":{"default":"auto","type":"string","enum":["auto","lines","zebra","borderless"]},"background":{"default":"white","type":"string","enum":["white","tint","paper"]},"cornerRadius":{"default":8,"type":"integer","minimum":0,"maximum":20},"includePaymentPage":{"default":true,"type":"boolean"}},"required":["schemaVersion","template","accentColor","showLogo","headerLayout","tableStyle","background","cornerRadius","includePaymentPage"],"additionalProperties":false}},"required":["name","country","registrationNumber"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"documentDesignProfile":{"anyOf":[{"type":"object","properties":{"schemaVersion":{"default":1,"type":"number","const":1},"template":{"default":"minimal","type":"string","enum":["minimal","classic","bold","elegant","compact","tech"]},"accentColor":{"default":"#6A00FF","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"showLogo":{"default":true,"type":"boolean"},"headerLayout":{"default":"left","type":"string","enum":["left","center","right"]},"tableStyle":{"default":"auto","type":"string","enum":["auto","lines","zebra","borderless"]},"background":{"default":"white","type":"string","enum":["white","tint","paper"]},"cornerRadius":{"default":8,"type":"integer","minimum":0,"maximum":20},"includePaymentPage":{"default":true,"type":"boolean"}},"required":["schemaVersion","template","accentColor","showLogo","headerLayout","tableStyle","background","cornerRadius","includePaymentPage"],"additionalProperties":false},{"type":"null"}]},"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"userId":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false}},"required":["id","role","userId","user"],"additionalProperties":false}},"_count":{"type":"object","properties":{"counterpartiesOwning":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["counterpartiesOwning","invoices"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","country","registrationNumber","address","icon","countrySpecificData","documentDesignProfile","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"organizations_delete","description":"Deletes the organization. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: organizations:write · endpoint: DELETE /api/organizations/{id})","http":{"method":"DELETE","path":"/api/organizations/{id}"},"feature":"organizations","verb":"write","scope":"organizations:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"organizations_get","description":"Fetches a single organization by id. Returns 404 if the organization isn't in the caller's accessible organizations.\n\n(Scope: organizations:read · endpoint: GET /api/organizations/{id})","http":{"method":"GET","path":"/api/organizations/{id}"},"feature":"organizations","verb":"read","scope":"organizations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentDesignProfile":{"anyOf":[{"type":"object","properties":{"schemaVersion":{"default":1,"type":"number","const":1},"template":{"default":"minimal","type":"string","enum":["minimal","classic","bold","elegant","compact","tech"]},"accentColor":{"default":"#6A00FF","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"showLogo":{"default":true,"type":"boolean"},"headerLayout":{"default":"left","type":"string","enum":["left","center","right"]},"tableStyle":{"default":"auto","type":"string","enum":["auto","lines","zebra","borderless"]},"background":{"default":"white","type":"string","enum":["white","tint","paper"]},"cornerRadius":{"default":8,"type":"integer","minimum":0,"maximum":20},"includePaymentPage":{"default":true,"type":"boolean"}},"required":["schemaVersion","template","accentColor","showLogo","headerLayout","tableStyle","background","cornerRadius","includePaymentPage"],"additionalProperties":false},{"type":"null"}]},"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"role":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false}},"required":["id","userId","role","user"],"additionalProperties":false}},"_count":{"type":"object","properties":{"counterpartiesOwning":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["counterpartiesOwning","invoices"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","country","registrationNumber","address","icon","countrySpecificData","timezone","documentDesignProfile","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"organizations_icon_create","description":"Creates a new `icon` attached to the given organization.\n\n(Scope: organizations:write · requires MANAGER+ · endpoint: POST /api/organizations/{id}/icon)","http":{"method":"POST","path":"/api/organizations/{id}/icon"},"feature":"organizations","verb":"write","scope":"organizations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"icon":{"type":"string","description":"Same-origin URL where the freshly-uploaded icon can be fetched."}},"required":["success","icon"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"organizations_icon_delete","description":"Removes the association without deleting the underlying record.\n\n(Scope: organizations:write · requires MANAGER+ · endpoint: DELETE /api/organizations/{id}/icon)","http":{"method":"DELETE","path":"/api/organizations/{id}/icon"},"feature":"organizations","verb":"write","scope":"organizations:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"organizations_icon_list","description":"Returns every `icon` row associated with the given organization.\n\n(Scope: organizations:read · endpoint: GET /api/organizations/{id}/icon)","http":{"method":"GET","path":"/api/organizations/{id}/icon"},"feature":"organizations","verb":"read","scope":"organizations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":null,"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"organizations_list","description":"Lists organizations the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: organizations:read · endpoint: GET /api/organizations)","http":{"method":"GET","path":"/api/organizations"},"feature":"organizations","verb":"read","scope":"organizations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":10,"type":"integer","minimum":1,"maximum":100},"search":{"default":"","type":"string"}},"required":["page","limit","search"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"documentDesignProfile":{"anyOf":[{"type":"object","properties":{"schemaVersion":{"default":1,"type":"number","const":1},"template":{"default":"minimal","type":"string","enum":["minimal","classic","bold","elegant","compact","tech"]},"accentColor":{"default":"#6A00FF","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"showLogo":{"default":true,"type":"boolean"},"headerLayout":{"default":"left","type":"string","enum":["left","center","right"]},"tableStyle":{"default":"auto","type":"string","enum":["auto","lines","zebra","borderless"]},"background":{"default":"white","type":"string","enum":["white","tint","paper"]},"cornerRadius":{"default":8,"type":"integer","minimum":0,"maximum":20},"includePaymentPage":{"default":true,"type":"boolean"}},"required":["schemaVersion","template","accentColor","showLogo","headerLayout","tableStyle","background","cornerRadius","includePaymentPage"],"additionalProperties":false},{"type":"null"}]},"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"userId":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false}},"required":["id","role","userId","user"],"additionalProperties":false}},"_count":{"type":"object","properties":{"counterpartiesOwning":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["counterpartiesOwning","invoices"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","country","registrationNumber","address","icon","countrySpecificData","documentDesignProfile","createdAt","updatedAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["organizations","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"organizations_onboarding_list","description":"Returns every `onboarding` row associated with the given organization.\n\n(Scope: organizations:read · endpoint: GET /api/organizations/{id}/onboarding)","http":{"method":"GET","path":"/api/organizations/{id}/onboarding"},"feature":"organizations","verb":"read","scope":"organizations:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["business","payment","tax_authority"]},"status":{"type":"string","enum":["pending","done","skipped","unavailable"]}},"required":["key","status"],"additionalProperties":false}},"currentStep":{"anyOf":[{"type":"string","enum":["business","payment","tax_authority"]},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"dismissedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"notifyWhenAvailable":{"type":"array","items":{"type":"string"}}},"required":["steps","currentStep","completedAt","dismissedAt","notifyWhenAvailable"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"organizations_onboarding_update","description":"Mutates the `onboarding` attached to the given organization.\n\n(Scope: organizations:write · requires CONTRIBUTOR+ · endpoint: PATCH /api/organizations/{id}/onboarding)","http":{"method":"PATCH","path":"/api/organizations/{id}/onboarding"},"feature":"organizations","verb":"write","scope":"organizations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"skip"},"step":{"type":"string","enum":["payment","tax_authority"]}},"required":["type","step"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"unskip"},"step":{"type":"string","enum":["payment","tax_authority"]}},"required":["type","step"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"complete"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"dismissCard"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"setNotify"},"providerId":{"type":"string"},"on":{"type":"boolean"}},"required":["type","providerId","on"],"additionalProperties":false}]}},"required":["id","action"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["business","payment","tax_authority"]},"status":{"type":"string","enum":["pending","done","skipped","unavailable"]}},"required":["key","status"],"additionalProperties":false}},"currentStep":{"anyOf":[{"type":"string","enum":["business","payment","tax_authority"]},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"dismissedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"notifyWhenAvailable":{"type":"array","items":{"type":"string"}}},"required":["steps","currentStep","completedAt","dismissedAt","notifyWhenAvailable"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"organizations_organizations_list","description":"Returns the `organizations` data for the users feature.\n\n(Scope: organizations:read · endpoint: GET /api/user/organizations)","http":{"method":"GET","path":"/api/user/organizations"},"feature":"organizations","verb":"read","scope":"organizations:read","hasBody":false,"inputSchema":{"type":"object","properties":{},"additionalProperties":false},"outputSchema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"documentDesignProfile":{"anyOf":[{"type":"object","properties":{"schemaVersion":{"default":1,"type":"number","const":1},"template":{"default":"minimal","type":"string","enum":["minimal","classic","bold","elegant","compact","tech"]},"accentColor":{"default":"#6A00FF","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"showLogo":{"default":true,"type":"boolean"},"headerLayout":{"default":"left","type":"string","enum":["left","center","right"]},"tableStyle":{"default":"auto","type":"string","enum":["auto","lines","zebra","borderless"]},"background":{"default":"white","type":"string","enum":["white","tint","paper"]},"cornerRadius":{"default":8,"type":"integer","minimum":0,"maximum":20},"includePaymentPage":{"default":true,"type":"boolean"}},"required":["schemaVersion","template","accentColor","showLogo","headerLayout","tableStyle","background","cornerRadius","includePaymentPage"],"additionalProperties":false},{"type":"null"}]},"role":{"type":"string","description":"Caller's role in this org — MANAGER | CONTRIBUTOR | VIEWER."},"selfServiceOnly":{"type":"boolean","description":"This membership is an employee self-service login (law 33): the caller reaches only their own records in this org. The shell reads it to render the employee surface instead of the org-wide one."}},"required":["id","name","country","icon","registrationNumber","address","countrySpecificData","documentDesignProfile","role","selfServiceOnly"],"additionalProperties":false}},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"organizations_replace","description":"Replaces an existing organization. All required fields must be supplied — omitted fields revert to their schema defaults.\n\n(Scope: organizations:write · endpoint: PUT /api/organizations/{id})","http":{"method":"PUT","path":"/api/organizations/{id}"},"feature":"organizations","verb":"write","scope":"organizations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"registrationNumber":{"type":"string","minLength":1},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"documentDesignProfile":{"anyOf":[{"type":"object","properties":{"schemaVersion":{"default":1,"type":"number","const":1},"template":{"default":"minimal","type":"string","enum":["minimal","classic","bold","elegant","compact","tech"]},"accentColor":{"default":"#6A00FF","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"showLogo":{"default":true,"type":"boolean"},"headerLayout":{"default":"left","type":"string","enum":["left","center","right"]},"tableStyle":{"default":"auto","type":"string","enum":["auto","lines","zebra","borderless"]},"background":{"default":"white","type":"string","enum":["white","tint","paper"]},"cornerRadius":{"default":8,"type":"integer","minimum":0,"maximum":20},"includePaymentPage":{"default":true,"type":"boolean"}},"required":["schemaVersion","template","accentColor","showLogo","headerLayout","tableStyle","background","cornerRadius","includePaymentPage"],"additionalProperties":false},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentDesignProfile":{"anyOf":[{"type":"object","properties":{"schemaVersion":{"default":1,"type":"number","const":1},"template":{"default":"minimal","type":"string","enum":["minimal","classic","bold","elegant","compact","tech"]},"accentColor":{"default":"#6A00FF","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"showLogo":{"default":true,"type":"boolean"},"headerLayout":{"default":"left","type":"string","enum":["left","center","right"]},"tableStyle":{"default":"auto","type":"string","enum":["auto","lines","zebra","borderless"]},"background":{"default":"white","type":"string","enum":["white","tint","paper"]},"cornerRadius":{"default":8,"type":"integer","minimum":0,"maximum":20},"includePaymentPage":{"default":true,"type":"boolean"}},"required":["schemaVersion","template","accentColor","showLogo","headerLayout","tableStyle","background","cornerRadius","includePaymentPage"],"additionalProperties":false},{"type":"null"}]},"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"role":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false}},"required":["id","userId","role","user"],"additionalProperties":false}},"_count":{"type":"object","properties":{"counterpartiesOwning":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["counterpartiesOwning","invoices"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","country","registrationNumber","address","icon","countrySpecificData","timezone","documentDesignProfile","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"organizations_update","description":"Updates an existing organization. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: organizations:write · endpoint: PATCH /api/organizations/{id})","http":{"method":"PATCH","path":"/api/organizations/{id}"},"feature":"organizations","verb":"write","scope":"organizations:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"registrationNumber":{"type":"string","minLength":1},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"documentDesignProfile":{"anyOf":[{"type":"object","properties":{"schemaVersion":{"default":1,"type":"number","const":1},"template":{"default":"minimal","type":"string","enum":["minimal","classic","bold","elegant","compact","tech"]},"accentColor":{"default":"#6A00FF","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"showLogo":{"default":true,"type":"boolean"},"headerLayout":{"default":"left","type":"string","enum":["left","center","right"]},"tableStyle":{"default":"auto","type":"string","enum":["auto","lines","zebra","borderless"]},"background":{"default":"white","type":"string","enum":["white","tint","paper"]},"cornerRadius":{"default":8,"type":"integer","minimum":0,"maximum":20},"includePaymentPage":{"default":true,"type":"boolean"}},"required":["schemaVersion","template","accentColor","showLogo","headerLayout","tableStyle","background","cornerRadius","includePaymentPage"],"additionalProperties":false},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentDesignProfile":{"anyOf":[{"type":"object","properties":{"schemaVersion":{"default":1,"type":"number","const":1},"template":{"default":"minimal","type":"string","enum":["minimal","classic","bold","elegant","compact","tech"]},"accentColor":{"default":"#6A00FF","type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"showLogo":{"default":true,"type":"boolean"},"headerLayout":{"default":"left","type":"string","enum":["left","center","right"]},"tableStyle":{"default":"auto","type":"string","enum":["auto","lines","zebra","borderless"]},"background":{"default":"white","type":"string","enum":["white","tint","paper"]},"cornerRadius":{"default":8,"type":"integer","minimum":0,"maximum":20},"includePaymentPage":{"default":true,"type":"boolean"}},"required":["schemaVersion","template","accentColor","showLogo","headerLayout","tableStyle","background","cornerRadius","includePaymentPage"],"additionalProperties":false},{"type":"null"}]},"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"role":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false}},"required":["id","userId","role","user"],"additionalProperties":false}},"_count":{"type":"object","properties":{"counterpartiesOwning":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["counterpartiesOwning","invoices"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","country","registrationNumber","address","icon","countrySpecificData","timezone","documentDesignProfile","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"payments_create","description":"Creates a new payment in the target organization. Returns the created record on success.\n\n(Scope: payments:write · requires CONTRIBUTOR+ · endpoint: POST /api/payments)","http":{"method":"POST","path":"/api/payments"},"feature":"payments","verb":"write","scope":"payments:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string"},"amount":{"type":"number","exclusiveMinimum":0},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentIds":{"minItems":1,"type":"array","items":{"type":"string"}},"allocations":{"minItems":1,"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string"},"amount":{"type":"number","exclusiveMinimum":0}},"required":["lineId","amount"],"additionalProperties":false}},"allowUnallocated":{"type":"boolean"}},"required":["organizationId","amount","paidAt"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"amount":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"allocations":{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string"},"amount":{"type":"number","exclusiveMinimum":0}},"required":["lineId","amount"],"additionalProperties":false}},"unallocated":{"type":"number"},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"paidAmount":{"type":"number"},"total":{"type":"number"}},"required":["id","status","paidAmount","total"],"additionalProperties":false}}},"required":["id","organizationId","amount","paidAt","method","allocations","unallocated","documents"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"payments_delete","description":"Deletes the payment. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: payments:write · requires CONTRIBUTOR+ · endpoint: DELETE /api/payments/{id})","http":{"method":"DELETE","path":"/api/payments/{id}"},"feature":"payments","verb":"write","scope":"payments:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"reversed":{"type":"boolean"},"documentIds":{"type":"array","items":{"type":"string"},"description":"Documents whose settled status changed."}},"required":["reversed","documentIds"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"payroll_advance_create","description":"Performs the `advance` operation for the payrolls feature.\n\n(Scope: payroll:write · requires CONTRIBUTOR+ · endpoint: POST /api/payroll/advance)","http":{"method":"POST","path":"/api/payroll/advance"},"feature":"payroll","verb":"write","scope":"payroll:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string","minLength":1},"amount":{"type":"number","exclusiveMinimum":0},"paidAt":{"type":"string"},"method":{"type":"string"}},"required":["organizationId","counterpartyId","amount","paidAt"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"paymentId":{"type":"string"}},"required":["paymentId"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"payroll_apply_create","description":"Performs the `apply` operation for the payrolls feature.\n\n(Scope: payroll:write · requires CONTRIBUTOR+ · endpoint: POST /api/payroll/apply)","http":{"method":"POST","path":"/api/payroll/apply"},"feature":"payroll","verb":"write","scope":"payroll:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"payslipId":{"type":"string","minLength":1},"authorizeFinalPaySetoff":{"type":"boolean"},"consent":{"type":"object","properties":{"affirmed":{"type":"boolean"},"at":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"attachmentId":{"type":"string","minLength":1}},"required":["affirmed"],"additionalProperties":false}},"required":["organizationId","payslipId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"applied":{"type":"number"},"status":{"type":"string"},"residualAdvanceDebt":{"type":"number"}},"required":["applied","status","residualAdvanceDebt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"payroll_approve_create","description":"Performs the `approve` operation for the payrolls feature.\n\n(Scope: payroll:write · requires CONTRIBUTOR+ · endpoint: POST /api/payroll/approve)","http":{"method":"POST","path":"/api/payroll/approve"},"feature":"payroll","verb":"write","scope":"payroll:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"month":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"payslipIds":{"type":"array","items":{"type":"string"}}},"required":["organizationId","month"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"approved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["approved"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"payroll_consent_upload_create","description":"Performs the `consent-upload` operation for the payrolls feature.\n\n(Scope: payroll:write · requires CONTRIBUTOR+ · endpoint: POST /api/payroll/consent-upload)","http":{"method":"POST","path":"/api/payroll/consent-upload"},"feature":"payroll","verb":"write","scope":"payroll:write","hasBody":true,"inputSchema":{"type":"object","properties":{},"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"fileSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageUrl":{"type":"string"}},"required":["id","documentId","fileName","fileType","fileSize","storageUrl"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"payroll_generate_create","description":"Performs the `generate` operation for the payrolls feature.\n\n(Scope: payroll:write · requires CONTRIBUTOR+ · endpoint: POST /api/payroll/generate)","http":{"method":"POST","path":"/api/payroll/generate"},"feature":"payroll","verb":"write","scope":"payroll:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"month":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"employeeIds":{"type":"array","items":{"type":"string"}},"runInputs":{"type":"object","properties":{"additionalWage":{"type":"number","minimum":0},"adjustments":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"amount":{"type":"number"},"kind":{"type":"string","enum":["OTHER","LEAVE_PAY","REIMBURSEMENT"]}},"required":["description","amount"],"additionalProperties":false}}},"additionalProperties":false}},"required":["organizationId","month"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"generated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"errors":{"type":"array","items":{"type":"object","properties":{"counterpartyId":{"type":"string"},"message":{"type":"string"}},"required":["counterpartyId","message"],"additionalProperties":false}}},"required":["generated","errors"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"payroll_gpl_settle_create","description":"Performs the `gpl-settle` operation for the payrolls feature.\n\n(Scope: payroll:write · requires CONTRIBUTOR+ · endpoint: POST /api/payroll/gpl-settle)","http":{"method":"POST","path":"/api/payroll/gpl-settle"},"feature":"payroll","verb":"write","scope":"payroll:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"authorityOrgId":{"type":"string","minLength":1},"lineIds":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"amount":{"type":"number","exclusiveMinimum":0},"paidAt":{"type":"string"},"method":{"type":"string"}},"required":["organizationId","authorityOrgId","lineIds","paidAt"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"paymentId":{"type":"string"},"allocated":{"type":"number"},"outstanding":{"type":"number"}},"required":["paymentId","allocated","outstanding"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"payroll_pay_create","description":"Performs the `pay` operation for the payrolls feature.\n\n(Scope: payroll:write · requires CONTRIBUTOR+ · endpoint: POST /api/payroll/pay)","http":{"method":"POST","path":"/api/payroll/pay"},"feature":"payroll","verb":"write","scope":"payroll:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"payslipId":{"type":"string","minLength":1},"kind":{"type":"string","enum":["NET","STATUTORY"]},"paidAt":{"type":"string"},"method":{"type":"string"},"claimDocumentIds":{"description":"Approved expense claims the employee fronted, to reimburse with this net payment. Each must be booked, owed to THIS payslip's employee, in the payslip's currency, and still outstanding.","type":"array","items":{"type":"string","minLength":1}}},"required":["organizationId","payslipId","kind","paidAt"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"paymentId":{"type":"string"},"allocated":{"type":"number"},"status":{"type":"string"}},"required":["paymentId","allocated","status"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"payroll_payments_list","description":"Returns the `payments` data for the payrolls feature.\n\n(Scope: payroll:read · requires CONTRIBUTOR+ · endpoint: GET /api/payroll/payments)","http":{"method":"GET","path":"/api/payroll/payments"},"feature":"payroll","verb":"read","scope":"payroll:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"month":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}},"required":["organizationId","month"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"month":{"type":"string"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"paidAt":{"type":"string"},"counterpartyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"employeeName":{"type":"string"},"amount":{"type":"number"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"allocatedTotal":{"type":"number"},"openRemainder":{"type":"number"},"source":{"type":"string","enum":["ADVANCE","NET","STATUTORY"]},"payslipIds":{"type":"array","items":{"type":"string"}}},"required":["id","paidAt","counterpartyId","employeeName","amount","method","allocatedTotal","openRemainder","source","payslipIds"],"additionalProperties":false}}},"required":["month","payments"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"payroll_payslip_delete","description":"Removes the `payslip` configuration for the payrolls feature.\n\n(Scope: payroll:write · requires CONTRIBUTOR+ · endpoint: DELETE /api/payroll/payslip)","http":{"method":"DELETE","path":"/api/payroll/payslip"},"feature":"payroll","verb":"write","scope":"payroll:write","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"payslipId":{"type":"string","minLength":1}},"required":["organizationId","payslipId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"payroll_regenerate_create","description":"Performs the `regenerate` operation for the payrolls feature.\n\n(Scope: payroll:write · requires CONTRIBUTOR+ · endpoint: POST /api/payroll/regenerate)","http":{"method":"POST","path":"/api/payroll/regenerate"},"feature":"payroll","verb":"write","scope":"payroll:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"payslipId":{"type":"string","minLength":1},"runInputs":{"type":"object","properties":{"additionalWage":{"type":"number","minimum":0},"adjustments":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"amount":{"type":"number"},"kind":{"type":"string","enum":["OTHER","LEAVE_PAY","REIMBURSEMENT"]}},"required":["description","amount"],"additionalProperties":false}}},"additionalProperties":false}},"required":["organizationId","payslipId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"documentId":{"type":"string"},"total":{"type":"number"},"lineCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["documentId","total","lineCount"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"payroll_summary_list","description":"Returns the `summary` data for the payrolls feature.\n\n(Scope: payroll:read · requires CONTRIBUTOR+ · endpoint: GET /api/payroll/summary)","http":{"method":"GET","path":"/api/payroll/summary"},"feature":"payroll","verb":"read","scope":"payroll:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"month":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}},"required":["organizationId","month"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"month":{"type":"string"},"schemes":{"type":"array","items":{"type":"string"}},"schemeLabels":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"employees":{"type":"array","items":{"type":"object","properties":{"counterpartyId":{"type":"string"},"name":{"type":"string"},"payslipId":{"type":"string"},"status":{"type":"string","enum":["DRAFT","APPROVED","PAID"]},"gross":{"type":"number"},"net":{"type":"number"},"schemeAmounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"openCredit":{"type":"number"},"netOutstanding":{"type":"number"},"statutoryOutstanding":{"type":"number"},"hasAppliedAdvances":{"type":"boolean"},"hasPayments":{"type":"boolean"},"isFinalPayslip":{"type":"boolean"}},"required":["counterpartyId","name","openCredit"],"additionalProperties":false}},"totals":{"type":"object","properties":{"gross":{"type":"number"},"net":{"type":"number"},"employerCost":{"type":"number"},"openCredits":{"type":"number"}},"required":["gross","net","employerCost","openCredits"],"additionalProperties":false},"gplOutstanding":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string"},"authorityOrgId":{"anyOf":[{"type":"string"},{"type":"null"}]},"authorityName":{"anyOf":[{"type":"string"},{"type":"null"}]},"claimed":{"type":"number"},"settled":{"type":"number"},"outstanding":{"type":"number"},"oldestUnsettledCovers":{"anyOf":[{"type":"string"},{"type":"null"}]},"ageDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"lineIds":{"type":"array","items":{"type":"string"}}},"required":["scheme","authorityOrgId","authorityName","claimed","settled","outstanding","oldestUnsettledCovers","ageDays","lineIds"],"additionalProperties":false}},"reimbOutstanding":{"type":"array","items":{"type":"object","properties":{"counterpartyId":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"documentIds":{"type":"array","items":{"type":"string"}}},"required":["counterpartyId","amount","currency","documentIds"],"additionalProperties":false}}},"required":["month","schemes","schemeLabels","employees","totals","gplOutstanding","reimbOutstanding"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"payroll_unapply_create","description":"Performs the `unapply` operation for the payrolls feature.\n\n(Scope: payroll:write · requires CONTRIBUTOR+ · endpoint: POST /api/payroll/unapply)","http":{"method":"POST","path":"/api/payroll/unapply"},"feature":"payroll","verb":"write","scope":"payroll:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"payslipId":{"type":"string","minLength":1}},"required":["organizationId","payslipId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"unapplied":{"type":"number"},"status":{"type":"string"},"attachedPaymentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["unapplied","status","attachedPaymentCount"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"payroll_void_create","description":"Performs the `void` operation for the payrolls feature.\n\n(Scope: payroll:write · requires CONTRIBUTOR+ · endpoint: POST /api/payroll/void)","http":{"method":"POST","path":"/api/payroll/void"},"feature":"payroll","verb":"write","scope":"payroll:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"payslipId":{"type":"string","minLength":1}},"required":["organizationId","payslipId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"receipts_create","description":"Creates a new receipt in the target organization. Returns the created record on success.\n\n(Scope: invoices:write · requires CONTRIBUTOR+ · endpoint: POST /api/receipts)","http":{"method":"POST","path":"/api/receipts"},"feature":"invoices","verb":"write","scope":"invoices:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"counterpartyId":{"type":"string","minLength":1},"bankAccountId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"currency":{"type":"string","minLength":1},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"minItems":1,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1},"quantity":{"type":"number","exclusiveMinimum":0},"unitPrice":{"type":"number","minimum":0},"amount":{"type":"number","exclusiveMinimum":0}},"required":["description","quantity","unitPrice","amount"],"additionalProperties":false}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"sendReceiptEmail":{"default":false,"type":"boolean"},"additionalEmails":{"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"required":["organizationId","counterpartyId","currency","paidAt","items","sendReceiptEmail"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"receipt":{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNumber":{"type":"string"},"organizationId":{"type":"string"},"customerId":{"type":"string"},"bankAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"status":{"type":"string","enum":["DRAFT","UNSENT","SENT","PAID","PENDING_REVIEW","APPROVED","REJECTED","INVOICED"]},"documentType":{"type":"string","enum":["INVOICE","RECEIPT","INVOICE_RECEIPT","PAYMENT_REQUEST","CREDIT_MEMO","DEBIT_MEMO","PURCHASE_ORDER","PAYSLIP","FINE_NOTICE","CHARGE_CONFIRMATION","STATEMENT","SUMMARY"]},"direction":{"type":"string","enum":["OUTGOING","INCOMING"]},"relatedDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"issueDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"payUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"number"},"amount":{"type":"number"}},"required":["id","description","quantity","unitPrice","amount"],"additionalProperties":false}},"subtotal":{"type":"number"},"taxRate":{"type":"number"},"taxAmount":{"type":"number"},"total":{"type":"number"},"paidAmount":{"type":"number"},"payments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"allocated":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","amount","allocated","paidAt","method"],"additionalProperties":false}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"total":{"type":"number"},"issueDate":{"type":"string"},"paymentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelled":{"type":"boolean"},"cancellationDocumentId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","invoiceNumber","total","issueDate","paymentId","paymentDate","paymentMethod","cancelled","cancellationDocumentId"],"additionalProperties":false}},"receiptNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"type":"string"},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","country"],"additionalProperties":false},{"type":"null"}]},"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string","enum":["ISRAEL","SINGAPORE","USA","GERMANY","NETHERLANDS","SWEDEN","AUSTRIA","FINLAND","DENMARK","SPAIN","SLOVAKIA","IRELAND","LUXEMBOURG","CYPRUS","MALTA","SLOVENIA","CZECH_REPUBLIC","LITHUANIA","LATVIA","ESTONIA","NORWAY","ICELAND","UNITED_KINGDOM","SWITZERLAND","CANADA","AUSTRALIA","NEW_ZEALAND","UAE","BAHRAIN","OMAN","QATAR","KUWAIT","JAPAN","HONG_KONG","TAIWAN","THAILAND","INDONESIA","SOUTH_AFRICA","NIGERIA"]},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"icon":{"anyOf":[{"type":"string"},{"type":"null"}]},"countrySpecificData":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["id","name","country","registrationNumber","countrySpecificData"],"additionalProperties":false},"bankAccount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"accountName":{"type":"string"},"bankName":{"type":"string"},"accountNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"currencies":{"type":"array","items":{"type":"string"}},"branchCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"localBankCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"swiftCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"type":"string"},{"type":"null"}]},"routingNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","accountName","bankName","currencies","isDefault"],"additionalProperties":false},{"type":"null"}]}},"required":["id","invoiceNumber","documentNumber","organizationId","customerId","bankAccountId","currency","status","documentType","direction","relatedDocumentId","issueDate","dueDate","payUntil","items","subtotal","taxRate","taxAmount","total","paidAmount","receiptNumber","paymentDate","paymentMethod","countrySpecificData","notes","customer"],"additionalProperties":false},"payment":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"amount":{"type":"number"},"paidAt":{"type":"string"},"method":{"anyOf":[{"type":"string"},{"type":"null"}]},"allocations":{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string"},"amount":{"type":"number"}},"required":["lineId","amount"],"additionalProperties":false}},"unallocated":{"type":"number"},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"paidAmount":{"type":"number"},"total":{"type":"number"}},"required":["id","status","paidAmount","total"],"additionalProperties":false}}},"required":["id","organizationId","amount","paidAt","method","allocations","unallocated","documents"],"additionalProperties":false},"emailsSent":{"type":"number"},"emailsFailed":{"type":"number"}},"required":["receipt","payment"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"reports_get","description":"Fetches a single report by id. Returns 404 if the report isn't in the caller's accessible organizations.\n\n(Scope: reports:read · endpoint: GET /api/reports/{reportType})","http":{"method":"GET","path":"/api/reports/{reportType}"},"feature":"reports","verb":"read","scope":"reports:read","hasBody":false,"inputSchema":{"type":"object","properties":{"reportType":{"type":"string"},"organizationId":{"type":"string","minLength":1}},"required":["reportType","organizationId"],"additionalProperties":{}},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Generated report data — shape varies by report type (rows, totals, charts, etc.). See src/lib/reports/types.ts:ReportData and the per-report adapter in src/lib/reports/generators/."}},"required":["success","data"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false},"meta":{"ui":{"resourceUri":"ui://guliel/report-viewer"},"ui/resourceUri":"ui://guliel/report-viewer","openai/outputTemplate":"ui://guliel/report-viewer"}},{"name":"reports_list","description":"Lists reports the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: reports:read · endpoint: GET /api/reports)","http":{"method":"GET","path":"/api/reports"},"feature":"reports","verb":"read","scope":"reports:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"type":{"type":"string"},"category":{"type":"string"},"search":{"type":"string"}},"required":["organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"reports":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Report definitions (name, description, parameters, columns). The full shape lives in src/lib/reports/types.ts:ReportDefinition."},"organizationCountry":{"type":"string"}},"required":["success","reports","organizationCountry"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"reports_schema_list","description":"Returns every `schema` row associated with the given report.\n\n(Scope: reports:read · endpoint: GET /api/reports/{reportType}/schema)","http":{"method":"GET","path":"/api/reports/{reportType}/schema"},"feature":"reports","verb":"read","scope":"reports:read","hasBody":false,"inputSchema":{"type":"object","properties":{"reportType":{"type":"string"},"organizationId":{"type":"string","minLength":1}},"required":["reportType","organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"definition":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Report definition (name, description, columns, parameters). See src/lib/reports/types.ts:ReportDefinition for the full shape."}},"required":["success","definition"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"settings_list","description":"Lists settingses the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: settings:read · endpoint: GET /api/settings)","http":{"method":"GET","path":"/api/settings"},"feature":"settings","verb":"read","scope":"settings:read","hasBody":false,"inputSchema":{"type":"object","properties":{},"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"theme":{"type":"string","description":"light | dark | system"},"language":{"type":"string"},"defaultOrganizationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"preferences":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","userId","theme","language","defaultOrganizationId","preferences","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"settings_refresh_create","description":"Performs the `refresh` operation for the exchange rates feature.\n\n(Scope: settings:write · endpoint: POST /api/exchange-rates/refresh)","http":{"method":"POST","path":"/api/exchange-rates/refresh"},"feature":"settings","verb":"write","scope":"settings:write","hasBody":true,"inputSchema":{"type":"object","properties":{},"additionalProperties":false},"outputSchema":{"type":"object","properties":{"message":{"type":"string"},"date":{"type":"string","description":"ISO date of the FX snapshot that's now active."},"ratesCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many currency pairs were refreshed."}},"required":["message","date","ratesCount"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"settings_replace","description":"Replaces an existing settings. All required fields must be supplied — omitted fields revert to their schema defaults.\n\n(Scope: settings:write · endpoint: PUT /api/settings)","http":{"method":"PUT","path":"/api/settings"},"feature":"settings","verb":"write","scope":"settings:write","hasBody":true,"inputSchema":{"type":"object","properties":{"theme":{"type":"string","enum":["light","dark","system"]},"language":{"type":"string"},"defaultOrganizationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"preferences":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"theme":{"type":"string","description":"light | dark | system"},"language":{"type":"string"},"defaultOrganizationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"preferences":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","userId","theme","language","defaultOrganizationId","preferences","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"supplier_orders_get","description":"Fetches a single supplier order by id. Returns 404 if the supplier order isn't in the caller's accessible organizations.\n\n(Scope: orders:read · endpoint: GET /api/supplier-orders/{id})","http":{"method":"GET","path":"/api/supplier-orders/{id}"},"feature":"orders","verb":"read","scope":"orders:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"supplierId":{"anyOf":[{"type":"string"},{"type":"null"}]},"counterpartyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"orderNumber":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"subtotal":{"type":"number"},"orderDate":{"type":"string"},"expectedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"organization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","country","address"],"additionalProperties":false},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierOrganizationId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","supplierOrganizationId"],"additionalProperties":false},{"type":"null"}],"description":"The supplier Counterparty edge — display fields resolved through the linked party; `supplierOrganizationId` maps to Counterparty.otherOrganizationId."},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"itemId":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"number"},"amount":{"type":"number"},"item":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","sku"],"additionalProperties":false},{"type":"null"}]}},"required":["id","itemId","description","quantity","unitPrice","amount","item"],"additionalProperties":false}},"invoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"invoiceNumber":{"type":"string"},"status":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string"}},"required":["id","invoiceNumber","status","total","currency"],"additionalProperties":false}},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","supplierId","counterpartyId","orderNumber","status","currency","subtotal","orderDate","expectedDate","notes","organization","supplier","items","invoices","createdBy","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"supplier_orders_list","description":"Lists supplier orders the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: orders:read · endpoint: GET /api/supplier-orders)","http":{"method":"GET","path":"/api/supplier-orders"},"feature":"orders","verb":"read","scope":"orders:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":20,"type":"integer","minimum":1,"maximum":100},"status":{"type":"string"},"search":{"default":"","type":"string"},"clientOrgId":{"type":"string"}},"required":["organizationId","page","limit","search"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"orders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string","description":"The CLIENT org that placed the order (not the supplier-side org)."},"supplierId":{"anyOf":[{"type":"string"},{"type":"null"}]},"counterpartyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"orderNumber":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"subtotal":{"type":"number"},"orderDate":{"type":"string"},"expectedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"organization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"}},"required":["id","name","country"],"additionalProperties":false},{"type":"null"}]},"supplier":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}],"description":"The supplier Counterparty edge, with display name resolved through the linked party."},"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"_count":{"type":"object","properties":{"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoices"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","supplierId","counterpartyId","orderNumber","status","currency","subtotal","orderDate","expectedDate","organization","supplier","items","createdAt","updatedAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["orders","pagination"],"additionalProperties":false,"description":"Orders the caller's org has received as a supplier. Inverse of /api/orders, which lists orders placed by the caller's org."},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"suppliers_create","description":"Creates a new supplier in the target organization. Returns the created record on success.\n\n(Scope: suppliers:write · requires CONTRIBUTOR+ · endpoint: POST /api/suppliers)","http":{"method":"POST","path":"/api/suppliers"},"feature":"suppliers","verb":"write","scope":"suppliers:write","hasBody":true,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"mode":{"default":"email","type":"string","enum":["email","link","manual"]},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string"},"phone":{"type":"string"},"address":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"}},"required":["organizationId","mode"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string","description":"Counterparty edge id."},"organizationId":{"type":"string"},"kind":{"type":"string","enum":["ORGANIZATION","INDIVIDUAL"],"description":"ORGANIZATION = a business supplier (linked Organization); INDIVIDUAL = a freelance/private-person supplier."},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"status":{"type":"string","description":"ACTIVE | PENDING | INACTIVE — pending suppliers represent unaccepted invitations."},"invitationMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"invitedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"acceptedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"acceptedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierOrganizationId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Set when this supplier is itself an Organization (business supplier). Maps to Counterparty.otherOrganizationId."},"activeOrderCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","kind","name","contactName","email","phone","address","country","registrationNumber","defaultCurrencies","status","invitationMethod","invitedAt","acceptedAt","acceptedByUserId","supplierOrganizationId","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"suppliers_csv_list","description":"Streams the caller's suppliers as a CSV file. Filter parameters scope the export the same way the list endpoint does.\n\n(Scope: suppliers:read · endpoint: GET /api/suppliers/export/csv)","http":{"method":"GET","path":"/api/suppliers/export/csv"},"feature":"suppliers","verb":"read","scope":"suppliers:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"status":{"type":"string"},"search":{"type":"string"}},"required":["organizationId"],"additionalProperties":false},"outputSchema":null,"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"suppliers_delete","description":"Deletes the supplier. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: suppliers:write · endpoint: DELETE /api/suppliers/{id})","http":{"method":"DELETE","path":"/api/suppliers/{id}"},"feature":"suppliers","verb":"write","scope":"suppliers:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"mode":{"anyOf":[{"type":"string","const":"soft"},{"type":"string","const":"hard"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true},"mode":{"anyOf":[{"type":"string","const":"hard"},{"type":"string","const":"soft"}],"description":"Which delete path executed — hard removes the row, soft sets status=INACTIVE to preserve order history."}},"required":["success","mode"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"suppliers_get","description":"Fetches a single supplier by id. Returns 404 if the supplier isn't in the caller's accessible organizations.\n\n(Scope: suppliers:read · endpoint: GET /api/suppliers/{id})","http":{"method":"GET","path":"/api/suppliers/{id}"},"feature":"suppliers","verb":"read","scope":"suppliers:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"kind":{"anyOf":[{"type":"string","enum":["ORGANIZATION","INDIVIDUAL"]},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"acceptedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierOrganizationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierOrganization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","country","registrationNumber","address"],"additionalProperties":false},{"type":"null"}]},"activeOrderCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","kind","name","email","phone","address","country","registrationNumber","defaultCurrencies","status","acceptedByUserId","supplierOrganizationId","supplierOrganization","activeOrderCount","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"suppliers_items_list","description":"Returns every `items` row associated with the given supplier.\n\n(Scope: suppliers:read · endpoint: GET /api/suppliers/{id}/items)","http":{"method":"GET","path":"/api/suppliers/{id}/items"},"feature":"suppliers","verb":"read","scope":"suppliers:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitPrice":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"availableForExternalOrder":{"type":"boolean"}},"required":["id","name","description","sku","unitPrice","currency","isActive","availableForExternalOrder"],"additionalProperties":false}}},"required":["items"],"additionalProperties":false,"description":"Supplier-published catalog. Empty for individual suppliers (no linked Organization)."},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"suppliers_list","description":"Lists suppliers the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: suppliers:read · endpoint: GET /api/suppliers)","http":{"method":"GET","path":"/api/suppliers"},"feature":"suppliers","verb":"read","scope":"suppliers:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":20,"type":"integer","minimum":1,"maximum":100},"search":{"default":"","type":"string"},"status":{"default":"ACTIVE","type":"string"},"sortBy":{"default":"createdAt","type":"string","enum":["name","email","status","createdAt"]},"sortOrder":{"default":"desc","type":"string","enum":["asc","desc"]}},"required":["organizationId","page","limit","search","status","sortBy","sortOrder"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"suppliers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Counterparty edge id."},"organizationId":{"type":"string"},"kind":{"type":"string","enum":["ORGANIZATION","INDIVIDUAL"],"description":"ORGANIZATION = a business supplier (linked Organization); INDIVIDUAL = a freelance/private-person supplier."},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"contactName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"status":{"type":"string","description":"ACTIVE | PENDING | INACTIVE — pending suppliers represent unaccepted invitations."},"invitationMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"invitedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"acceptedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"acceptedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierOrganizationId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Set when this supplier is itself an Organization (business supplier). Maps to Counterparty.otherOrganizationId."},"activeOrderCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","kind","name","contactName","email","phone","address","country","registrationNumber","defaultCurrencies","status","invitationMethod","invitedAt","acceptedAt","acceptedByUserId","supplierOrganizationId","activeOrderCount","createdAt","updatedAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["suppliers","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"suppliers_replace","description":"Replaces an existing supplier. All required fields must be supplied — omitted fields revert to their schema defaults.\n\n(Scope: suppliers:write · endpoint: PUT /api/suppliers/{id})","http":{"method":"PUT","path":"/api/suppliers/{id}"},"feature":"suppliers","verb":"write","scope":"suppliers:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"email":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"kind":{"anyOf":[{"type":"string","enum":["ORGANIZATION","INDIVIDUAL"]},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"acceptedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierOrganizationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierOrganization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","country","registrationNumber","address"],"additionalProperties":false},{"type":"null"}]},"activeOrderCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","kind","name","email","phone","address","country","registrationNumber","defaultCurrencies","status","acceptedByUserId","supplierOrganizationId","supplierOrganization","activeOrderCount","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"suppliers_resend_invitation_create","description":"Creates a new `resend-invitation` attached to the given supplier.\n\n(Scope: suppliers:write · endpoint: POST /api/suppliers/{id}/resend-invitation)","http":{"method":"POST","path":"/api/suppliers/{id}/resend-invitation"},"feature":"suppliers","verb":"write","scope":"suppliers:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"supplier":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","description":"Counterparty status — PENDING while the invitation is outstanding."},"invitedEmail":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Resolved recipient email; null if the supplier has no email on file."},"invitedAt":{"type":"string","description":"ISO timestamp of when the (re)invitation was issued."}},"required":["id","status","invitedEmail","invitedAt"],"additionalProperties":false},"inviteUrl":{"type":"string","description":"Pre-signed invitation acceptance URL the recipient can open."},"emailSent":{"type":"boolean","description":"False if the supplier had no email on file; the inviteUrl still works."}},"required":["supplier","inviteUrl","emailSent"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":true,"destructiveHint":false}},{"name":"suppliers_update","description":"Updates an existing supplier. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: suppliers:write · endpoint: PATCH /api/suppliers/{id})","http":{"method":"PATCH","path":"/api/suppliers/{id}"},"feature":"suppliers","verb":"write","scope":"suppliers:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"email":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"kind":{"anyOf":[{"type":"string","enum":["ORGANIZATION","INDIVIDUAL"]},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"registrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultCurrencies":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"acceptedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierOrganizationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierOrganization":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"registrationNumber":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","country","registrationNumber","address"],"additionalProperties":false},{"type":"null"}]},"activeOrderCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","kind","name","email","phone","address","country","registrationNumber","defaultCurrencies","status","acceptedByUserId","supplierOrganizationId","supplierOrganization","activeOrderCount","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"users_create","description":"Creates a new user in the target organization. Returns the created record on success.\n\n(Scope: users:write · requires MANAGER+ · endpoint: POST /api/users)","http":{"method":"POST","path":"/api/users"},"feature":"users","verb":"write","scope":"users:write","hasBody":true,"inputSchema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1},"orgRole":{"type":"string","enum":["MANAGER","CONTRIBUTOR","VIEWER"]}},"required":["email","name","organizationId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","email","name","createdAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"users_delete","description":"Deletes the user. Some endpoints hard-delete the row, others soft-revoke (set `revokedAt`). Check the response shape.\n\n(Scope: users:write · endpoint: DELETE /api/users/{id})","http":{"method":"DELETE","path":"/api/users/{id}"},"feature":"users","verb":"write","scope":"users:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"users_get","description":"Fetches a single user by id. Returns 404 if the user isn't in the caller's accessible organizations.\n\n(Scope: users:read · endpoint: GET /api/users/{id})","http":{"method":"GET","path":"/api/users/{id}"},"feature":"users","verb":"read","scope":"users:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"organizations":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"required":["role","organization"],"additionalProperties":false}}},"required":["id","email","name","createdAt"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"users_list","description":"Lists users the caller can see. Results are filtered by the caller's accessible organizations; many routes paginate via `page` and `limit`.\n\n(Scope: users:read · requires MANAGER+ · endpoint: GET /api/users)","http":{"method":"GET","path":"/api/users"},"feature":"users","verb":"read","scope":"users:read","hasBody":false,"inputSchema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"page":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"limit":{"default":10,"type":"integer","minimum":1,"maximum":100},"search":{"default":"","type":"string"},"sortBy":{"default":"name","type":"string","enum":["name","email","createdAt","role"]},"sortOrder":{"default":"asc","type":"string","enum":["asc","desc"]},"role":{"type":"string","enum":["MANAGER","CONTRIBUTOR","VIEWER"]}},"required":["organizationId","page","limit","search","sortBy","sortOrder"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"orgRole":{"type":"string"},"organizations":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"required":["role","organization"],"additionalProperties":false}},"createdAt":{"type":"string"}},"required":["id","email","name","orgRole","organizations","createdAt"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","limit","total","totalPages"],"additionalProperties":false}},"required":["users","pagination"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"users_mark_all_read_create","description":"Performs the `mark-all-read` operation for the notifications feature.\n\n(Scope: users:write · endpoint: POST /api/notifications/mark-all-read)","http":{"method":"POST","path":"/api/notifications/mark-all-read"},"feature":"users","verb":"write","scope":"users:write","hasBody":true,"inputSchema":{"type":"object","properties":{},"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"users_members_create","description":"Creates a new `members` attached to the given organization.\n\n(Scope: users:write · endpoint: POST /api/organizations/{id}/members)","http":{"method":"POST","path":"/api/organizations/{id}/members"},"feature":"users","verb":"write","scope":"users:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","enum":["MANAGER","CONTRIBUTOR","VIEWER"]}},"required":["id","email","role"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"string","description":"MANAGER | CONTRIBUTOR | VIEWER"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","userId","organizationId","role","user","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"users_members_delete","description":"Removes the association without deleting the underlying record.\n\n(Scope: users:write · endpoint: DELETE /api/organizations/{id}/members)","http":{"method":"DELETE","path":"/api/organizations/{id}/members"},"feature":"users","verb":"write","scope":"users:write","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string","minLength":1}},"required":["id","userId"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":true}},{"name":"users_members_list","description":"Returns every `members` row associated with the given organization.\n\n(Scope: users:read · endpoint: GET /api/organizations/{id}/members)","http":{"method":"GET","path":"/api/organizations/{id}/members"},"feature":"users","verb":"read","scope":"users:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"string","description":"MANAGER | CONTRIBUTOR | VIEWER"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","userId","organizationId","role","user","createdAt","updatedAt"],"additionalProperties":false}}},"required":["members"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"users_members_update","description":"Mutates the `members` attached to the given organization.\n\n(Scope: users:write · endpoint: PATCH /api/organizations/{id}/members)","http":{"method":"PATCH","path":"/api/organizations/{id}/members"},"feature":"users","verb":"write","scope":"users:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string","minLength":1},"role":{"type":"string","enum":["MANAGER","CONTRIBUTOR","VIEWER"]}},"required":["id","userId","role"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"string","description":"MANAGER | CONTRIBUTOR | VIEWER"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","userId","organizationId","role","user","createdAt","updatedAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"users_replace","description":"Replaces an existing user. All required fields must be supplied — omitted fields revert to their schema defaults.\n\n(Scope: users:write · endpoint: PUT /api/users/{id})","http":{"method":"PUT","path":"/api/users/{id}"},"feature":"users","verb":"write","scope":"users:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"password":{"type":"string","minLength":6}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","email","name","createdAt"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"users_resend_create","description":"Creates a new `resend` attached to the given invitation.\n\n(Scope: users:write · endpoint: POST /api/invitations/{id}/resend)","http":{"method":"POST","path":"/api/invitations/{id}/resend"},"feature":"users","verb":"write","scope":"users:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"outputSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Updated invitation row — see /api/invitations GET for the canonical shape."},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"users_search_list","description":"Returns the `search` data for the users feature.\n\n(Scope: users:read · endpoint: GET /api/users/search)","http":{"method":"GET","path":"/api/users/search"},"feature":"users","verb":"read","scope":"users:read","hasBody":false,"inputSchema":{"type":"object","properties":{"q":{"default":"","type":"string"},"excludeOrgId":{"type":"string","minLength":1},"limit":{"default":10,"type":"integer","minimum":1,"maximum":20}},"required":["q","excludeOrgId","limit"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","email","name"],"additionalProperties":false}}},"required":["users"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}},{"name":"users_update","description":"Updates an existing user. Only the fields present in the request body are changed; omitted fields stay as-is.\n\n(Scope: users:write · endpoint: PATCH /api/users/{id})","http":{"method":"PATCH","path":"/api/users/{id}"},"feature":"users","verb":"write","scope":"users:write","hasBody":true,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"string","enum":["MANAGER","CONTRIBUTOR","VIEWER"]}},"required":["id","organizationId","role"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"],"additionalProperties":false},"annotations":{"readOnlyHint":false,"openWorldHint":false,"destructiveHint":false}},{"name":"users_usage_list","description":"Returns the caller's recent request log for the API key (last 7 days by default).\n\n(Scope: users:read · auth: SESSION only · endpoint: GET /api/api-keys/{id}/usage)","http":{"method":"GET","path":"/api/api-keys/{id}/usage"},"feature":"users","verb":"read","scope":"users:read","hasBody":false,"inputSchema":{"type":"object","properties":{"id":{"type":"string"},"limit":{"default":50,"type":"integer","minimum":1,"maximum":200},"sinceDays":{"default":7,"type":"integer","minimum":1,"maximum":365}},"required":["id","limit","sinceDays"],"additionalProperties":false},"outputSchema":{"type":"object","properties":{"totals":{"type":"object","properties":{"callCount":{"type":"number"},"errorCount":{"type":"number"},"avgDurationMs":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["callCount","errorCount","avgDurationMs"],"additionalProperties":false},"byFeature":{"type":"array","items":{"type":"object","properties":{"feature":{"anyOf":[{"type":"string"},{"type":"null"}]},"calls":{"type":"number"},"errors":{"type":"number"}},"required":["feature","calls","errors"],"additionalProperties":false}},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"feature":{"anyOf":[{"type":"string"},{"type":"null"}]},"verb":{"anyOf":[{"type":"string"},{"type":"null"}]},"statusCode":{"type":"number"},"errorCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"type":"number"},"organizationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","method","path","feature","verb","statusCode","errorCode","durationMs","organizationId","createdAt"],"additionalProperties":false}}},"required":["totals","byFeature","recent"],"additionalProperties":false},"annotations":{"readOnlyHint":true,"openWorldHint":false,"destructiveHint":false}}]}