openapi: 3.0.3 info: title: PVLedger API version: 0.1.2 servers: - url: /api/v1 security: - session: [] paths: /accounts/current: get: summary: List current accounts parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in current accounts parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /accounts/current/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from current accounts responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in current accounts description: A changed balance appends the resulting amount and the current UTC Unix second to the account history. parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from current accounts parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /accounts/savings: get: summary: List savings accounts parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in savings accounts parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /accounts/savings/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from savings accounts responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in savings accounts description: A changed balance appends the resulting amount and the current UTC Unix second to the account history. parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from savings accounts parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /accounts/credit: get: summary: List credit accounts parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in credit accounts parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /accounts/credit/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from credit accounts responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in credit accounts parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from credit accounts parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /banks: get: summary: List banks parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in banks parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /banks/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from banks responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in banks parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from banks parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /countries: get: summary: List countries parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in countries parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /countries/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from countries responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in countries parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from countries parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /currencies: get: summary: List currencies parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in currencies parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /currencies/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from currencies responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in currencies parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from currencies parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /expenses: get: summary: List expenses parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in expenses description: Subtract the signed amount from the linked current account in the same transaction. Require a numeric amount, the account currency, and a known account balance. parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: type: object required: [id_account, id_category, id_currency, name, amount] properties: amount: {type: number, description: Signed expense in the account currency} responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /expenses/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from expenses responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in expenses parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from expenses parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /expense-categories: get: summary: List expense categories parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in expense categories parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /expense-categories/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from expense categories responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in expense categories parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from expense categories parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /planned-expenses: get: summary: List planned expenses parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in planned expenses parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /planned-expenses/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from planned expenses responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in planned expenses parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from planned expenses parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /recurring-expenses: get: summary: List recurring expenses parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in recurring expenses parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /recurring-expenses/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from recurring expenses responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in recurring expenses parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from recurring expenses parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /income: get: summary: List actual income parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/account' - $ref: '#/components/parameters/from' - $ref: '#/components/parameters/to' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Add actual income description: Add the signed amount to the linked current account in the same transaction. Require a known balance. parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: allOf: - $ref: '#/components/schemas/IncomeFields' - required: [id_account, name, amount, date] responses: '201': {description: Created} '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /income/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from actual income responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update actual income parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/IncomeFields' } responses: '200': {description: Updated} '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete actual income parameters: - $ref: '#/components/parameters/csrf' responses: '204': {description: Deleted} '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } /planned-income: get: summary: List planned income parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/account' - $ref: '#/components/parameters/from' - $ref: '#/components/parameters/to' - $ref: '#/components/parameters/status' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Add planned income parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: allOf: - $ref: '#/components/schemas/PlannedIncomeFields' - required: [id_account, name, amount, date, status] responses: '201': {description: Created} '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /planned-income/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from planned income responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update planned income parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/PlannedIncomeFields' } responses: '200': {description: Updated} '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete planned income parameters: - $ref: '#/components/parameters/csrf' responses: '204': {description: Deleted} '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } /debts: get: summary: List debts parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in debts parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /debts/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from debts responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in debts parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from debts parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /taxes: get: summary: List taxes parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in taxes parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /taxes/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from taxes responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in taxes parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from taxes parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /users: get: summary: List users parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } post: summary: Create a record in users parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '201': description: Created content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /users/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from users responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update a record in users parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } delete: summary: Delete a record from users parameters: - $ref: '#/components/parameters/csrf' responses: '204': description: Deleted '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /roles: get: summary: List roles parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/sort' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Collection' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /roles/{id}: parameters: - $ref: '#/components/parameters/id' get: summary: Read a record from roles responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /accounts/current/{id}/history: parameters: - $ref: '#/components/parameters/id' get: summary: List current account balance snapshots parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/from' - $ref: '#/components/parameters/to' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/History' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /accounts/savings/{id}/history: parameters: - $ref: '#/components/parameters/id' get: summary: List savings account balance snapshots parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/from' - $ref: '#/components/parameters/to' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/History' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /auth/login: post: summary: Start session security: [] parameters: - $ref: '#/components/parameters/loginHeader' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Credentials' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Session' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } '429': { $ref: '#/components/responses/Error' } /auth/me: get: summary: Read signed-in user, CSRF token and instance default currency ID responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /auth/logout: post: summary: End session parameters: - $ref: '#/components/parameters/csrf' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /dashboard: get: summary: Read currency-grouped balances and latest expenses responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /settings: get: summary: Read instance preferences responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } patch: summary: Update instance preferences parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: { $ref: '#/components/schemas/Object' } responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /settings/backup: get: summary: Download a consistent SQLite snapshot of the entire instance (administrator) responses: '200': description: PVLedger SQLite database attachment content: application/vnd.sqlite3: {schema: {type: string, format: binary}} '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '413': {description: Snapshot exceeds 64 MiB} /settings/restore: post: summary: Replace the ledger with an uploaded backup (administrator) parameters: - $ref: '#/components/parameters/csrf' requestBody: &backupFile required: true description: Complete PVLedger SQLite database file up to 64 MiB, sent with a fixed Content-Length content: application/octet-stream: {schema: {type: string, format: binary}} application/vnd.sqlite3: {schema: {type: string, format: binary}} responses: '204': {description: Database restored and all sessions expired} '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '413': {description: File exceeds 64 MiB} '415': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /setup/restore: post: summary: Initialize an unclaimed instance using a backup security: [] parameters: - name: X-CSRF-Token in: header required: true description: The first-run token from the local setup form schema: {type: string} requestBody: *backupFile responses: '204': {description: Setup complete. Sign in with credentials from the backup.} '403': { $ref: '#/components/responses/Error' } '404': {description: Setup is closed} '413': {description: File exceeds 64 MiB} '415': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /plugins: get: summary: List registered plugins responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Array' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /plugins/{id}/enable: parameters: - $ref: '#/components/parameters/id' post: summary: Enable an available plugin parameters: - $ref: '#/components/parameters/csrf' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Array' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /plugins/{id}/disable: parameters: - $ref: '#/components/parameters/id' post: summary: Disable a plugin parameters: - $ref: '#/components/parameters/csrf' responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Array' } '400': { $ref: '#/components/responses/Error' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /lookups/{resource}: get: summary: Authorized labels and primary keys, up to 100 per page parameters: - {name: resource, in: path, required: true, schema: {type: string, enum: [banks, countries, currencies, expense-categories, users, roles]}} - $ref: '#/components/parameters/page' responses: '200': &lookupResponse description: Authorized lookup options in label and ID order content: application/json: schema: type: array items: type: object properties: id: {type: integer} label: {type: string} /lookups/accounts/{kind}: get: summary: Authorized account options parameters: - {name: kind, in: path, required: true, schema: {type: string, enum: [current, savings, credit]}} - $ref: '#/components/parameters/page' responses: '200': *lookupResponse /import/preview: post: summary: Review mapped expense rows from a local CSV, QIF, OFX or QFX file parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: type: object required: [dataset, id_account, id_category, id_currency, rows] properties: dataset: {type: string, enum: [expenses]} id_account: {type: integer} id_category: {type: integer} id_currency: {type: integer} rows: type: array minItems: 1 maxItems: 500 items: type: object properties: name: {type: string} date: {type: integer, format: int64} amount: {type: number} description: {type: string} currency: {type: string, description: Source ISO code when supplied} source_id: {type: string} error: {type: string, description: File parser error for an ineligible row} responses: '200': {description: Mapped rows with error and duplicate flags and a session-bound ten-minute review token} '403': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /import/commit: post: summary: Insert the explicitly selected rows of a reviewed import atomically description: Each selected expense debits its account. The batch, balance changes and resulting history entries commit together. parameters: - $ref: '#/components/parameters/csrf' requestBody: required: true content: application/json: schema: type: object required: [token, confirm, rows] properties: token: {type: string} confirm: {type: boolean, enum: [true]} rows: {type: array, minItems: 1, uniqueItems: true, items: {type: integer, minimum: 0}} responses: '200': {description: Imported, skipped and failed counts} '409': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /export/preview: post: summary: List available columns, authorized count and first ten matching rows parameters: - $ref: '#/components/parameters/csrf' requestBody: &exportRequest required: true content: application/json: schema: type: object required: [dataset] properties: dataset: {type: string, enum: [accounts/current, accounts/savings, accounts/credit, history/current, history/savings, expenses, planned-expenses, recurring-expenses, expense-categories, income, planned-income, debts, taxes, banks, countries, currencies]} format: {type: string, enum: [csv, ods, xlsx, qif, ofx, qfx], default: csv} columns: {type: array, items: {type: string}, uniqueItems: true, minItems: 1} filters: type: object properties: id_account: {type: integer} id_currency: {type: integer} status: {type: integer, description: Available for planned income and planned expenses} from: {type: integer, format: int64} to: {type: integer, format: int64} responses: '200': {description: Available columns, total, download row limit and sample items} '422': { $ref: '#/components/responses/Error' } /export/download: post: summary: Download the authorized selection description: CSV, ODS and XLSX support all listed datasets and column selection. QIF, OFX and QFX accept only actual expenses or income from one account and currency, with fixed columns. parameters: - $ref: '#/components/parameters/csrf' requestBody: *exportRequest responses: '200': description: A named attachment of the requested format content: text/csv: {schema: {type: string, format: binary}} application/vnd.oasis.opendocument.spreadsheet: {schema: {type: string, format: binary}} application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: {schema: {type: string, format: binary}} application/qif: {schema: {type: string, format: binary}} application/x-ofx: {schema: {type: string, format: binary}} application/vnd.intu.qfx: {schema: {type: string, format: binary}} '422': { $ref: '#/components/responses/Error' } /reports/expense-categories: get: summary: Actual expense totals by currency ID and category ID parameters: - $ref: '#/components/parameters/account' - ¤cyFilter {name: id_currency, in: query, schema: {type: integer, minimum: 1}} - $ref: '#/components/parameters/from' - $ref: '#/components/parameters/to' responses: '200': {description: Items with currency, category and amount} '422': { $ref: '#/components/responses/Error' } /reports/spending: get: summary: Daily actual spending by expense currency description: Filters apply to individual authorized expenses before aggregation. Each day is UTC midnight in Unix seconds. Days without a dated amount are omitted. parameters: - $ref: '#/components/parameters/account' - *currencyFilter - $ref: '#/components/parameters/from' - $ref: '#/components/parameters/to' responses: '200': description: Daily totals ordered by currency ID and day (up to 5,000 items) content: application/json: schema: type: object required: [items] properties: items: type: array items: type: object required: [id_currency, currency, day, amount] properties: id_currency: {type: integer} currency: {type: string} day: {type: integer, format: int64} amount: {type: number} '401': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /reports/estimates: get: summary: Daily income, expenses and net cash flow by currency description: Uses actual entries through today UTC and outstanding plans from tomorrow. Omit id_account for all authorized current accounts. parameters: - $ref: '#/components/parameters/account' - *currencyFilter - $ref: '#/components/parameters/from' - $ref: '#/components/parameters/to' responses: '200': description: Up to 5,000 daily totals ordered by currency ID and UTC day content: application/json: schema: type: object required: [items] properties: items: type: array items: type: object required: [day, id_currency, currency, basis, income, expenses, net] properties: day: {type: integer, format: int64} id_currency: {type: integer} currency: {type: string} basis: {type: string, enum: [actual, planned]} income: {type: number} expenses: {type: number} net: {type: number} '401': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /reports/balances: get: summary: Stored balance snapshots ordered by currency, account, timestamp and snapshot ID parameters: - {name: account_type, in: query, schema: {type: string, enum: [current, savings], default: current}} - $ref: '#/components/parameters/account' - *currencyFilter - $ref: '#/components/parameters/from' - $ref: '#/components/parameters/to' responses: '200': {description: Items with currency, account, snapshot ID, date and amount} '422': { $ref: '#/components/responses/Error' } /reports/balance-projection: get: summary: Projected balances per account and per currency total description: Starts at today's recorded balance. From tomorrow (UTC), applies outstanding planned income and same-currency planned expenses to each current account. Totals include savings balances. The account fields are null on total rows. parameters: - *currencyFilter - $ref: '#/components/parameters/to' responses: '200': description: Baseline and dated changes ordered by currency, series and UTC day (up to 5,000 items) content: application/json: schema: type: object required: [items] properties: items: type: array items: type: object required: [account_type, id_account, account, id_currency, currency, day, delta, amount] properties: account_type: {type: string, nullable: true, enum: [current, savings, null]} id_account: {type: integer, nullable: true} account: {type: string, nullable: true} id_currency: {type: integer} currency: {type: string} day: {type: integer, format: int64, description: UTC midnight in Unix seconds} delta: {type: number, description: Net planned change for the day} amount: {type: number, description: Cumulative projected balance} '401': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /reports/fund-distribution: get: summary: Recorded current and savings balances by currency parameters: - *currencyFilter responses: '200': description: Visible accounts with recorded balances, ordered by currency and descending balance (up to 5,000 items) content: application/json: schema: type: object required: [items] properties: items: type: array items: type: object required: [account_type, id_account, account, id_currency, currency, amount] properties: account_type: {type: string, enum: [current, savings]} id_account: {type: integer} account: {type: string} id_currency: {type: integer} currency: {type: string} amount: {type: number, description: Signed recorded balance} '401': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /ui/menu: get: summary: List menu entries available to the session responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Array' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /i18n/{locale}: parameters: - $ref: '#/components/parameters/locale' get: summary: Read translations including English fallback responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } '401': { $ref: '#/components/responses/Error' } '403': { $ref: '#/components/responses/Error' } '404': { $ref: '#/components/responses/Error' } '422': { $ref: '#/components/responses/Error' } /system/health: get: summary: Read startup state security: [] responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } /system/version: get: summary: Read PVLedger version security: [] responses: '200': description: Success content: application/json: schema: { $ref: '#/components/schemas/Object' } components: securitySchemes: session: type: apiKey in: cookie name: pvl_session parameters: id: name: id in: path required: true schema: { type: integer, format: int64, minimum: 1 } locale: name: locale in: path required: true schema: { type: string, example: en_US } csrf: name: X-CSRF-Token in: header required: true schema: { type: string } loginHeader: name: X-CSRF-Token in: header required: true schema: { type: string, enum: [login] } page: name: page in: query schema: { type: integer, minimum: 1, default: 1 } size: name: page_size in: query schema: { type: integer, minimum: 1, maximum: 100, default: 50 } sort: name: sort in: query schema: { type: string, example: "-date" } account: name: id_account in: query schema: { type: integer, format: int64, minimum: 1 } from: name: from in: query description: Inclusive lower bound in UTC epoch seconds. schema: { type: integer, format: int64 } to: name: to in: query description: Inclusive upper bound in UTC epoch seconds. schema: { type: integer, format: int64 } status: name: status in: query description: Stored status code. schema: { type: integer, format: int64 } responses: Error: description: Request failed. content: application/json: schema: { $ref: '#/components/schemas/Error' } schemas: Object: type: object additionalProperties: true Array: type: array items: { $ref: '#/components/schemas/Object' } IncomeFields: type: object additionalProperties: false properties: &incomeProperties id_account: {type: integer, minimum: 1} name: {type: string} amount: {type: number} date: {type: integer, format: int64, description: UTC epoch seconds} description: {type: string, nullable: true} PlannedIncomeFields: type: object additionalProperties: false properties: <<: *incomeProperties status: type: integer enum: [0, 1, 2, 3] description: 0 Planned, 1 Processed, 2 Processed with changes, 3 Declined Credentials: type: object required: [username, password] properties: username: { type: string } password: { type: string, format: password } Session: type: object required: [csrf] properties: csrf: { type: string } Page: type: object required: [items, page, page_size, total] properties: items: { $ref: '#/components/schemas/Array' } page: { type: integer } page_size: { type: integer } total: { type: integer } Collection: allOf: - $ref: '#/components/schemas/Page' - type: object required: [fields, writable] properties: fields: { $ref: '#/components/schemas/Array' } writable: { type: boolean } History: allOf: - $ref: '#/components/schemas/Page' - type: object required: [currency] properties: currency: { $ref: '#/components/schemas/Object' } Error: type: object required: [error] properties: error: type: object required: [code, message] properties: code: { type: string } message: { type: string }