Skip to content

API reference

Patrimeter's REST API: JSON, amounts in cents (integers), months in YYYY-MM format, dates in YYYY-MM-DD format. The data is that of the token's user, and theirs alone: another user's account answers 404, like an account that does not exist.

Authentication: bearer token (Authorization: Bearer patrimeter_…), personal token created on the "My account" page or OAuth 2.1 token (authorization code with PKCE). Scopes: patrimeter.read (reading) and patrimeter.write (writing, includes reading). Rate: 120 requests in a row per token, then one per second.

Request bodies are JSON (Content-Type: application/json, otherwise 415). A decimal number where an integer is expected is rejected, never truncated. Errors in application/problem+json format (RFC 9457). Error titles, account type labels and level names are in French.

Base address: https://patrimeter.example.org/api/v1 (replace the origin with that of your installation). User guide, OAuth and MCP service: REST API and MCP service.

Complete OpenAPI 3.1.0 description, to import into a client (Bruno, Insomnia, Postman…) or a code generator: openapi.yaml.

Authentication

  • personalToken: Personal token (patrimeter_…), created on the "My account" page, "API and applications" section, read only or read and write, for 30, 90 or 365 days.
  • oauth: OAuth 2.1: authorization code with PKCE (S256), public client, audience <DEFAULT_URI>/api (RFC 8707). Discovery: /.well-known/oauth-protected-resource/api, then /.well-known/oauth-authorization-server. Scopes: patrimeter.read (Read the net worth, accounts, statements and shares); patrimeter.write (Create, update and delete (includes reading)).

User

GET /me

User of the token

Scope: patrimeter.read.

Status Response
200 User and write permission of the token. Me
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
429 Rate exceeded; try again after Retry-After seconds. Problem

Net worth

Net worth, by level of the pyramid, and properties.

GET /net-worth

Net worth of a month

Net worth, assets and liabilities, in total and by level of the pyramid (property shares applied).

Scope: patrimeter.read.

Parameter In Type Description
month query Month Month wanted; the current month by default.
Status Response
200 Net worth of the month. NetWorth
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

GET /history

Net worth month by month

Scope: patrimeter.read.

Parameter In Type Description
from query Month First month; that of the first statement by default.
to query Month Last month; the current month by default.
Status Response
200 One net worth per month, from the oldest to the most recent (empty list without statements). Object: months (list of NetWorth)
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

GET /properties

Properties

Value of each property, share owned, linked loans and net value counted.

Scope: patrimeter.read.

Parameter In Type Description
month query Month Month wanted; the current month by default.
Status Response
200 Properties of the month. Object: properties (list of Property)
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

Goals

Savings goals and where each one stands for a month.

GET /goals

Savings goals

Each goal and where it stands for the month: value reached, effort still needed each month, pace of the last six months, status and projected month.

Scope: patrimeter.read.

Parameter In Type Description
month query Month Month wanted; the current month by default.
Status Response
200 Goals of the month. Object: goals (list of Goal)
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

Budget

Household budget in force for a month.

GET /budget

Household budget

Budget in force for the month (that of the month, otherwise the last one saved before): household, totals, categories and items with their amount. household is null if the budget is not created yet.

Scope: patrimeter.read.

Parameter In Type Description
month query Month Month wanted; the current month by default.
Status Response
200 Budget of the month. Budget
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

Challenges

Challenges and stars of the month. Indicative benchmarks, to adapt to your situation: this is not investment advice.

GET /challenges

Challenges and stars

Challenges and stars of the current month: total of the stars and level, stage of the saver profile, declared style, entry streak, and for each challenge its best stars (never lowered), the value measured and its thresholds. Habits and safety, never a return nor the share of a level. Challenges turned off (instance or user): enabled is false and nothing else is given.

Scope: patrimeter.read.

Status Response
200 Challenges of the month. Challenges
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
429 Rate exceeded; try again after Retry-After seconds. Problem

Accounts

Accounts (assets and loans), closing, linking a loan to a property.

GET /account-types

Account types

Account types, with their default level and nature (to use for type_id).

Scope: patrimeter.read.

Status Response
200 Account types. Object: account_types (list of AccountType)
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
429 Rate exceeded; try again after Retry-After seconds. Problem

GET /accounts

Accounts

All accounts, closed ones included, with their value for the current month.

Scope: patrimeter.read.

Status Response
200 Accounts. Object: accounts (list of AccountListItem)
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
429 Rate exceeded; try again after Retry-After seconds. Problem

POST /accounts

Create an account

Without a level or a nature: those of the type. initial_amount_cents records a first statement, for the current month (or for the opening month if it is later).

Scope: patrimeter.write.

Body (JSON): AccountInput.

{"name": "Livret A", "type_id": 4, "opened_on": "2020-01-01", "initial_amount_cents": 2295000}
Status Response
201 Account created. AccountDetail
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
403 Read-only token for a write operation (insufficient_scope). OAuthError
415 Request body that is not JSON. Problem
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

GET /accounts/{id}

Account details

Scope: patrimeter.read.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.
Status Response
200 Account, with its statements and shares. AccountDetail
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
404 Account that does not exist, or that belongs to another user. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

PUT /accounts/{id}

Update an account

Same fields as at creation (initial_amount_cents ignored).

Scope: patrimeter.write.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.

Body (JSON): AccountInput.

Status Response
200 Account updated. AccountDetail
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
403 Read-only token for a write operation (insufficient_scope). OAuthError
404 Account that does not exist, or that belongs to another user. Problem
415 Request body that is not JSON. Problem
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

DELETE /accounts/{id}

Delete an account

Deletes the account and its statements. To keep the history, close it instead (archive).

Scope: patrimeter.write.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.
Status Response
204 Account deleted.
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
403 Read-only token for a write operation (insufficient_scope). OAuthError
404 Account that does not exist, or that belongs to another user. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

POST /accounts/{id}/archive

Close an account

The account no longer counts from the closing month on; its history is kept.

Scope: patrimeter.write.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.

Body (JSON): CloseInput.

Status Response
200 Account closed. AccountDetail
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
403 Read-only token for a write operation (insufficient_scope). OAuthError
404 Account that does not exist, or that belongs to another user. Problem
415 Request body that is not JSON. Problem
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

POST /accounts/{id}/unarchive

Reactivate a closed account

Scope: patrimeter.write.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.
Status Response
200 Account reactivated. AccountDetail
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
403 Read-only token for a write operation (insufficient_scope). OAuthError
404 Account that does not exist, or that belongs to another user. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

Link a loan to a property

Links the loan id to the property asset_id, or unlinks it with a null asset_id.

Scope: patrimeter.write.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.

Body (JSON): LoanLinkInput.

{"asset_id": 7, "loan_mode": "prorata"}
Status Response
204 Link saved.
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
403 Read-only token for a write operation (insufficient_scope). OAuthError
404 Account that does not exist, or that belongs to another user. Problem
415 Request body that is not JSON. Problem
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

Statements

Balance of an account for a month. A loan has a positive amount, the outstanding principal.

GET /accounts/{id}/statements

Statements of an account

Scope: patrimeter.read.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.
Status Response
200 Statements, from the oldest to the most recent. Object: statements (list of Statement)
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
404 Account that does not exist, or that belongs to another user. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

PUT /accounts/{id}/statements/{month}

Save the statement of a month

Creates or replaces the statement. The account must be open that month.

Scope: patrimeter.write.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.
month path Month Month, in YYYY-MM format.

Body (JSON): StatementInput.

{"amount_cents": 1234567}
Status Response
204 Statement saved.
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
403 Read-only token for a write operation (insufficient_scope). OAuthError
404 Account that does not exist, or that belongs to another user. Problem
415 Request body that is not JSON. Problem
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

DELETE /accounts/{id}/statements/{month}

Delete the statement of a month

The last earlier statement is then carried over to this month.

Scope: patrimeter.write.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.
month path Month Month, in YYYY-MM format.
Status Response
204 Statement deleted.
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
403 Read-only token for a write operation (insufficient_scope). OAuthError
404 Account that does not exist, or that belongs to another user. Problem
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

Shares

Share owned of a property from a given month, in millionths (333,333 = 33.3333%).

GET /accounts/{id}/shares

Shares of a property

History of the shares; without a recorded share, the property is owned at 100%.

Scope: patrimeter.read.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.
Status Response
200 Shares, by effective month. Object: shares (list of Share)
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
404 Account that does not exist, or that belongs to another user. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

PUT /accounts/{id}/shares/{month}

Save a share from a given month

Properties only.

Scope: patrimeter.write.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.
month path Month Month, in YYYY-MM format.

Body (JSON): ShareInput.

{"share_millionths": 500000}
Status Response
204 Share saved.
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
403 Read-only token for a write operation (insufficient_scope). OAuthError
404 Account that does not exist, or that belongs to another user. Problem
415 Request body that is not JSON. Problem
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

DELETE /accounts/{id}/shares/{month}

Delete the share of a month

Scope: patrimeter.write.

Parameter In Type Description
id path integer (1 to 999999999) Account identifier.
month path Month Month, in YYYY-MM format.
Status Response
204 Share deleted.
401 Missing, invalid or expired token. WWW-Authenticate says where to find the authorization server. OAuthError
403 Read-only token for a write operation (insufficient_scope). OAuthError
404 Account that does not exist, or that belongs to another user. Problem
422 Data rejected; errors gives one message per field. Problem
429 Rate exceeded; try again after Retry-After seconds. Problem

Schemas

Month

Month, in YYYY-MM format.

Type: string.

Pattern: ^\d{4}-(0[1-9]|1[0-2])$.

Date

Date, in YYYY-MM-DD format.

Type: string (date).

Cents

Amount in euro cents.

Type: integer (-999999999999999 to 999999999999999).

Level

Level of the pyramid, from the base to the top.

Type: string (residence, precaution, fonds_euros, actions, immobilier, exotique).

Nature

asset: asset; liability: liability (loan), subtracted from its level.

Type: string (asset, liability).

LoanMode

prorata: the total loan, counted according to the share of the property; own: your share, counted as is.

Type: string (prorata, own).

Me

Field Type Required Description
id string (uuid) yes
email string (email) yes
can_write boolean yes The token allows writing.

AccountType

Field Type Required Description
id integer yes
code string yes
label string yes
default_level Level yes
nature Nature yes

LevelTotal

Field Type Required Description
code Level yes
label string yes Name of the level, in French.
net_cents Cents yes
assets_cents Cents yes
liabilities_cents Cents yes

NetWorth

Field Type Required Description
month Month yes
has_data boolean yes At least one account has a value that month (entered or carried over).
net_cents Cents yes
assets_cents Cents yes
liabilities_cents Cents yes
levels list of LevelTotal yes The six levels, from the base to the top of the pyramid.

Property

Field Type Required Description
account_id integer yes
name string yes
total_cents Cents yes
share_millionths integer (1 to 1000000) yes
retained_cents Cents yes
owed_cents Cents yes
net_cents Cents yes
loans list of object yes

Challenges

Field Type Required Description
enabled boolean yes Challenges and stars offered to the user (instance and the user's setting).
notice string yes Reminder: indicative benchmarks, not investment advice.
month Month no Month measured (the current month).
stars integer (0 to …) no Total of the best stars of each challenge.
max_stars integer (1 to …) no Stars possible in all.
level object no Level reached (number out of levels) and stars of the next level (next_at, null at the last one).
stage string or null no Stage of the saver profile, null before the first month entered.
style string or null no Declared style, null without a style.
streak object no Months of entries in a row (one forgotten month a year forgiven) and whether the year's joker is still available.
challenges list of object no Challenges, in the order of the style.

Goal

Field Type Required Description
id integer yes
name string yes
target_cents Cents yes Amount to reach; for a goal in months of spending, that of the month.
target_month Month yes
spending_months integer or null yes Target in months of budget spending, or null for an amount.
scope string (net, level, accounts) yes net: net worth; level: one level (level); accounts: accounts (account_ids).
level Level or null yes
account_ids list of integer yes
start_month Month yes
start_cents Cents yes
month Month yes
value_cents Cents yes
status string (reached, ahead, on_track, watch, late, too_early) yes reached, ahead, on_track, watch (to watch), late (behind), too_early (too early to tell).
required_cents integer or null yes Effort still needed each month, or what is missing if the deadline has passed; null once reached.
pace_cents integer or null yes Average progress per month over pace_months months; null without history.
pace_months integer (0 to 6) yes
projected_month Month or null yes Month the goal would be reached at the current pace; null if reached or never at this pace.
planned_cents integer or null yes Savings planned each month by the budget items tied to the goal's accounts; null without such an item.
overdue boolean yes

Budget

Field Type Required Description
month Month yes
household object or null yes
entered_month Month or null yes Month whose amounts apply (the month asked, or the last one saved before).
totals object or null yes
categories list of object yes

Account

Field Type Required Description
id integer yes
name string yes
type_id integer yes
type string yes Label of the type, in French.
level Level yes
nature Nature yes
opened_on Date yes
closed_on Date or null yes
linked_asset_id integer or null yes Property this loan is linked to.
loan_mode LoanMode or null yes

AccountValue

Field Type Required Description
amount_cents Cents yes
month Month yes
carried boolean yes Last known statement, carried over from an earlier month.

AccountListItem

Field Type Required Description
all the fields of Account
value AccountValue or null yes

AccountDetail

Field Type Required Description
all the fields of Account
statements list of Statement yes
shares list of Share yes

Statement

Field Type Required Description
month Month yes
amount_cents Cents yes

Share

Field Type Required Description
month Month yes
share_millionths integer (1 to 1000000) yes

AccountInput

Field Type Required Description
name string yes
type_id integer (1 to …) yes See GET /account-types.
level Level no
nature Nature no
opened_on Date yes
initial_amount_cents Cents no

CloseInput

Field Type Required Description
closed_on Date yes

LoanLinkInput

Field Type Required Description
asset_id integer or null no Property; null to unlink the loan.
loan_mode LoanMode no

StatementInput

Field Type Required Description
amount_cents Cents yes

ShareInput

Field Type Required Description
share_millionths integer (1 to 1000000) yes

Problem

Error (RFC 9457).

Field Type Required Description
title string yes
status integer yes
errors object no Message per rejected field.
retry_after integer no Seconds to wait (429).

OAuthError

Field Type Required Description
error string (invalid_token, insufficient_scope) yes
error_description string yes