# CarnetCopro — MCP server and REST API > CarnetCopro manages reserve fund studies (études du fonds de prévoyance) for Quebec divided co-ownerships under Bill 16 (Loi 16). Its MCP server and REST API let an AI assistant or a script read and update a firm's études, components, constats, works, financing scenarios and reports, on behalf of one signed-in member. - MCP server URL: https://carnetcopro.ca/mcp - Transport: Streamable HTTP (JSON responses, no session) - REST API: https://carnetcopro.ca/api/v1 — OpenAPI: https://carnetcopro.ca/api/v1/openapi.json - Authentication: OAuth 2.1 (authorization code + PKCE S256; client ID metadata documents or dynamic registration); the access token is sent as `Authorization: Bearer`. What a connection may do is also capped by the access an administrator gives each member (Settings > Intégrations > Accès des membres). - Every call acts as one member, inside their firm's account only, with that member's role. - Protocol versions: 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26 - Rate limit: 120 tool calls per minute per token - Tools: 67 ## Scopes - `etudes:read`: Read études, buildings, components, constats, works, groups and scenarios. - `etudes:write`: Create and change them, and generate documents. Implies etudes:read. - `etudes:delete`: Delete constats, measurements, photos, works, groups, scenarios, units and documents. Implies etudes:write. ## Install ### Claude (claude.ai, Claude Desktop) 1. Open Customize > Connectors, then + Add > Add custom connector. On Team and Enterprise plans, an owner adds it under Organization settings > Connectors (Add > Custom > Web) and each member clicks Connect. 2. Name it CarnetCopro and paste the server URL below. 3. Keep the detected OAuth authentication and click Add: Claude opens the CarnetCopro consent page, you sign in and approve the scopes. 4. In a conversation, enable the connector from the + > Connectors menu. Server URL: ```text https://carnetcopro.ca/mcp ``` ### Claude Code 1. Add the server, then run /mcp in Claude Code, choose carnetcopro and Authenticate. 2. Sign in to CarnetCopro in the browser window that opens and approve the scopes. Add the server: ```sh claude mcp add --transport http carnetcopro https://carnetcopro.ca/mcp ``` ### ChatGPT 1. Open Settings > Apps > Advanced settings and turn on Developer mode. 2. Back in Apps, choose Create, name it CarnetCopro and paste the server URL. 3. Pick OAuth as the authentication, then connect and approve the scopes on the CarnetCopro consent page. 4. In a conversation, mention @CarnetCopro to use its tools. Server URL: ```text https://carnetcopro.ca/mcp ``` ### Cursor, VS Code and other mcp.json clients 1. Add the server to .cursor/mcp.json (Cursor) or .vscode/mcp.json (VS Code; the top-level key is "servers" there). 2. The client opens the CarnetCopro consent page on first use (OAuth); a client without OAuth support cannot connect. mcp.json: ```json { "mcpServers": { "carnetcopro": { "type": "http", "url": "https://carnetcopro.ca/mcp" } } } ``` ### Any MCP client 1. Transport: Streamable HTTP, one JSON-RPC message per POST, plain JSON responses, no session id. 2. Discovery: an unauthenticated call answers 401 with a WWW-Authenticate header pointing to https://carnetcopro.ca/.well-known/oauth-protected-resource/mcp. 3. OAuth 2.1 authorization code with PKCE (S256); clients register with a client ID metadata document or dynamic registration (https://carnetcopro.ca/oauth/register). $ACCESS_TOKEN below is the access token it returns. 4. Server card for directories: https://carnetcopro.ca/.well-known/mcp/server-card.json. Initialize (2025-11-25): ```sh curl -s https://carnetcopro.ca/mcp \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"my-client","version":"1.0"}}}' ``` List tools: ```sh curl -s https://carnetcopro.ca/mcp \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -H "MCP-Protocol-Version: 2025-11-25" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' ``` ### REST API (curl) 1. Every tool is also a REST endpoint under https://carnetcopro.ca/api/v1, with the same arguments and the same JSON result. 2. Authenticate with an OAuth access token issued for https://carnetcopro.ca/api/v1 (the same flow as MCP, resource=https://carnetcopro.ca/api/v1); $ACCESS_TOKEN below stands for it. 3. Path parameters, the query string (GET, DELETE) and the JSON body (POST, PATCH, PUT) are merged into the tool's arguments. 4. The OpenAPI 3.1 document is public. OpenAPI document: ```sh curl -s https://carnetcopro.ca/api/v1/openapi.json ``` Account context: ```sh curl -s https://carnetcopro.ca/api/v1/context \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` ## A typical session in five calls 1. `get_account_context` — Learn who you act for: the member, the firm's account, the role and the granted scopes. ```json { "id": 1, "jsonrpc": "2.0", "method": "tools/call", "params": { "arguments": {}, "name": "get_account_context" } } ``` 2. `list_etudes` — Find the étude to work on (filter by text, building or dates). ```json { "id": 2, "jsonrpc": "2.0", "method": "tools/call", "params": { "arguments": { "limit": 10, "query": "Sherbrooke" }, "name": "list_etudes" } } ``` 3. `get_etude` — Read its header, parameters and building. ```json { "id": 3, "jsonrpc": "2.0", "method": "tools/call", "params": { "arguments": { "etude_id": 41 }, "name": "get_etude" } } ``` 4. `update_component` — Record what was seen on site on one component. ```json { "id": 4, "jsonrpc": "2.0", "method": "tools/call", "params": { "arguments": { "component_id": 812, "condition": "passable", "etude_id": 41, "lifespan_years": 30, "notes": "

Fenêtres à battant en PVC, double vitrage. Coupe-froid usés.

", "year_of_installation": 2004 }, "name": "update_component" } } ``` 5. `generate_document` — Produce the report PDF; it runs in the background, so poll get_generated_document until it is ready. ```json { "id": 5, "jsonrpc": "2.0", "method": "tools/call", "params": { "arguments": { "etude_id": 41, "free_inputs": { "mot_du_president": "

Merci au conseil.

" }, "report_date": "2026-10-30", "template_id": 3 }, "name": "generate_document" } } ``` ## Conventions - Ids are integers; amounts are CAD; dates are `YYYY-MM-DD`; date-times are ISO 8601 UTC. - Most text a firm writes is French: keep the user's language. - Pagination: list tools take `limit` (default 50, at most 200) and `cursor`; pass the result's `next_cursor` back as `cursor` until it is null. - Unknown argument fields are refused, not ignored. - Technicians work in every part of the études assigned to them; inspectors reach only their general information and components, and the group, scenario, report and document tools refuse them with `forbidden`. Setting an étude's access (`set_etude_access`) is for owners and administrators. - Document generation is asynchronous: `generate_document` answers 202 over REST; poll `get_generated_document`. - Over MCP a tool failure is a result with `isError: true`, the message in `content` and `{code, message, details}` in `_meta["carnetcopro/error"]`. Over REST it is `{"error": {"code", "message", "details"}}` with the HTTP status below. - Every call is logged (tool, member, client, outcome, redacted arguments) and the log is kept 90 days. ## Errors | Code | HTTP | Meaning | |---|---|---| | `forbidden` | 403 | The member's role does not allow it: inspectors reach only the general information and components; setting an étude's access is for owners and administrators. | | `insufficient_scope` | 403 | The connection lacks the scope the tool needs (etudes:write to create or change, etudes:delete to delete): it was not granted at sign-in, or an administrator limited the member's access. Over MCP: JSON-RPC error -32001, HTTP 403 and a WWW-Authenticate challenge. | | `not_found` | 404 | The id does not exist in this account, or the member may not open it. | | `conflict` | 409 | The change conflicts with the current state of the data. | | `scenario_locked` | 409 | The financing scenario cannot be changed in its current state. | | `invalid_arguments` | 422 | The arguments do not match the input schema (unknown field, wrong type, missing required field). | | `validation_failed` | 422 | The change was refused by the app's own validation; details.fields lists each field and why. | | `rate_limited` | 429 | Over the per-token budget; details.retry_after (and the Retry-After header over REST) gives the seconds to wait. | | `internal_error` | 500 | An unexpected failure on our side; retry later. | | (missing or revoked token) | 401 | `WWW-Authenticate` points to the protected resource metadata. | ## Tool reference ### Account and reference #### Get account context (`get_account_context`) Returns who you are acting for in CarnetCopro: the signed-in member, their firm's account, their role, the scopes this connection may use (granted at sign-in, capped by the access an administrator gave the member), the firm's sales tax rates and the condition states (états) a constat can take. Call it first in a session: the role says which other tools are available (inspectors cannot use group, scenario, report or document tools; only owners and administrators set an étude's access). Read-only; takes no arguments. - Group: Account and reference - REST: `GET /api/v1/context` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: (none) Output: | Field | Type | Description | |---|---|---| | `account` | object | The firm's account every call works in. | | `account.id` | integer | The account's id. (min 1) | | `account.name` | string | The firm's name. | | `condition_states` | array of object | The general condition states a component can take, in order. | | `condition_states[].label` | string | Label shown in the report. | | `condition_states[].value` | string | Value to send as a component's condition. | | `constat_states` | array of object | The condition states a constat can take, in order. | | `constat_states[].label` | string | Label shown in the report. | | `constat_states[].value` | string | Value to send as a constat's state. | | `full_access` | boolean | True for owners and administrators: every tool is available, set_etude_access included. | | `role` | string | The member's role in the account. One of: owner, admin, technician, inspector. | | `scopes` | array of string | What this connection may do. | | `tax_rates` | object | Sales taxes applied to costs. | | `tax_rates.gst` | number | GST (TPS) in percent. | | `tax_rates.qst` | number | QST (TVQ) in percent. | | `user` | object \| null | The signed-in member. | | `user.email` | string | Email address. | | `user.id` | integer | The member's id. (min 1) | | `user.name` | string | Full name. | Example arguments: ```json {} ``` Example result: ```json { "account": { "id": 3, "name": "Inspections Tremblay inc." }, "condition_states": [ { "label": "Bon", "value": "bon" }, { "label": "Passable", "value": "passable" } ], "constat_states": [ { "label": "Recommandations", "value": "recommandations" }, { "label": "À surveiller", "value": "a_surveiller" } ], "full_access": true, "role": "admin", "scopes": [ "etudes:read", "etudes:write" ], "tax_rates": { "gst": 5.0, "qst": 9.975 }, "user": { "email": "marie@exemple.ca", "id": 12, "name": "Marie Tremblay" } } ``` Over REST: ```sh curl -s https://carnetcopro.ca/api/v1/context \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### List account members (`list_account_users`) Lists the members of the firm's account with their id, name, email and role (owner, admin, technician or inspector), sorted by name. Use it to find the id to pass as an étude's inspector_id (create_etude, update_etude) or in set_etude_access. Does not list signatories, who need not be members (list_signatories), nor invite or remove anyone. Read-only; takes no arguments. - Group: Account and reference - REST: `GET /api/v1/users` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: (none) Output: | Field | Type | Description | |---|---|---| | `users` | array of object | The members, by name. | | `users[].email` | string | Email address. | | `users[].id` | integer | The member's id. (min 1) | | `users[].name` | string | Full name, or the email when no name is set. | | `users[].role` | string | Role in the account: owner, admin, technician or inspector. | Example arguments: ```json {} ``` Example result: ```json { "users": [ { "email": "marie@exemple.ca", "id": 12, "name": "Marie Tremblay", "role": "admin" }, { "email": "luc@exemple.ca", "id": 15, "name": "Luc Gagnon", "role": "technician" } ] } ``` Over REST: ```sh curl -s https://carnetcopro.ca/api/v1/users \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Search Uniformat II elements (`search_uniformat_elements`) Searches the UNIFORMAT II classification (ASTM E1557, names in French) the études are organised by: categories (level 1, e.g. B), group elements (level 2, e.g. B20) and individual elements (level 3, e.g. B2020, the components inspected). Filter by text in the name or code, and/or by code prefix; with neither, returns the whole tree in order. Use the codes to filter list_prices or list_text_templates. Does not list an étude's own components or sub-components (list_components). Read-only. - Group: Account and reference - REST: `GET /api/v1/uniformat` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `code` | string | no | Only elements whose code starts with this, e.g. B or B20. (max length 10) | | `query` | string | no | Text to look for in the element's name or code, accents and case ignored. (max length 100) | Output: | Field | Type | Description | |---|---|---| | `elements` | array of object | The matching elements, in tree order. | | `elements[].code` | string | The UNIFORMAT II code. | | `elements[].level` | integer | 1 for a category, 2 for a group element, 3 for an individual element. (min 1, max 3) | | `elements[].name` | string | The element's name, in French. | | `elements[].parent_code` | string \| null | Code of the element one level up; null for a category. | | `elements[].parent_name` | string \| null | Name of the element one level up. | Example arguments: ```json { "query": "fenêtre" } ``` Example result: ```json { "elements": [ { "code": "B2020", "level": 3, "name": "Fenêtres et vitrages extérieurs", "parent_code": "B20", "parent_name": "Façades extérieures" } ] } ``` Over REST: ```sh curl -s "https://carnetcopro.ca/api/v1/uniformat?query=fen%C3%AAtre" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### List catalogue prices (`list_prices`) Lists the active unit prices of the firm's catalogue, by description, with their unit and the UNIFORMAT codes they apply to. Filter by uniformat_code (prices attributed to that component, its group or its category) and/or by text in the description. Paginated: pass next_cursor back as cursor. Use the prices to cost works (travaux) and maintenance. Does not create, change or archive prices (done in the app's Prix page). Read-only. - Group: Account and reference - REST: `GET /api/v1/prices` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `cursor` | string | no | The next_cursor of a previous call, to get the next page. | | `limit` | integer | no | How many results to return (default 50). (min 1, max 200) | | `query` | string | no | Text to look for in the description, accents and case ignored. (max length 200) | | `subcomponent_label` | string | no | With uniformat_code: also include prices attributed to this sub-component of it. (max length 200) | | `uniformat_code` | string | no | Only prices that apply to this individual element, e.g. B2020 (see search_uniformat_elements). (max length 10) | Output: | Field | Type | Description | |---|---|---| | `next_cursor` | string \| null | Pass it as cursor to get the next page; null on the last page. | | `prices` | array of object | The prices, by description. | | `prices[].description` | string | What the price is for. | | `prices[].id` | integer | The price's id. (min 1) | | `prices[].uniformat_codes` | array of string | Where the price applies. | | `prices[].unit` | string \| null | Unit of measure (m², unité, pi lin., …). | | `prices[].unit_price` | number \| null | Price per unit, before taxes. In CAD. (min 0) | Example arguments: ```json { "limit": 20, "uniformat_code": "B3010" } ``` Example result: ```json { "next_cursor": null, "prices": [ { "description": "Membrane élastomère deux plis", "id": 87, "uniformat_codes": [ "B30" ], "unit": "m²", "unit_price": 145.0 } ] } ``` Over REST: ```sh curl -s "https://carnetcopro.ca/api/v1/prices?limit=20&uniformat_code=B3010" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### List text templates (`list_text_templates`) Lists the firm's text templates (modèles): reusable descriptions, constats (category specific), works (travaux), maintenance (entretien), methodology and responsibility texts, with their suggested costs, lifespans and priorities. Give a uniformat_code (and optionally a subcomponent_label) for the templates of one element, a category, or both; at least one is required. Paginated. Use them as a starting point when writing a component's texts, constats or tasks. Does not create or edit templates (done in the app's Modèles page). Read-only. - Group: Account and reference - REST: `GET /api/v1/text-templates` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `category` | string | no | Only templates of this category. One of: general, methodology, specific, travaux, entretien, responsibility. | | `cursor` | string | no | The next_cursor of a previous call, to get the next page. | | `limit` | integer | no | How many results to return (default 50). (min 1, max 200) | | `subcomponent_label` | string | no | With uniformat_code: the templates of this sub-component instead of the element's own. (max length 200) | | `uniformat_code` | string | no | The individual element, e.g. B3010 (see search_uniformat_elements). (max length 10) | Output: | Field | Type | Description | |---|---|---| | `next_cursor` | string \| null | Pass it as cursor to get the next page; null on the last page. | | `templates` | array of object | The templates, by title. | | `templates[].category` | string | Kind of text. One of: general, methodology, specific, travaux, entretien, responsibility. | | `templates[].description` | string \| null | The text itself (may contain HTML). | | `templates[].estimated_cost` | number \| null | Suggested cost. In CAD. (min 0) | | `templates[].frequency` | string \| null | Frequency, for maintenance. | | `templates[].goal` | string \| null | Goal, for works. | | `templates[].id` | integer | The template's id. (min 1) | | `templates[].intervention_type` | string \| null | Kind of intervention, for works. | | `templates[].is_one_time` | boolean | True for a one-time intervention. | | `templates[].lifespan_years` | integer \| null | Suggested lifespan in years. | | `templates[].line_items` | array of object | Cost lines. | | `templates[].line_items[].description` | string \| null | What the line costs. | | `templates[].line_items[].price_id` | integer \| null | The catalogue price it comes from (list_prices). | | `templates[].line_items[].quantity` | number \| null | Quantity. | | `templates[].line_items[].subtotal` | number \| null | Line total. In CAD. (min 0) | | `templates[].line_items[].unit_price` | number \| null | Price per unit. In CAD. (min 0) | | `templates[].method` | string \| null | Method, for works. | | `templates[].priority` | string \| null | Suggested priority. | | `templates[].recommended_months` | array of integer | Months the maintenance is recommended in. | | `templates[].recurrence_years` | integer \| null | Years between occurrences, for works. | | `templates[].state` | string \| null | Suggested condition state, for constats. | | `templates[].subcomponent_label` | string \| null | The sub-component it belongs to; null for the element itself. | | `templates[].title` | string | Short title. | | `templates[].uniformat_code` | string | The element it belongs to. | Example arguments: ```json { "category": "travaux", "uniformat_code": "B3010" } ``` Example result: ```json { "next_cursor": null, "templates": [ { "category": "travaux", "description": "Remplacement complet de la membrane de toiture.", "estimated_cost": 8.5e4, "frequency": null, "goal": null, "id": 230, "intervention_type": "remplacement", "is_one_time": false, "lifespan_years": 25, "line_items": [], "method": null, "priority": "moyenne", "recommended_months": [], "recurrence_years": 25, "state": null, "subcomponent_label": null, "title": "Remplacement de la membrane", "uniformat_code": "B3010" } ] } ``` Over REST: ```sh curl -s "https://carnetcopro.ca/api/v1/text-templates?category=travaux&uniformat_code=B3010" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### List signatories (`list_signatories`) Lists the people the firm can name on a report (signataires), by name: their professional title, order and member number, whether a signature image is on file, and the roles they are the default for on new études (established_by, site_visit, writing). Use the ids for an étude's established_by_signatory_id, site_visit_signatory_id and writing_signatory_id (update_etude). Signatories need not be app members (see list_account_users). Does not return the signature images, nor edit the roster. Read-only; takes no arguments. - Group: Account and reference - REST: `GET /api/v1/signatories` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: (none) Output: | Field | Type | Description | |---|---|---| | `signatories` | array of object | The roster, by name. | | `signatories[].default_for` | array of string | The roles new études name them for by default. | | `signatories[].has_signature` | boolean | True when a signature image is on file. | | `signatories[].id` | integer | The signatory's id. (min 1) | | `signatories[].member_number` | string \| null | Member number in that order. | | `signatories[].name` | string | Full name. | | `signatories[].professional_order` | string \| null | Professional order they belong to. | | `signatories[].professional_title` | string \| null | Professional title, e.g. Technologue professionnel. | Example arguments: ```json {} ``` Example result: ```json { "signatories": [ { "default_for": [ "established_by", "writing" ], "has_signature": true, "id": 3, "member_number": "12345", "name": "Julie Bouchard", "professional_order": "OTPQ", "professional_title": "Technologue professionnelle" } ] } ``` Over REST: ```sh curl -s https://carnetcopro.ca/api/v1/signatories \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` ### Buildings #### List buildings (`list_buildings`) Lists the buildings (immeubles) of the account you can reach, newest first: address, city, postal code, syndicate name and NEQ. Filter by text (address, city, postal code, syndicate name or NEQ). Paginated: pass next_cursor back as cursor. Technicians and inspectors see the buildings of the études they may open. Use get_building for a building's details, units and études, and list_etudes for the études themselves. Read-only. - Group: Buildings - REST: `GET /api/v1/buildings` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `cursor` | string | no | The next_cursor of a previous call, to get the next page. | | `limit` | integer | no | How many results to return (default 50). (min 1, max 200) | | `query` | string | no | Text to look for in the address, city, postal code, syndicate name or NEQ. (max length 200) | Output: | Field | Type | Description | |---|---|---| | `buildings` | array of object | The buildings, newest first. | | `buildings[].address` | string \| null | Street address. | | `buildings[].city` | string \| null | City. | | `buildings[].id` | integer | The building's id. (min 1) | | `buildings[].neq` | string \| null | Quebec enterprise number (NEQ) of the syndicate. | | `buildings[].postal_code` | string \| null | Postal code. | | `buildings[].syndicat_name` | string \| null | Name of the syndicate of co-owners. | | `next_cursor` | string \| null | Pass it as cursor to get the next page; null on the last page. | Example arguments: ```json { "limit": 10, "query": "King" } ``` Example result: ```json { "buildings": [ { "address": "1200, rue King Ouest", "city": "Sherbrooke", "id": 17, "neq": "1170000017", "postal_code": "J1H 1S1", "syndicat_name": "Syndicat du 1200 King" } ], "next_cursor": null } ``` Over REST: ```sh curl -s "https://carnetcopro.ca/api/v1/buildings?limit=10&query=King" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Get a building (`get_building`) Returns one building: its identity and description (address, syndicate, NEQ, year built, unit counts, floors, type of co-ownership, contact, revision period), its units with their relative values (fractions), and the études of it you may open. units_source tells where the units come from: "pro" (entered here, editable with add_building_unit and delete_building_unit) or "web" (read from the MaCopro owners' portal, read-only). Use update_building to change it. Read-only. - Group: Buildings - REST: `GET /api/v1/buildings/{building_id}` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `building_id` | integer | yes | The building (see list_buildings). (min 1) | Output: | Field | Type | Description | |---|---|---| | `building` | object | A building and its identity. | | `building.address` | string \| null | Street address. | | `building.building_type` | string \| null | Use of the building. One of: residential, commercial, mixed. | | `building.city` | string \| null | City. | | `building.client_email` | string \| null | Email of the syndicate's contact. (max length 255) | | `building.commercial_unit_count` | integer \| null | Number of commercial units. (min 0, max 10000) | | `building.copropriete_type` | string \| null | Horizontal (row houses, detached units) or vertical (apartment building) co-ownership. One of: horizontal, vertical. | | `building.floors_above_ground` | integer \| null | Number of floors above ground. (min 0, max 200) | | `building.has_photo` | boolean | True when a cover photo of the building is on file. | | `building.id` | integer | The building's id. (min 1) | | `building.linked_to_macopro` | boolean | True when the building is linked to its MaCopro owners' portal account. | | `building.neq` | string \| null | Quebec enterprise number (NEQ) of the syndicate. | | `building.next_revision_date` | string (date) \| null | When the study is next due for revision. ISO 8601 date (YYYY-MM-DD). | | `building.phone_number` | string \| null | Phone number of the contact. (max length 50) | | `building.postal_code` | string \| null | Postal code. | | `building.responsible_person_name` | string \| null | Name of the syndicate's contact person. (max length 255) | | `building.revision_period_years` | integer \| null | Years between two revisions of the study (5 or 10). | | `building.syndicat_name` | string \| null | Name of the syndicate of co-owners. | | `building.unit_count` | integer \| null | Number of residential units. (min 0, max 10000) | | `building.updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | | `building.year_built` | integer \| null | Year of construction. (min 1600, max 2100) | | `etudes` | array of object | The études of this building you may open, newest first. | | `etudes[].building` | object \| null | The building studied. | | `etudes[].building.address` | string \| null | Street address. | | `etudes[].building.city` | string \| null | City. | | `etudes[].building.id` | integer | The building's id. (min 1) | | `etudes[].building.syndicat_name` | string \| null | Name of the syndicate of co-owners. | | `etudes[].dossier_no` | string \| null | The firm's file number for this étude. | | `etudes[].etude_date` | string (date) \| null | Date of the étude. ISO 8601 date (YYYY-MM-DD). | | `etudes[].id` | integer | The étude's id. (min 1) | | `etudes[].report_date` | string (date) \| null | Date printed on the report. ISO 8601 date (YYYY-MM-DD). | | `etudes[].updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | | `units` | array of object | The units, by number. | | `units[].fraction` | number \| null | Relative value (quote-part) of the unit, in percent. | | `units[].id` | integer | The unit's id. | | `units[].number` | string \| null | Unit number, as on the declaration of co-ownership. | | `units_source` | string | pro: units entered in CarnetCopro (editable); web: read from the MaCopro owners' portal (read-only). One of: pro, web. | Example arguments: ```json { "building_id": 17 } ``` Example result: ```json { "building": { "address": "1200, rue King Ouest", "building_type": "residential", "city": "Sherbrooke", "copropriete_type": "vertical", "id": 17, "neq": "1170000017", "postal_code": "J1H 1S1", "syndicat_name": "Syndicat du 1200 King", "unit_count": 24, "year_built": 1988 }, "etudes": [], "units": [ { "fraction": 4.17, "id": 301, "number": "101" } ], "units_source": "pro" } ``` Over REST: ```sh curl -s https://carnetcopro.ca/api/v1/buildings/17 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Create a building (`create_building`) Creates a building (immeuble) in the account: address, city, postal code and the syndicate's legal name are required; the rest of its description is optional. With a NEQ, the building is linked to its MaCopro owners' portal account, which is created if it does not exist yet; without one it stays unlinked until a NEQ is set with update_building. Check list_buildings first to avoid a duplicate. Does not create an étude: call create_etude with the new building's id next. - Group: Buildings - REST: `POST /api/v1/buildings` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `address` | string | yes | Street address. (max length 255) | | `city` | string | yes | City. (max length 255) | | `postal_code` | string | yes | Postal code, e.g. H2X 3J6. (max length 20) | | `syndicat_name` | string | yes | Legal name of the syndicate of co-owners. (max length 255) | | `building_type` | string \| null | no | Use of the building. One of: residential, commercial, mixed. | | `client_email` | string \| null | no | Email of the syndicate's contact. (max length 255) | | `commercial_unit_count` | integer \| null | no | Number of commercial units. (min 0, max 10000) | | `copropriete_type` | string \| null | no | Horizontal (row houses, detached units) or vertical (apartment building) co-ownership. One of: horizontal, vertical. | | `floors_above_ground` | integer \| null | no | Number of floors above ground. (min 0, max 200) | | `neq` | string \| null | no | Quebec enterprise number of the syndicate: exactly 10 digits. Setting it links the building to its MaCopro owners' portal account (created if needed). (max length 10) | | `next_revision_date` | string (date) \| null | no | When the study is next due for revision. ISO 8601 date (YYYY-MM-DD). | | `phone_number` | string \| null | no | Phone number of the contact. (max length 50) | | `responsible_person_name` | string \| null | no | Name of the syndicate's contact person. (max length 255) | | `revision_period_years` | integer | no | Years between two revisions of the study: 5 or 10. (min 5, max 10) | | `unit_count` | integer \| null | no | Number of residential units. (min 0, max 10000) | | `year_built` | integer \| null | no | Year of construction. (min 1600, max 2100) | Output: | Field | Type | Description | |---|---|---| | `building` | object | A building and its identity. | | `building.address` | string \| null | Street address. | | `building.building_type` | string \| null | Use of the building. One of: residential, commercial, mixed. | | `building.city` | string \| null | City. | | `building.client_email` | string \| null | Email of the syndicate's contact. (max length 255) | | `building.commercial_unit_count` | integer \| null | Number of commercial units. (min 0, max 10000) | | `building.copropriete_type` | string \| null | Horizontal (row houses, detached units) or vertical (apartment building) co-ownership. One of: horizontal, vertical. | | `building.floors_above_ground` | integer \| null | Number of floors above ground. (min 0, max 200) | | `building.has_photo` | boolean | True when a cover photo of the building is on file. | | `building.id` | integer | The building's id. (min 1) | | `building.linked_to_macopro` | boolean | True when the building is linked to its MaCopro owners' portal account. | | `building.neq` | string \| null | Quebec enterprise number (NEQ) of the syndicate. | | `building.next_revision_date` | string (date) \| null | When the study is next due for revision. ISO 8601 date (YYYY-MM-DD). | | `building.phone_number` | string \| null | Phone number of the contact. (max length 50) | | `building.postal_code` | string \| null | Postal code. | | `building.responsible_person_name` | string \| null | Name of the syndicate's contact person. (max length 255) | | `building.revision_period_years` | integer \| null | Years between two revisions of the study (5 or 10). | | `building.syndicat_name` | string \| null | Name of the syndicate of co-owners. | | `building.unit_count` | integer \| null | Number of residential units. (min 0, max 10000) | | `building.updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | | `building.year_built` | integer \| null | Year of construction. (min 1600, max 2100) | Example arguments: ```json { "address": "1200, rue King Ouest", "city": "Sherbrooke", "copropriete_type": "vertical", "postal_code": "J1H 1S1", "syndicat_name": "Syndicat du 1200 King", "unit_count": 24, "year_built": 1988 } ``` Example result: ```json { "building": { "address": "1200, rue King Ouest", "city": "Sherbrooke", "id": 17, "linked_to_macopro": false, "neq": null, "postal_code": "J1H 1S1", "syndicat_name": "Syndicat du 1200 King" } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/buildings \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"address":"1200, rue King Ouest","city":"Sherbrooke","copropriete_type":"vertical","postal_code":"J1H 1S1","syndicat_name":"Syndicat du 1200 King","unit_count":24,"year_built":1988}' ``` #### Update a building (`update_building`) Changes a building's identity and description (the étude's fiche cliente): address, postal code, syndicate name, NEQ, year built, unit counts, floors, type of use and of co-ownership, contact, revision period. Only the fields you send change; send null to clear an optional one. Setting a NEQ on an unlinked building links it to its MaCopro owners' portal account (created if needed). The change shows on every étude of the building. Does not change units (add_building_unit, delete_building_unit) nor the photo. - Group: Buildings - REST: `PATCH /api/v1/buildings/{building_id}` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `building_id` | integer | yes | The building to change (see list_buildings). (min 1) | | `address` | string | no | Street address. (max length 255) | | `building_type` | string \| null | no | Use of the building. One of: residential, commercial, mixed. | | `city` | string | no | City. (max length 255) | | `client_email` | string \| null | no | Email of the syndicate's contact. (max length 255) | | `commercial_unit_count` | integer \| null | no | Number of commercial units. (min 0, max 10000) | | `copropriete_type` | string \| null | no | Horizontal (row houses, detached units) or vertical (apartment building) co-ownership. One of: horizontal, vertical. | | `floors_above_ground` | integer \| null | no | Number of floors above ground. (min 0, max 200) | | `neq` | string \| null | no | Quebec enterprise number of the syndicate: exactly 10 digits. Setting it links the building to its MaCopro owners' portal account (created if needed). (max length 10) | | `next_revision_date` | string (date) \| null | no | When the study is next due for revision. ISO 8601 date (YYYY-MM-DD). | | `phone_number` | string \| null | no | Phone number of the contact. (max length 50) | | `postal_code` | string | no | Postal code, e.g. H2X 3J6. (max length 20) | | `responsible_person_name` | string \| null | no | Name of the syndicate's contact person. (max length 255) | | `revision_period_years` | integer | no | Years between two revisions of the study: 5 or 10. (min 5, max 10) | | `syndicat_name` | string | no | Legal name of the syndicate of co-owners. (max length 255) | | `unit_count` | integer \| null | no | Number of residential units. (min 0, max 10000) | | `year_built` | integer \| null | no | Year of construction. (min 1600, max 2100) | Output: | Field | Type | Description | |---|---|---| | `building` | object | A building and its identity. | | `building.address` | string \| null | Street address. | | `building.building_type` | string \| null | Use of the building. One of: residential, commercial, mixed. | | `building.city` | string \| null | City. | | `building.client_email` | string \| null | Email of the syndicate's contact. (max length 255) | | `building.commercial_unit_count` | integer \| null | Number of commercial units. (min 0, max 10000) | | `building.copropriete_type` | string \| null | Horizontal (row houses, detached units) or vertical (apartment building) co-ownership. One of: horizontal, vertical. | | `building.floors_above_ground` | integer \| null | Number of floors above ground. (min 0, max 200) | | `building.has_photo` | boolean | True when a cover photo of the building is on file. | | `building.id` | integer | The building's id. (min 1) | | `building.linked_to_macopro` | boolean | True when the building is linked to its MaCopro owners' portal account. | | `building.neq` | string \| null | Quebec enterprise number (NEQ) of the syndicate. | | `building.next_revision_date` | string (date) \| null | When the study is next due for revision. ISO 8601 date (YYYY-MM-DD). | | `building.phone_number` | string \| null | Phone number of the contact. (max length 50) | | `building.postal_code` | string \| null | Postal code. | | `building.responsible_person_name` | string \| null | Name of the syndicate's contact person. (max length 255) | | `building.revision_period_years` | integer \| null | Years between two revisions of the study (5 or 10). | | `building.syndicat_name` | string \| null | Name of the syndicate of co-owners. | | `building.unit_count` | integer \| null | Number of residential units. (min 0, max 10000) | | `building.updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | | `building.year_built` | integer \| null | Year of construction. (min 1600, max 2100) | Example arguments: ```json { "building_id": 17, "floors_above_ground": 6, "year_built": 1988 } ``` Example result: ```json { "building": { "address": "1200, rue King Ouest", "floors_above_ground": 6, "id": 17, "year_built": 1988 } } ``` Over REST: ```sh curl -s -X PATCH https://carnetcopro.ca/api/v1/buildings/17 \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"floors_above_ground":6,"year_built":1988}' ``` #### Add a unit to a building (`add_building_unit`) Adds a unit (private portion) to a building, with its number and its relative value (fraction, in percent) from the declaration of co-ownership; the fractions feed the per-unit contribution tables. Unit numbers are unique per building. Refused when the building's units come from its MaCopro owners' portal (units_source "web" in get_building), where they are maintained instead. Does not change the building's unit_count (update_building). Use delete_building_unit to remove one. - Group: Buildings - REST: `POST /api/v1/buildings/{building_id}/units` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `building_id` | integer | yes | The building (see list_buildings). (min 1) | | `number` | string | yes | Unit number, e.g. 101. (min length 1, max length 50) | | `fraction` | number \| null | no | Relative value (quote-part) of the unit, in percent. (min 0, max 100) | Output: | Field | Type | Description | |---|---|---| | `unit` | object | A unit of the building. | | `unit.fraction` | number \| null | Relative value (quote-part) of the unit, in percent. | | `unit.id` | integer | The unit's id. | | `unit.number` | string \| null | Unit number, as on the declaration of co-ownership. | Example arguments: ```json { "building_id": 17, "fraction": 4.17, "number": "101" } ``` Example result: ```json { "unit": { "fraction": 4.17, "id": 301, "number": "101" } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/buildings/17/units \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"fraction":4.17,"number":"101"}' ``` #### Delete a building unit (`delete_building_unit`) Deletes a unit entered in CarnetCopro from a building, with its fraction; the per-unit contribution tables no longer list it. Permanent. Only units listed by get_building with units_source "pro" can be deleted; those read from the MaCopro owners' portal are maintained there. Does not change the building's unit_count (update_building). To correct a unit's number or fraction, delete it and add it again with add_building_unit. - Group: Buildings - REST: `DELETE /api/v1/buildings/{building_id}/units/{unit_id}` - Scope: `etudes:delete` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `building_id` | integer | yes | The building (see list_buildings). (min 1) | | `unit_id` | integer | yes | The unit to delete (see get_building). (min 1) | Output: | Field | Type | Description | |---|---|---| | `building_id` | integer | Its building. (min 1) | | `deleted` | boolean | True: the unit is gone. | | `unit_id` | integer | The deleted unit's id. (min 1) | Example arguments: ```json { "building_id": 17, "unit_id": 301 } ``` Example result: ```json { "building_id": 17, "deleted": true, "unit_id": 301 } ``` Over REST: ```sh curl -s -X DELETE https://carnetcopro.ca/api/v1/buildings/17/units/301 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` ### Études #### List études (`list_etudes`) Lists the reserve fund studies (études) you may open in the account, newest first, with their building. Filter by building_id, by text (matches the file number, address, city or syndicate name) or by étude date range. Results are paginated: pass next_cursor back as cursor for more. Use get_etude for an étude's full header and parameters. Read-only. - Group: Études - REST: `GET /api/v1/etudes` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `building_id` | integer | no | Only études of this building (see list_buildings). (min 1) | | `cursor` | string | no | The next_cursor of a previous call, to get the next page. | | `date_from` | string (date) | no | Only études dated on or after this day. ISO 8601 date (YYYY-MM-DD). | | `date_to` | string (date) | no | Only études dated on or before this day. ISO 8601 date (YYYY-MM-DD). | | `limit` | integer | no | How many results to return (default 50). (min 1, max 200) | | `query` | string | no | Text to look for in the file number, address, city or syndicate name. (max length 200) | Output: | Field | Type | Description | |---|---|---| | `etudes` | array of object | The études, newest first. | | `etudes[].building` | object \| null | The building studied. | | `etudes[].building.address` | string \| null | Street address. | | `etudes[].building.city` | string \| null | City. | | `etudes[].building.id` | integer | The building's id. (min 1) | | `etudes[].building.syndicat_name` | string \| null | Name of the syndicate of co-owners. | | `etudes[].dossier_no` | string \| null | The firm's file number for this étude. | | `etudes[].etude_date` | string (date) \| null | Date of the étude. ISO 8601 date (YYYY-MM-DD). | | `etudes[].id` | integer | The étude's id. (min 1) | | `etudes[].report_date` | string (date) \| null | Date printed on the report. ISO 8601 date (YYYY-MM-DD). | | `etudes[].updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | | `next_cursor` | string \| null | Pass it as cursor to get the next page; null on the last page. | Example arguments: ```json { "limit": 10, "query": "Sherbrooke" } ``` Example result: ```json { "etudes": [ { "building": { "address": "1200, rue King Ouest", "city": "Sherbrooke", "id": 17, "syndicat_name": "Syndicat du 1200 King" }, "dossier_no": "CCETD-2026-0041", "etude_date": "2026-09-15", "id": 41, "report_date": null, "updated_at": "2026-10-20T14:03:11Z" } ], "next_cursor": null } ``` Over REST: ```sh curl -s "https://carnetcopro.ca/api/v1/etudes?limit=10&query=Sherbrooke" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Get an étude (`get_etude`) Returns one étude: its header and study parameters (dates, file number, inspector, weather, mandate, horizon, fund balance and contribution, safety threshold, site visit declaration, signatories, access), its building, the people present at the inspection, and progress counts (components, components marked complete, components in the report). Use list_components for the components themselves, list_etudes to find an étude. Does not change anything (update_etude). Read-only. - Group: Études - REST: `GET /api/v1/etudes/{etude_id}` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | Output: | Field | Type | Description | |---|---|---| | `attendees` | array of object | People present at the inspection, in order. | | `attendees[].id` | integer | The attendee's id. (min 1) | | `attendees[].name` | string | Full name. | | `attendees[].role` | string \| null | In what capacity, e.g. Administrateur du syndicat, Gestionnaire. | | `etude` | object | An étude's header and study parameters. | | `etude.access_mode` | string | Who may open the étude: listed users only, administrators plus listed users, or every member. One of: users, admins, everyone. | | `etude.access_user_ids` | array of integer | Members explicitly given access. | | `etude.building` | object \| null | The building studied. | | `etude.building.address` | string \| null | Street address. | | `etude.building.city` | string \| null | City. | | `etude.building.id` | integer | The building's id. (min 1) | | `etude.building.syndicat_name` | string \| null | Name of the syndicate of co-owners. | | `etude.carnet_revision_year` | integer \| null | Year the maintenance log (carnet d'entretien) is next revised. (min 2000, max 2100) | | `etude.current_annual_contribution` | number \| null | Current yearly contribution to the fund. In CAD. (min 0) | | `etude.dossier_no` | string \| null | The firm's file number. (max length 100) | | `etude.established_by_signatory_id` | integer \| null | Signatory who establishes the study (see list_signatories). (min 1) | | `etude.etude_date` | string (date) \| null | Date of the étude. ISO 8601 date (YYYY-MM-DD). | | `etude.fund_balance` | number \| null | Reserve fund balance reported by the syndicate. In CAD. (min 0) | | `etude.fund_balance_as_of` | string (date) \| null | Date of that balance. ISO 8601 date (YYYY-MM-DD). | | `etude.id` | integer | The étude's id. (min 1) | | `etude.inflation_rate` | number | Yearly inflation building scenarios start from, in percent (e.g. 3). (min 0, max 99.99) | | `etude.inspection_date` | string (date) \| null | Date of the on-site examination (printed in the signed declarations). ISO 8601 date (YYYY-MM-DD). | | `etude.inspector_id` | integer \| null | The member who inspects the building. (min 1) | | `etude.investment_return_rate` | number | Yearly return on the fund building scenarios start from, in percent. (min 0, max 99.99) | | `etude.mandate_nature` | string | First study of the building, or a revision of an earlier one. One of: first_study, revision. | | `etude.next_study_year` | integer \| null | Year the next study is due. (min 2000, max 2100) | | `etude.notes` | string \| null | Free notes on the étude, not printed in the report. (max length 20000) | | `etude.reference_year` | integer \| null | First year of the projections. (min 2000, max 2100) | | `etude.report_date` | string (date) \| null | Date printed on the report. ISO 8601 date (YYYY-MM-DD). | | `etude.safety_threshold` | number \| null | Minimum fund balance the scenarios must keep. In CAD. (min 0) | | `etude.site_visit_mode` | string | Whether the signatory visited the site themself, or supervised someone who did. One of: self, supervised. | | `etude.site_visit_signatory_id` | integer \| null | Signatory for the site visit. (min 1) | | `etude.site_visit_supervisee_name` | string \| null | Who visited under supervision (when site_visit_mode is supervised). (max length 200) | | `etude.study_horizon_years` | integer | Projection horizon in years; the regulation requires at least 25. (min 25, max 50) | | `etude.syndicat_rep` | string \| null | Who represented the syndicate at the visit. (max length 200) | | `etude.tax_rate` | number | Sales taxes (GST + QST) applied to costs, in percent. | | `etude.updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | | `etude.weather` | string \| null | Weather during the site visit. (max length 200) | | `etude.writing_signatory_id` | integer \| null | Signatory who wrote the report. (min 1) | | `inspector` | object \| null | The member who inspects the building. | | `inspector.email` | string | Email address. | | `inspector.id` | integer | The member's id. (min 1) | | `inspector.name` | string | Full name. | | `progress` | object | How far the inspection is. | | `progress.completed` | integer | Components marked complete. (min 0) | | `progress.components` | integer | Components (and sub-components) of the étude. (min 0) | | `progress.in_report` | integer | Components included in the report (set_report_scope). (min 0) | | `signatories` | object | The signatories' names (ids are in etude). | | `signatories.established_by` | string \| null | Name of the signatory who establishes the study. | | `signatories.site_visit` | string \| null | Name of the signatory for the site visit. | | `signatories.writing` | string \| null | Name of the signatory who wrote the report. | Example arguments: ```json { "etude_id": 41 } ``` Example result: ```json { "attendees": [ { "id": 5, "name": "Paul Roy", "role": "Administrateur du syndicat" } ], "etude": { "dossier_no": "CCETD-2026-0041", "etude_date": "2026-09-15", "id": 41 }, "inspector": { "email": "marie@exemple.ca", "id": 12, "name": "Marie Tremblay" }, "progress": { "completed": 18, "components": 62, "in_report": 40 }, "signatories": { "established_by": "Julie Bouchard", "site_visit": "Julie Bouchard", "writing": null } } ``` Over REST: ```sh curl -s https://carnetcopro.ca/api/v1/etudes/41 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Create an étude (`create_etude`) Creates a new reserve fund study (étude) of an existing building (create_building first if needed). The étude gets the next file number unless you give one, the full UNIFORMAT component list, the firm's sub-components, sales tax rate and default signatories, and opens for the administrators and its inspector. inspector_id defaults to you; only owners and administrators may name another member. Returns the étude as get_etude does. To copy an existing étude onto a new building, use duplicate_etude; to fill in its header, update_etude. - Group: Études - REST: `POST /api/v1/etudes` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `building_id` | integer | yes | The building studied (see list_buildings). (min 1) | | `dossier_no` | string | no | The firm's file number; generated when left out. (min length 1, max length 100) | | `etude_date` | string (date) | no | Date of the étude. ISO 8601 date (YYYY-MM-DD). | | `inspector_id` | integer | no | The member who inspects the building (see list_account_users); defaults to you. (min 1) | | `notes` | string | no | Free notes on the étude, not printed in the report. (max length 20000) | Output: | Field | Type | Description | |---|---|---| | `attendees` | array of object | People present at the inspection, in order. | | `attendees[].id` | integer | The attendee's id. (min 1) | | `attendees[].name` | string | Full name. | | `attendees[].role` | string \| null | In what capacity, e.g. Administrateur du syndicat, Gestionnaire. | | `etude` | object | An étude's header and study parameters. | | `etude.access_mode` | string | Who may open the étude: listed users only, administrators plus listed users, or every member. One of: users, admins, everyone. | | `etude.access_user_ids` | array of integer | Members explicitly given access. | | `etude.building` | object \| null | The building studied. | | `etude.building.address` | string \| null | Street address. | | `etude.building.city` | string \| null | City. | | `etude.building.id` | integer | The building's id. (min 1) | | `etude.building.syndicat_name` | string \| null | Name of the syndicate of co-owners. | | `etude.carnet_revision_year` | integer \| null | Year the maintenance log (carnet d'entretien) is next revised. (min 2000, max 2100) | | `etude.current_annual_contribution` | number \| null | Current yearly contribution to the fund. In CAD. (min 0) | | `etude.dossier_no` | string \| null | The firm's file number. (max length 100) | | `etude.established_by_signatory_id` | integer \| null | Signatory who establishes the study (see list_signatories). (min 1) | | `etude.etude_date` | string (date) \| null | Date of the étude. ISO 8601 date (YYYY-MM-DD). | | `etude.fund_balance` | number \| null | Reserve fund balance reported by the syndicate. In CAD. (min 0) | | `etude.fund_balance_as_of` | string (date) \| null | Date of that balance. ISO 8601 date (YYYY-MM-DD). | | `etude.id` | integer | The étude's id. (min 1) | | `etude.inflation_rate` | number | Yearly inflation building scenarios start from, in percent (e.g. 3). (min 0, max 99.99) | | `etude.inspection_date` | string (date) \| null | Date of the on-site examination (printed in the signed declarations). ISO 8601 date (YYYY-MM-DD). | | `etude.inspector_id` | integer \| null | The member who inspects the building. (min 1) | | `etude.investment_return_rate` | number | Yearly return on the fund building scenarios start from, in percent. (min 0, max 99.99) | | `etude.mandate_nature` | string | First study of the building, or a revision of an earlier one. One of: first_study, revision. | | `etude.next_study_year` | integer \| null | Year the next study is due. (min 2000, max 2100) | | `etude.notes` | string \| null | Free notes on the étude, not printed in the report. (max length 20000) | | `etude.reference_year` | integer \| null | First year of the projections. (min 2000, max 2100) | | `etude.report_date` | string (date) \| null | Date printed on the report. ISO 8601 date (YYYY-MM-DD). | | `etude.safety_threshold` | number \| null | Minimum fund balance the scenarios must keep. In CAD. (min 0) | | `etude.site_visit_mode` | string | Whether the signatory visited the site themself, or supervised someone who did. One of: self, supervised. | | `etude.site_visit_signatory_id` | integer \| null | Signatory for the site visit. (min 1) | | `etude.site_visit_supervisee_name` | string \| null | Who visited under supervision (when site_visit_mode is supervised). (max length 200) | | `etude.study_horizon_years` | integer | Projection horizon in years; the regulation requires at least 25. (min 25, max 50) | | `etude.syndicat_rep` | string \| null | Who represented the syndicate at the visit. (max length 200) | | `etude.tax_rate` | number | Sales taxes (GST + QST) applied to costs, in percent. | | `etude.updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | | `etude.weather` | string \| null | Weather during the site visit. (max length 200) | | `etude.writing_signatory_id` | integer \| null | Signatory who wrote the report. (min 1) | | `inspector` | object \| null | The member who inspects the building. | | `inspector.email` | string | Email address. | | `inspector.id` | integer | The member's id. (min 1) | | `inspector.name` | string | Full name. | | `progress` | object | How far the inspection is. | | `progress.completed` | integer | Components marked complete. (min 0) | | `progress.components` | integer | Components (and sub-components) of the étude. (min 0) | | `progress.in_report` | integer | Components included in the report (set_report_scope). (min 0) | | `signatories` | object | The signatories' names (ids are in etude). | | `signatories.established_by` | string \| null | Name of the signatory who establishes the study. | | `signatories.site_visit` | string \| null | Name of the signatory for the site visit. | | `signatories.writing` | string \| null | Name of the signatory who wrote the report. | Example arguments: ```json { "building_id": 17, "etude_date": "2026-11-04" } ``` Example result: ```json { "attendees": [], "etude": { "dossier_no": "CCETD-2026-0042", "etude_date": "2026-11-04", "id": 42 }, "inspector": { "email": "marie@exemple.ca", "id": 12, "name": "Marie Tremblay" }, "progress": { "completed": 0, "components": 62, "in_report": 0 }, "signatories": { "established_by": "Julie Bouchard", "site_visit": null, "writing": null } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/etudes \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"building_id":17,"etude_date":"2026-11-04"}' ``` #### Update an étude (`update_etude`) Changes the header and study parameters of an étude: dates, file number, inspector, weather, syndicate representative, notes, mandate nature, projection horizon, fund balance and contribution, safety threshold, site visit declaration and the three signatories. Only the fields you send change; send null to clear an optional field. Read the current values with get_etude first. Does not change components, tasks or scenarios, nor who may open the étude (set_etude_access). - Group: Études - REST: `PATCH /api/v1/etudes/{etude_id}` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude to change (see list_etudes). (min 1) | | `carnet_revision_year` | integer \| null | no | Year the maintenance log (carnet d'entretien) is next revised. (min 2000, max 2100) | | `current_annual_contribution` | number \| null | no | Current yearly contribution to the fund. In CAD. (min 0) | | `dossier_no` | string \| null | no | The firm's file number. (max length 100) | | `established_by_signatory_id` | integer \| null | no | Signatory who establishes the study (see list_signatories). (min 1) | | `etude_date` | string (date) \| null | no | Date of the étude. ISO 8601 date (YYYY-MM-DD). | | `fund_balance` | number \| null | no | Reserve fund balance reported by the syndicate. In CAD. (min 0) | | `fund_balance_as_of` | string (date) \| null | no | Date of that balance. ISO 8601 date (YYYY-MM-DD). | | `inflation_rate` | number | no | Yearly inflation building scenarios start from, in percent (e.g. 3). (min 0, max 99.99) | | `inspection_date` | string (date) \| null | no | Date of the on-site examination (printed in the signed declarations). ISO 8601 date (YYYY-MM-DD). | | `inspector_id` | integer | no | The member who inspects the building (see list_account_users). (min 1) | | `investment_return_rate` | number | no | Yearly return on the fund building scenarios start from, in percent. (min 0, max 99.99) | | `mandate_nature` | string | no | First study of the building, or a revision of an earlier one. One of: first_study, revision. | | `next_study_year` | integer \| null | no | Year the next study is due. (min 2000, max 2100) | | `notes` | string \| null | no | Free notes on the étude, not printed in the report. (max length 20000) | | `reference_year` | integer \| null | no | First year of the projections. (min 2000, max 2100) | | `report_date` | string (date) \| null | no | Date printed on the report. ISO 8601 date (YYYY-MM-DD). | | `safety_threshold` | number \| null | no | Minimum fund balance the scenarios must keep. In CAD. (min 0) | | `site_visit_mode` | string | no | Whether the signatory visited the site themself, or supervised someone who did. One of: self, supervised. | | `site_visit_signatory_id` | integer \| null | no | Signatory for the site visit. (min 1) | | `site_visit_supervisee_name` | string \| null | no | Who visited under supervision (when site_visit_mode is supervised). (max length 200) | | `study_horizon_years` | integer | no | Projection horizon in years; the regulation requires at least 25. (min 25, max 50) | | `syndicat_rep` | string \| null | no | Who represented the syndicate at the visit. (max length 200) | | `weather` | string \| null | no | Weather during the site visit. (max length 200) | | `writing_signatory_id` | integer \| null | no | Signatory who wrote the report. (min 1) | Output: | Field | Type | Description | |---|---|---| | `etude` | object | An étude's header and study parameters. | | `etude.access_mode` | string | Who may open the étude: listed users only, administrators plus listed users, or every member. One of: users, admins, everyone. | | `etude.access_user_ids` | array of integer | Members explicitly given access. | | `etude.building` | object \| null | The building studied. | | `etude.building.address` | string \| null | Street address. | | `etude.building.city` | string \| null | City. | | `etude.building.id` | integer | The building's id. (min 1) | | `etude.building.syndicat_name` | string \| null | Name of the syndicate of co-owners. | | `etude.carnet_revision_year` | integer \| null | Year the maintenance log (carnet d'entretien) is next revised. (min 2000, max 2100) | | `etude.current_annual_contribution` | number \| null | Current yearly contribution to the fund. In CAD. (min 0) | | `etude.dossier_no` | string \| null | The firm's file number. (max length 100) | | `etude.established_by_signatory_id` | integer \| null | Signatory who establishes the study (see list_signatories). (min 1) | | `etude.etude_date` | string (date) \| null | Date of the étude. ISO 8601 date (YYYY-MM-DD). | | `etude.fund_balance` | number \| null | Reserve fund balance reported by the syndicate. In CAD. (min 0) | | `etude.fund_balance_as_of` | string (date) \| null | Date of that balance. ISO 8601 date (YYYY-MM-DD). | | `etude.id` | integer | The étude's id. (min 1) | | `etude.inflation_rate` | number | Yearly inflation building scenarios start from, in percent (e.g. 3). (min 0, max 99.99) | | `etude.inspection_date` | string (date) \| null | Date of the on-site examination (printed in the signed declarations). ISO 8601 date (YYYY-MM-DD). | | `etude.inspector_id` | integer \| null | The member who inspects the building. (min 1) | | `etude.investment_return_rate` | number | Yearly return on the fund building scenarios start from, in percent. (min 0, max 99.99) | | `etude.mandate_nature` | string | First study of the building, or a revision of an earlier one. One of: first_study, revision. | | `etude.next_study_year` | integer \| null | Year the next study is due. (min 2000, max 2100) | | `etude.notes` | string \| null | Free notes on the étude, not printed in the report. (max length 20000) | | `etude.reference_year` | integer \| null | First year of the projections. (min 2000, max 2100) | | `etude.report_date` | string (date) \| null | Date printed on the report. ISO 8601 date (YYYY-MM-DD). | | `etude.safety_threshold` | number \| null | Minimum fund balance the scenarios must keep. In CAD. (min 0) | | `etude.site_visit_mode` | string | Whether the signatory visited the site themself, or supervised someone who did. One of: self, supervised. | | `etude.site_visit_signatory_id` | integer \| null | Signatory for the site visit. (min 1) | | `etude.site_visit_supervisee_name` | string \| null | Who visited under supervision (when site_visit_mode is supervised). (max length 200) | | `etude.study_horizon_years` | integer | Projection horizon in years; the regulation requires at least 25. (min 25, max 50) | | `etude.syndicat_rep` | string \| null | Who represented the syndicate at the visit. (max length 200) | | `etude.tax_rate` | number | Sales taxes (GST + QST) applied to costs, in percent. | | `etude.updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | | `etude.weather` | string \| null | Weather during the site visit. (max length 200) | | `etude.writing_signatory_id` | integer \| null | Signatory who wrote the report. (min 1) | Example arguments: ```json { "etude_id": 41, "fund_balance": 1.845e5, "fund_balance_as_of": "2026-08-31", "weather": "Ensoleillé, 12 °C" } ``` Example result: ```json { "etude": { "fund_balance": 1.845e5, "fund_balance_as_of": "2026-08-31", "id": 41, "weather": "Ensoleillé, 12 °C" } } ``` Over REST: ```sh curl -s -X PATCH https://carnetcopro.ca/api/v1/etudes/41 \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"fund_balance":1.845e5,"fund_balance_as_of":"2026-08-31","weather":"Ensoleillé, 12 °C"}' ``` #### Duplicate an étude (`duplicate_etude`) Copies an étude onto a new building, for a similar building or a new client: creates the building from the identity you give (with a NEQ, linked to its MaCopro owners' portal account), then a new étude with you as inspector, a new file number and today's date. The components with their descriptions, lifespans and constats (text only), and the report scope, are always copied; works (copy_travaux), maintenance (copy_entretien) and financing scenarios (copy_scenarios) only on request. Photos, generated documents and history are never copied. The source étude is unchanged. To revise the same building, use create_etude instead. - Group: Études - REST: `POST /api/v1/etudes/{etude_id}/duplicate` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `building` | object | yes | The new building's identity; complete it later with update_building. | | `building.address` | string | yes | Street address. (max length 255) | | `building.city` | string | yes | City. (max length 255) | | `building.postal_code` | string | yes | Postal code, e.g. H2X 3J6. (max length 20) | | `building.syndicat_name` | string | yes | Legal name of the syndicate of co-owners. (max length 255) | | `building.neq` | string \| null | no | Quebec enterprise number of the syndicate: exactly 10 digits. Setting it links the building to its MaCopro owners' portal account (created if needed). (max length 10) | | `etude_id` | integer | yes | The étude to copy (see list_etudes). (min 1) | | `copy_entretien` | boolean | no | Also copy the maintenance (entretien) tasks. Default false. | | `copy_scenarios` | boolean | no | Also copy the financing scenarios, with their planning of the copied tasks. Default false. | | `copy_travaux` | boolean | no | Also copy the works (travaux) tasks. Default false. | Output: | Field | Type | Description | |---|---|---| | `attendees` | array of object | People present at the inspection, in order. | | `attendees[].id` | integer | The attendee's id. (min 1) | | `attendees[].name` | string | Full name. | | `attendees[].role` | string \| null | In what capacity, e.g. Administrateur du syndicat, Gestionnaire. | | `etude` | object | An étude's header and study parameters. | | `etude.access_mode` | string | Who may open the étude: listed users only, administrators plus listed users, or every member. One of: users, admins, everyone. | | `etude.access_user_ids` | array of integer | Members explicitly given access. | | `etude.building` | object \| null | The building studied. | | `etude.building.address` | string \| null | Street address. | | `etude.building.city` | string \| null | City. | | `etude.building.id` | integer | The building's id. (min 1) | | `etude.building.syndicat_name` | string \| null | Name of the syndicate of co-owners. | | `etude.carnet_revision_year` | integer \| null | Year the maintenance log (carnet d'entretien) is next revised. (min 2000, max 2100) | | `etude.current_annual_contribution` | number \| null | Current yearly contribution to the fund. In CAD. (min 0) | | `etude.dossier_no` | string \| null | The firm's file number. (max length 100) | | `etude.established_by_signatory_id` | integer \| null | Signatory who establishes the study (see list_signatories). (min 1) | | `etude.etude_date` | string (date) \| null | Date of the étude. ISO 8601 date (YYYY-MM-DD). | | `etude.fund_balance` | number \| null | Reserve fund balance reported by the syndicate. In CAD. (min 0) | | `etude.fund_balance_as_of` | string (date) \| null | Date of that balance. ISO 8601 date (YYYY-MM-DD). | | `etude.id` | integer | The étude's id. (min 1) | | `etude.inflation_rate` | number | Yearly inflation building scenarios start from, in percent (e.g. 3). (min 0, max 99.99) | | `etude.inspection_date` | string (date) \| null | Date of the on-site examination (printed in the signed declarations). ISO 8601 date (YYYY-MM-DD). | | `etude.inspector_id` | integer \| null | The member who inspects the building. (min 1) | | `etude.investment_return_rate` | number | Yearly return on the fund building scenarios start from, in percent. (min 0, max 99.99) | | `etude.mandate_nature` | string | First study of the building, or a revision of an earlier one. One of: first_study, revision. | | `etude.next_study_year` | integer \| null | Year the next study is due. (min 2000, max 2100) | | `etude.notes` | string \| null | Free notes on the étude, not printed in the report. (max length 20000) | | `etude.reference_year` | integer \| null | First year of the projections. (min 2000, max 2100) | | `etude.report_date` | string (date) \| null | Date printed on the report. ISO 8601 date (YYYY-MM-DD). | | `etude.safety_threshold` | number \| null | Minimum fund balance the scenarios must keep. In CAD. (min 0) | | `etude.site_visit_mode` | string | Whether the signatory visited the site themself, or supervised someone who did. One of: self, supervised. | | `etude.site_visit_signatory_id` | integer \| null | Signatory for the site visit. (min 1) | | `etude.site_visit_supervisee_name` | string \| null | Who visited under supervision (when site_visit_mode is supervised). (max length 200) | | `etude.study_horizon_years` | integer | Projection horizon in years; the regulation requires at least 25. (min 25, max 50) | | `etude.syndicat_rep` | string \| null | Who represented the syndicate at the visit. (max length 200) | | `etude.tax_rate` | number | Sales taxes (GST + QST) applied to costs, in percent. | | `etude.updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | | `etude.weather` | string \| null | Weather during the site visit. (max length 200) | | `etude.writing_signatory_id` | integer \| null | Signatory who wrote the report. (min 1) | | `inspector` | object \| null | The member who inspects the building. | | `inspector.email` | string | Email address. | | `inspector.id` | integer | The member's id. (min 1) | | `inspector.name` | string | Full name. | | `progress` | object | How far the inspection is. | | `progress.completed` | integer | Components marked complete. (min 0) | | `progress.components` | integer | Components (and sub-components) of the étude. (min 0) | | `progress.in_report` | integer | Components included in the report (set_report_scope). (min 0) | | `signatories` | object | The signatories' names (ids are in etude). | | `signatories.established_by` | string \| null | Name of the signatory who establishes the study. | | `signatories.site_visit` | string \| null | Name of the signatory for the site visit. | | `signatories.writing` | string \| null | Name of the signatory who wrote the report. | Example arguments: ```json { "building": { "address": "1210, rue King Ouest", "city": "Sherbrooke", "postal_code": "J1H 1S2", "syndicat_name": "Syndicat du 1210 King" }, "copy_entretien": true, "copy_travaux": true, "etude_id": 41 } ``` Example result: ```json { "attendees": [], "etude": { "dossier_no": "CCETD-2026-0043", "id": 43 }, "inspector": { "email": "marie@exemple.ca", "id": 12, "name": "Marie Tremblay" }, "progress": { "completed": 0, "components": 62, "in_report": 40 }, "signatories": { "established_by": null, "site_visit": null, "writing": null } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/etudes/41/duplicate \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"building":{"address":"1210, rue King Ouest","city":"Sherbrooke","postal_code":"J1H 1S2","syndicat_name":"Syndicat du 1210 King"},"copy_entretien":true,"copy_travaux":true}' ``` #### Set who may open an étude (`set_etude_access`) Sets who may open an étude, replacing the current setting: mode "everyone" (every member), "admins" (owners and administrators, plus the members in user_ids) or "users" (only the members in user_ids). The account owner can always open it. Owners and administrators only. Leaving yourself out makes the étude unreachable for you afterwards. Use list_account_users for the ids. Does not change members' roles or any other part of the étude. - Group: Études - REST: `PUT /api/v1/etudes/{etude_id}/access` - Scope: `etudes:write` — owners and administrators only - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `mode` | string | yes | everyone: every member; admins: administrators plus user_ids; users: user_ids only. One of: users, admins, everyone. | | `user_ids` | array of integer | no | Members let in by name; ignored for everyone. (max items 500) | Output: | Field | Type | Description | |---|---|---| | `access_mode` | string | Who may open the étude now. One of: users, admins, everyone. | | `access_user_ids` | array of integer | Members let in by name. | | `etude_id` | integer | The étude. (min 1) | | `you_can_open` | boolean | Whether you can still open the étude. | Example arguments: ```json { "etude_id": 41, "mode": "admins", "user_ids": [ 15 ] } ``` Example result: ```json { "access_mode": "admins", "access_user_ids": [ 15 ], "etude_id": 41, "you_can_open": true } ``` Over REST: ```sh curl -s -X PUT https://carnetcopro.ca/api/v1/etudes/41/access \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"mode":"admins","user_ids":[15]}' ``` #### Get an étude's history (`get_etude_history`) Lists the recorded changes of an étude, newest first: when, who, what kind of record (etude_item for a component, attachment for a photo, …), its id, the action (create, update, delete, complete) and the changed values. Paginated: pass next_cursor back as cursor. Use it to see who changed a component and when. Only the changes the app records appear (mainly component edits and photos); it cannot undo anything. Read-only. - Group: Études - REST: `GET /api/v1/etudes/{etude_id}/history` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `cursor` | string | no | The next_cursor of a previous call, to get the next page. | | `limit` | integer | no | How many results to return (default 50). (min 1, max 200) | Output: | Field | Type | Description | |---|---|---| | `entries` | array of object | The changes, newest first. | | `entries[].action` | string \| null | create, update, delete or complete. | | `entries[].at` | string (date-time) | When the change was made. ISO 8601 date-time, UTC. | | `entries[].changes` | object | The changed values, as recorded. | | `entries[].entity_id` | integer \| null | Id of the record that changed. | | `entries[].entity_type` | string \| null | What changed: etude, etude_item, attachment, … | | `entries[].id` | integer | The entry's id. (min 1) | | `entries[].user` | object \| null | Who made it; null for the system. | | `entries[].user.email` | string | Email address. | | `entries[].user.id` | integer | The member's id. (min 1) | | `entries[].user.name` | string | Full name. | | `next_cursor` | string \| null | Pass it as cursor to get the next page; null on the last page. | Example arguments: ```json { "etude_id": 41, "limit": 20 } ``` Example result: ```json { "entries": [ { "action": "update", "at": "2026-10-20T14:03:11Z", "changes": { "lifespan_years": 25 }, "entity_id": 3310, "entity_type": "etude_item", "id": 908, "user": { "email": "marie@exemple.ca", "id": 12, "name": "Marie Tremblay" } } ], "next_cursor": null } ``` Over REST: ```sh curl -s "https://carnetcopro.ca/api/v1/etudes/41/history?limit=20" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Set the report's components (`set_report_scope`) Sets which components of an étude the report covers, replacing the whole selection with component_ids (send every id to keep, an empty list to clear it). Components left out stay in the étude with their data but are not printed nor projected. The ids are those of list_components for this étude; ids of another étude are refused. Use get_etude to see how many are selected. Does not create or delete components. - Group: Études - REST: `PUT /api/v1/etudes/{etude_id}/report-scope` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `component_ids` | array of integer | yes | Every component the report covers. (max items 2000) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | Output: | Field | Type | Description | |---|---|---| | `component_ids` | array of integer | The components the report covers, by id. | | `count` | integer | How many. (min 0) | | `etude_id` | integer | The étude. (min 1) | Example arguments: ```json { "component_ids": [ 3301, 3302, 3310 ], "etude_id": 41 } ``` Example result: ```json { "component_ids": [ 3301, 3302, 3310 ], "count": 3, "etude_id": 41 } ``` Over REST: ```sh curl -s -X PUT https://carnetcopro.ca/api/v1/etudes/41/report-scope \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"component_ids":[3301,3302,3310]}' ``` #### Add an inspection attendee (`add_etude_attendee`) Adds a person to those present at the inspection of an étude, after the ones already listed, with the capacity they attended in (free text, e.g. Administrateur du syndicat, Gestionnaire, Concierge). The report lists them. get_etude returns the current list; remove_etude_attendee removes one. Does not change the syndicate representative field of the header (update_etude, syndicat_rep). - Group: Études - REST: `POST /api/v1/etudes/{etude_id}/attendees` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `name` | string | yes | The person's full name. (min length 1, max length 200) | | `role` | string \| null | no | In what capacity they attended. (max length 200) | Output: | Field | Type | Description | |---|---|---| | `attendee` | object | A person present at the inspection. | | `attendee.id` | integer | The attendee's id. (min 1) | | `attendee.name` | string | Full name. | | `attendee.role` | string \| null | In what capacity, e.g. Administrateur du syndicat, Gestionnaire. | Example arguments: ```json { "etude_id": 41, "name": "Paul Roy", "role": "Administrateur du syndicat" } ``` Example result: ```json { "attendee": { "id": 5, "name": "Paul Roy", "role": "Administrateur du syndicat" } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/etudes/41/attendees \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name":"Paul Roy","role":"Administrateur du syndicat"}' ``` #### Remove an inspection attendee (`remove_etude_attendee`) Removes a person from those present at the inspection of an étude; the report no longer lists them. Permanent. The attendee ids are in get_etude. To correct a name or capacity, remove the attendee and add them again with add_etude_attendee. Does not affect account members or signatories. - Group: Études - REST: `DELETE /api/v1/etudes/{etude_id}/attendees/{attendee_id}` - Scope: `etudes:delete` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `attendee_id` | integer | yes | The attendee to remove (see get_etude). (min 1) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | Output: | Field | Type | Description | |---|---|---| | `attendee_id` | integer | The removed attendee's id. (min 1) | | `deleted` | boolean | True: the attendee is gone. | | `etude_id` | integer | The étude. (min 1) | Example arguments: ```json { "attendee_id": 5, "etude_id": 41 } ``` Example result: ```json { "attendee_id": 5, "deleted": true, "etude_id": 41 } ``` Over REST: ```sh curl -s -X DELETE https://carnetcopro.ca/api/v1/etudes/41/attendees/5 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### List documents consulted (`list_documents_consulted`) Lists the documents requested from the syndicate for an étude (declaration of co-ownership, plans, previous reports and studies, …), in the report's order: whether each was obtained, whether it must be gathered before the next revision, and the copies kept with the étude. The report's « Documents consultés » annex prints this list. Like the app, the first call lays out the standard checklist, every document marked not obtained. Use update_document_consulted to record what arrived. Does not return the files' content. - Group: Études - REST: `GET /api/v1/etudes/{etude_id}/documents-consulted` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | Output: | Field | Type | Description | |---|---|---| | `documents` | array of object | The documents, in the report's order. | | `documents[].category` | string | Constitutive (declaration) or technical document. One of: constitutive, technical. | | `documents[].consequence` | string \| null | What its absence changed in the study. | | `documents[].detail` | string \| null | What it is used for in the study. | | `documents[].files` | array of object | Copies kept with the étude (uploaded in the app). | | `documents[].files[].file_name` | string \| null | File name. | | `documents[].files[].file_size` | integer \| null | Size in bytes. | | `documents[].files[].file_type` | string \| null | MIME type. | | `documents[].files[].id` | integer | The file's id. (min 1) | | `documents[].id` | integer | The document's id. (min 1) | | `documents[].name` | string | The document, e.g. Déclaration de copropriété. | | `documents[].obtained` | string | yes, no, partial (some of it usable), or none (it does not exist for this building). One of: yes, no, partial, none. | | `documents[].to_obtain_before_revision` | boolean | True when the syndicate must gather it before the next revision. | Example arguments: ```json { "etude_id": 41 } ``` Example result: ```json { "documents": [ { "category": "constitutive", "consequence": null, "detail": "Établissement du périmètre de responsabilité et de la qualification des parties communes.", "files": [ { "file_name": "declaration.pdf", "file_size": 2400000, "file_type": "application/pdf", "id": 9 } ], "id": 77, "name": "Déclaration de copropriété", "obtained": "yes", "to_obtain_before_revision": false } ] } ``` Over REST: ```sh curl -s https://carnetcopro.ca/api/v1/etudes/41/documents-consulted \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Update a document consulted (`update_document_consulted`) Records what came of a document requested from the syndicate for an étude: whether it was obtained (yes, no, partial, or none when it does not exist for this building) and whether the syndicate must gather it before the next revision. Only the fields you send change. The report's annex prints both. Document ids come from list_documents_consulted. Does not upload or remove the document's files, nor add documents to the list. - Group: Études - REST: `PATCH /api/v1/etudes/{etude_id}/documents-consulted/{document_id}` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `document_id` | integer | yes | The document (see list_documents_consulted). (min 1) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `obtained` | string | no | yes, no, partial (some of it usable), or none (it does not exist for this building). One of: yes, no, partial, none. | | `to_obtain_before_revision` | boolean | no | True when the syndicate must gather it before the next revision. | Output: | Field | Type | Description | |---|---|---| | `document` | object | A document requested from the syndicate. | | `document.category` | string | Constitutive (declaration) or technical document. One of: constitutive, technical. | | `document.consequence` | string \| null | What its absence changed in the study. | | `document.detail` | string \| null | What it is used for in the study. | | `document.files` | array of object | Copies kept with the étude (uploaded in the app). | | `document.files[].file_name` | string \| null | File name. | | `document.files[].file_size` | integer \| null | Size in bytes. | | `document.files[].file_type` | string \| null | MIME type. | | `document.files[].id` | integer | The file's id. (min 1) | | `document.id` | integer | The document's id. (min 1) | | `document.name` | string | The document, e.g. Déclaration de copropriété. | | `document.obtained` | string | yes, no, partial (some of it usable), or none (it does not exist for this building). One of: yes, no, partial, none. | | `document.to_obtain_before_revision` | boolean | True when the syndicate must gather it before the next revision. | Example arguments: ```json { "document_id": 79, "etude_id": 41, "obtained": "no", "to_obtain_before_revision": true } ``` Example result: ```json { "document": { "category": "technical", "consequence": null, "detail": null, "files": [], "id": 79, "name": "Plans et devis d'origine", "obtained": "no", "to_obtain_before_revision": true } } ``` Over REST: ```sh curl -s -X PATCH https://carnetcopro.ca/api/v1/etudes/41/documents-consulted/79 \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"obtained":"no","to_obtain_before_revision":true}' ``` #### Get the report's written texts (`get_report_texts`) Returns the paragraphs an étude's report prints on one of its written pages: narrative "report" is the executive summary (portrait, short-term interventions, main interventions, financial planning, conclusion), "scope" the « Portée, méthode et limites » page. For each paragraph: its key, heading, what it should say, the text this étude prints (HTML), the firm's standard text, and whether the étude has its own. Not available to inspectors. Use save_report_texts to change them. Read-only. - Group: Études - REST: `GET /api/v1/etudes/{etude_id}/report-texts` - Scope: `etudes:read` — owners, administrators and technicians - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `narrative` | string | yes | report: the executive summary (sommaire exécutif); scope: the « Portée, méthode et limites » page. One of: report, scope. | Output: | Field | Type | Description | |---|---|---| | `etude_id` | integer | The étude. (min 1) | | `narrative` | string | report: the executive summary (sommaire exécutif); scope: the « Portée, méthode et limites » page. One of: report, scope. | | `paragraphs` | array of object | The paragraphs, in the report's order. | | `paragraphs[].custom` | boolean | True when the étude has its own text for this paragraph. | | `paragraphs[].hint` | string | What the paragraph should say. | | `paragraphs[].key` | string | The paragraph's key, to send to save_report_texts. One of: sommaire_portrait, sommaire_court_terme, sommaire_interventions, sommaire_financier, sommaire_conclusion, portee_intro, portee_methode, portee_composantes, portee_durees_couts, portee_renseignements, portee_utilisation. | | `paragraphs[].label` | string | The heading it prints under. | | `paragraphs[].standard_text` | string | The firm's standard text for this paragraph. HTML. | | `paragraphs[].text` | string | What this étude prints: its own text when custom, else the standard text. HTML. | Example arguments: ```json { "etude_id": 41, "narrative": "report" } ``` Example result: ```json { "etude_id": 41, "narrative": "report", "paragraphs": [ { "custom": true, "hint": "L'immeuble, son année de construction, sa composition et les travaux majeurs déjà réalisés.", "key": "sommaire_portrait", "label": "Portrait général de la copropriété", "standard_text": "", "text": "

Immeuble de 24 unités construit en 1988.

" } ] } ``` Over REST: ```sh curl -s "https://carnetcopro.ca/api/v1/etudes/41/report-texts?narrative=report" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Save the report's written texts (`save_report_texts`) Writes paragraphs of an étude's report: narrative "report" (executive summary) or "scope" (« Portée, méthode et limites »). Send the paragraphs to change as key and text (HTML paragraphs); the others keep their text. An empty text leaves the paragraph out of the report. With as_standard true, the texts also become the firm's standard for études created afterwards (existing études keep what they print). Not available to inspectors. Read the keys and current texts with get_report_texts first. Returns the page as get_report_texts does. - Group: Études - REST: `PATCH /api/v1/etudes/{etude_id}/report-texts` - Scope: `etudes:write` — owners, administrators and technicians - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `narrative` | string | yes | report: the executive summary (sommaire exécutif); scope: the « Portée, méthode et limites » page. One of: report, scope. | | `paragraphs` | array of object | yes | The paragraphs to write. (max items 20) | | `paragraphs[].key` | string | yes | The paragraph's key, from get_report_texts for this narrative. One of: sommaire_portrait, sommaire_court_terme, sommaire_interventions, sommaire_financier, sommaire_conclusion, portee_intro, portee_methode, portee_composantes, portee_durees_couts, portee_renseignements, portee_utilisation. | | `paragraphs[].text` | string | yes | The paragraph's text, as HTML paragraphs. (max length 50000) | | `as_standard` | boolean | no | Also make these texts the firm's standard for new études. Default false. | Output: | Field | Type | Description | |---|---|---| | `etude_id` | integer | The étude. (min 1) | | `narrative` | string | report: the executive summary (sommaire exécutif); scope: the « Portée, méthode et limites » page. One of: report, scope. | | `paragraphs` | array of object | The paragraphs, in the report's order. | | `paragraphs[].custom` | boolean | True when the étude has its own text for this paragraph. | | `paragraphs[].hint` | string | What the paragraph should say. | | `paragraphs[].key` | string | The paragraph's key, to send to save_report_texts. One of: sommaire_portrait, sommaire_court_terme, sommaire_interventions, sommaire_financier, sommaire_conclusion, portee_intro, portee_methode, portee_composantes, portee_durees_couts, portee_renseignements, portee_utilisation. | | `paragraphs[].label` | string | The heading it prints under. | | `paragraphs[].standard_text` | string | The firm's standard text for this paragraph. HTML. | | `paragraphs[].text` | string | What this étude prints: its own text when custom, else the standard text. HTML. | Example arguments: ```json { "etude_id": 41, "narrative": "report", "paragraphs": [ { "key": "sommaire_portrait", "text": "

Immeuble de 24 unités construit en 1988.

" } ] } ``` Example result: ```json { "etude_id": 41, "narrative": "report", "paragraphs": [ { "custom": true, "hint": "L'immeuble, son année de construction, sa composition et les travaux majeurs déjà réalisés.", "key": "sommaire_portrait", "label": "Portrait général de la copropriété", "standard_text": "", "text": "

Immeuble de 24 unités construit en 1988.

" } ] } ``` Over REST: ```sh curl -s -X PATCH https://carnetcopro.ca/api/v1/etudes/41/report-texts \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"narrative":"report","paragraphs":[{"key":"sommaire_portrait","text":"

Immeuble de 24 unités construit en 1988.

"}]}' ``` ### Components #### List components (`list_components`) Lists the components (composantes) of an étude in UNIFORMAT II order: each canonical component of a code, then its sub-components, with the code as printed (B2020-1), general condition, installation year, lifespan, whether it is in the report's scope and which editor tabs are marked complete. Filter by uniformat_code prefix (e.g. B20), completion (complete or incomplete) or selected_in_report. Paginated: pass next_cursor back as cursor. Use get_component for a component's details, measurements, photos, constats and tasks. Read-only. - Group: Components - REST: `GET /api/v1/etudes/{etude_id}/components` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `completion` | string | no | complete: all four tabs marked complete; incomplete: at least one open. One of: complete, incomplete. | | `cursor` | string | no | The next_cursor of a previous call, to get the next page. | | `limit` | integer | no | How many results to return (default 50). (min 1, max 200) | | `selected_in_report` | boolean | no | true: only components in the report's scope; false: only those outside it. | | `uniformat_code` | string | no | Only components whose code starts with this, e.g. B20 or B2020. (max length 20) | Output: | Field | Type | Description | |---|---|---| | `components` | array of object | The components, in code order. | | `components[].completed_at` | string (date-time) \| null | When all four tabs were marked complete; null until then. ISO 8601 date-time, UTC. | | `components[].completed_tabs` | array of string | Editor tabs marked complete: general (Description), specific (Constats), travaux, entretien. A complete tab no longer changes until reopened. | | `components[].condition` | string \| null | General condition. One of the account's condition_states values (get_account_context); by default bon, passable, mauvais, non_visible when it could not be seen, na when outside the study's scope. | | `components[].display_code` | string | The code as the report prints it: B2020, or B2020-1 for a sub-component. | | `components[].element_name` | string \| null | The UNIFORMAT element's name. | | `components[].id` | integer | The component's id (component_id in the other tools). (min 1) | | `components[].is_subcomponent` | boolean | True for a sub-component added under a code (it can be deleted). | | `components[].lifespan_years` | integer \| null | Retained useful life, in years. | | `components[].selected_in_report` | boolean | True when the component is in the report's scope (see set_report_scope). | | `components[].subcomponent_label` | string \| null | The sub-component's own label; null on the canonical component of the code. | | `components[].subcomponent_number` | integer \| null | The sub-component's number under its code; null on the canonical component. | | `components[].uniformat_code` | string | Its UNIFORMAT II code, e.g. B2020. | | `components[].year_of_installation` | integer \| null | Year of installation. | | `next_cursor` | string \| null | Pass it as cursor to get the next page; null on the last page. | Example arguments: ```json { "etude_id": 41, "limit": 20, "uniformat_code": "B20" } ``` Example result: ```json { "components": [ { "completed_at": null, "completed_tabs": [ "general" ], "condition": "passable", "display_code": "B2020", "element_name": "Fenêtres extérieures", "id": 812, "is_subcomponent": false, "lifespan_years": 30, "selected_in_report": true, "subcomponent_label": null, "subcomponent_number": null, "uniformat_code": "B2020", "year_of_installation": 2004 } ], "next_cursor": null } ``` Over REST: ```sh curl -s "https://carnetcopro.ca/api/v1/etudes/41/components?limit=20&uniformat_code=B20" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Get a component (`get_component`) Returns one component of an étude in full: condition, installation year, lifespans, description notes, the firm's private note (never printed in a report), constats text, method, maintenance fields, the measurement takeoff (métré) with its totals, its photos with signed links valid about one hour, its constats with their photos, and a summary of its works and maintenance tasks (get_task for a task's lines). Use list_components to find component ids. Read-only. - Group: Components - REST: `GET /api/v1/etudes/{etude_id}/components/{component_id}` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `component_id` | integer | yes | The component (see list_components). (min 1) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | Output: | Field | Type | Description | |---|---|---| | `component` | object | A component of the étude, in full. | | `component.completed_at` | string (date-time) \| null | When all four tabs were marked complete; null until then. ISO 8601 date-time, UTC. | | `component.completed_tabs` | array of string | Editor tabs marked complete: general (Description), specific (Constats), travaux, entretien. A complete tab no longer changes until reopened. | | `component.condition` | string \| null | General condition. One of the account's condition_states values (get_account_context); by default bon, passable, mauvais, non_visible when it could not be seen, na when outside the study's scope. | | `component.deficiencies` | array of object | The component's constats. | | `component.deficiencies[].component_display_code` | string | The component's code as printed, e.g. B2020-1. | | `component.deficiencies[].component_id` | integer | The component it is on. (min 1) | | `component.deficiencies[].component_name` | string \| null | The component's label or element name. | | `component.deficiencies[].copropriete_horizontale` | boolean | True when the constat concerns a horizontal co-ownership (copropriété horizontale). | | `component.deficiencies[].created_at` | string (date-time) \| null | When it was recorded. ISO 8601 date-time, UTC. | | `component.deficiencies[].description` | string \| null | The constat's text, HTML; null when it has none. | | `component.deficiencies[].id` | integer | The constat's id (deficiency_id in the other tools). (min 1) | | `component.deficiencies[].include_in_report` | boolean | False when the constat is kept out of the report. | | `component.deficiencies[].photos` | array of object | Photos illustrating the constat. | | `component.deficiencies[].photos[].component_id` | integer | The component it belongs to. (min 1) | | `component.deficiencies[].photos[].content_type` | string \| null | MIME type, e.g. image/jpeg. | | `component.deficiencies[].photos[].deficiency_id` | integer \| null | The constat it illustrates; null for a photo of the component itself. (min 1) | | `component.deficiencies[].photos[].file_name` | string \| null | Original file name. | | `component.deficiencies[].photos[].file_size` | integer \| null | Size in bytes. | | `component.deficiencies[].photos[].id` | integer | The photo's id (photo_id in set_photo_title and delete_photo). (min 1) | | `component.deficiencies[].photos[].tab` | string \| null | The editor tab it was added on (general for the reference photos). | | `component.deficiencies[].photos[].title` | string \| null | Legend printed under the photo in the report. | | `component.deficiencies[].photos[].url` | string \| null | A signed link to the image, valid for about one hour; call again for a fresh one. | | `component.deficiencies[].state` | string | Its état, one of the account's constat states (see get_account_context). | | `component.deficiencies[].state_label` | string | The état's label as the report prints it. | | `component.deficiencies[].title` | string | The constat's title (its first line). | | `component.display_code` | string | The code as the report prints it: B2020, or B2020-1 for a sub-component. | | `component.element_name` | string \| null | The UNIFORMAT element's name. | | `component.goal` | string \| null | Objective of the inspection of this component. (max length 20000) | | `component.id` | integer | The component's id (component_id in the other tools). (min 1) | | `component.install_year_estimated` | boolean | True when the installation year was estimated on site rather than documented. | | `component.is_subcomponent` | boolean | True for a sub-component added under a code (it can be deleted). | | `component.lifespan_max_years` | integer \| null | High end of the typical useful life, in years. (min 0, max 200) | | `component.lifespan_min_years` | integer \| null | Low end of the typical useful life, in years. (min 0, max 200) | | `component.lifespan_years` | integer \| null | Retained useful life, in years. (min 0, max 200) | | `component.maintenance_description` | string \| null | Maintenance description (HTML or plain text). (max length 50000) | | `component.maintenance_estimated_cost` | number \| null | Estimated maintenance cost. In CAD. (min 0) | | `component.maintenance_frequency` | string \| null | Maintenance frequency. (max length 255) | | `component.maintenance_priority` | string \| null | Maintenance priority. (max length 255) | | `component.measurement_totals` | object | Totals of the measurement takeoff, converted to metres. | | `component.measurement_totals.area_m2` | number | Total area of every row, in square metres. | | `component.measurement_totals.perimeter_m` | number | Total perimeter of every row, in metres. | | `component.measurements` | array of object | The measurement takeoff (métré) rows. | | `component.measurements[].component_id` | integer | The component it belongs to. (min 1) | | `component.measurements[].height` | number \| null | Height (or length) of one element, in unit. (min 0) | | `component.measurements[].id` | integer | The measurement's id. (min 1) | | `component.measurements[].label` | string \| null | What is measured, e.g. « Fenêtre type A ». (max length 255) | | `component.measurements[].position` | integer | Order among the component's rows. | | `component.measurements[].quantity` | integer | How many identical elements. | | `component.measurements[].unit` | string | Unit of width and height: m (metres) or ft (feet). One of: m, ft. | | `component.measurements[].width` | number \| null | Width of one element, in unit. (min 0) | | `component.method` | string \| null | Inspection method used for this component (HTML or plain text). (max length 20000) | | `component.next_cycle_year` | integer \| null | Year of the replacement after the one in the horizon. | | `component.no_intervention_note` | string \| null | Explanation printed with that reason. (max length 5000) | | `component.no_intervention_reason` | string \| null | Why no intervention is planned in the horizon, when none is. (max length 255) | | `component.notes` | string \| null | Description of the component, printed in the report (HTML or plain text). (max length 50000) | | `component.photos` | array of object | The component's photos, constat photos included. | | `component.photos[].component_id` | integer | The component it belongs to. (min 1) | | `component.photos[].content_type` | string \| null | MIME type, e.g. image/jpeg. | | `component.photos[].deficiency_id` | integer \| null | The constat it illustrates; null for a photo of the component itself. (min 1) | | `component.photos[].file_name` | string \| null | Original file name. | | `component.photos[].file_size` | integer \| null | Size in bytes. | | `component.photos[].id` | integer | The photo's id (photo_id in set_photo_title and delete_photo). (min 1) | | `component.photos[].tab` | string \| null | The editor tab it was added on (general for the reference photos). | | `component.photos[].title` | string \| null | Legend printed under the photo in the report. | | `component.photos[].url` | string \| null | A signed link to the image, valid for about one hour; call again for a fresh one. | | `component.private_note` | string \| null | The firm's private note on the component: shown in the app only, never printed in a report. (max length 20000) | | `component.restricted_group_id` | integer \| null | The restricted-use group the component belongs to, if any. (min 1) | | `component.selected_in_report` | boolean | True when the component is in the report's scope (see set_report_scope). | | `component.specific_conditions` | string \| null | Specific conditions observed (Constats tab text, HTML or plain text). (max length 50000) | | `component.subcomponent_label` | string \| null | The sub-component's own label; null on the canonical component of the code. | | `component.subcomponent_number` | integer \| null | The sub-component's number under its code; null on the canonical component. | | `component.tasks` | array of object | Works and maintenance tasks of the component. | | `component.tasks[].component_id` | integer \| null | The component it is tied to, if any. (min 1) | | `component.tasks[].display_code` | string \| null | The code as the report prints it (B2020-1 for a sub-component). | | `component.tasks[].estimated_cost` | number \| null | Estimated cost. In CAD. (min 0) | | `component.tasks[].estimated_year` | integer \| null | Year the work is planned (travaux). | | `component.tasks[].frequency` | string \| null | Maintenance frequency (entretien), e.g. annuelle. | | `component.tasks[].id` | integer | The task's id (task_id in the other tools). (min 1) | | `component.tasks[].intervention_type` | string \| null | What a travaux does to its component: major_repair, replacement, or a provision for either. Null for an entretien. One of: major_repair, replacement, major_repair_provision, replacement_provision. | | `component.tasks[].task_type` | string | travaux (a work: repair or replacement) or entretien (maintenance). One of: travaux, entretien. | | `component.tasks[].title` | string | Title of the task. | | `component.tasks[].uniformat_code` | string \| null | UNIFORMAT II code of its component. | | `component.travaux_note` | string \| null | The Travaux tab's notepad: the firm's own note, in no report. (max length 20000) | | `component.uniformat_code` | string | Its UNIFORMAT II code, e.g. B2020. | | `component.year_of_installation` | integer \| null | Year of installation. (min 1800, max 2200) | Example arguments: ```json { "component_id": 812, "etude_id": 41 } ``` Example result: ```json { "component": { "condition": "passable", "deficiencies": [], "display_code": "B2020", "element_name": "Fenêtres extérieures", "id": 812, "lifespan_years": 30, "measurement_totals": { "area_m2": 43.2, "perimeter_m": 129.6 }, "measurements": [ { "component_id": 812, "height": 1.5, "id": 55, "label": "Fenêtre type A", "position": 0, "quantity": 24, "unit": "m", "width": 1.2 } ], "notes": "

Fenêtres à battant en PVC, double vitrage.

", "photos": [], "private_note": "Vérifier la facture du remplacement partiel de 2019.", "tasks": [], "uniformat_code": "B2020", "year_of_installation": 2004 } } ``` Over REST: ```sh curl -s https://carnetcopro.ca/api/v1/etudes/41/components/812 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Update a component (`update_component`) Changes the fields of one component of an étude: general condition, installation year (and whether it is estimated), retained and typical lifespans, description notes, the firm's private note (never printed), constats text, method and goal, the Travaux notepad, maintenance description, frequency, cost and priority, and the no-intervention reason. Only the fields you send change; send null to clear one. Refused with conflict when the field's editor tab is marked complete (reopen it with set_component_completion). Does not touch constats (add_deficiency), measurements, photos or tasks. - Group: Components - REST: `PATCH /api/v1/etudes/{etude_id}/components/{component_id}` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `component_id` | integer | yes | The component to change (see list_components). (min 1) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `condition` | string \| null | no | General condition. One of the account's condition_states values (get_account_context); by default bon, passable, mauvais, non_visible when it could not be seen, na when outside the study's scope. | | `goal` | string \| null | no | Objective of the inspection of this component. (max length 20000) | | `install_year_estimated` | boolean | no | True when the installation year was estimated on site rather than documented. | | `lifespan_max_years` | integer \| null | no | High end of the typical useful life, in years. (min 0, max 200) | | `lifespan_min_years` | integer \| null | no | Low end of the typical useful life, in years. (min 0, max 200) | | `lifespan_years` | integer \| null | no | Retained useful life, in years. (min 0, max 200) | | `maintenance_description` | string \| null | no | Maintenance description (HTML or plain text). (max length 50000) | | `maintenance_estimated_cost` | number \| null | no | Estimated maintenance cost. In CAD. (min 0) | | `maintenance_frequency` | string \| null | no | Maintenance frequency. (max length 255) | | `maintenance_priority` | string \| null | no | Maintenance priority. (max length 255) | | `method` | string \| null | no | Inspection method used for this component (HTML or plain text). (max length 20000) | | `no_intervention_note` | string \| null | no | Explanation printed with that reason. (max length 5000) | | `no_intervention_reason` | string \| null | no | Why no intervention is planned in the horizon, when none is. (max length 255) | | `notes` | string \| null | no | Description of the component, printed in the report (HTML or plain text). (max length 50000) | | `private_note` | string \| null | no | The firm's private note on the component: shown in the app only, never printed in a report. (max length 20000) | | `specific_conditions` | string \| null | no | Specific conditions observed (Constats tab text, HTML or plain text). (max length 50000) | | `travaux_note` | string \| null | no | The Travaux tab's notepad: the firm's own note, in no report. (max length 20000) | | `year_of_installation` | integer \| null | no | Year of installation. (min 1800, max 2200) | Output: | Field | Type | Description | |---|---|---| | `component` | object | A component of the étude, in full. | | `component.completed_at` | string (date-time) \| null | When all four tabs were marked complete; null until then. ISO 8601 date-time, UTC. | | `component.completed_tabs` | array of string | Editor tabs marked complete: general (Description), specific (Constats), travaux, entretien. A complete tab no longer changes until reopened. | | `component.condition` | string \| null | General condition. One of the account's condition_states values (get_account_context); by default bon, passable, mauvais, non_visible when it could not be seen, na when outside the study's scope. | | `component.deficiencies` | array of object | The component's constats. | | `component.deficiencies[].component_display_code` | string | The component's code as printed, e.g. B2020-1. | | `component.deficiencies[].component_id` | integer | The component it is on. (min 1) | | `component.deficiencies[].component_name` | string \| null | The component's label or element name. | | `component.deficiencies[].copropriete_horizontale` | boolean | True when the constat concerns a horizontal co-ownership (copropriété horizontale). | | `component.deficiencies[].created_at` | string (date-time) \| null | When it was recorded. ISO 8601 date-time, UTC. | | `component.deficiencies[].description` | string \| null | The constat's text, HTML; null when it has none. | | `component.deficiencies[].id` | integer | The constat's id (deficiency_id in the other tools). (min 1) | | `component.deficiencies[].include_in_report` | boolean | False when the constat is kept out of the report. | | `component.deficiencies[].photos` | array of object | Photos illustrating the constat. | | `component.deficiencies[].photos[].component_id` | integer | The component it belongs to. (min 1) | | `component.deficiencies[].photos[].content_type` | string \| null | MIME type, e.g. image/jpeg. | | `component.deficiencies[].photos[].deficiency_id` | integer \| null | The constat it illustrates; null for a photo of the component itself. (min 1) | | `component.deficiencies[].photos[].file_name` | string \| null | Original file name. | | `component.deficiencies[].photos[].file_size` | integer \| null | Size in bytes. | | `component.deficiencies[].photos[].id` | integer | The photo's id (photo_id in set_photo_title and delete_photo). (min 1) | | `component.deficiencies[].photos[].tab` | string \| null | The editor tab it was added on (general for the reference photos). | | `component.deficiencies[].photos[].title` | string \| null | Legend printed under the photo in the report. | | `component.deficiencies[].photos[].url` | string \| null | A signed link to the image, valid for about one hour; call again for a fresh one. | | `component.deficiencies[].state` | string | Its état, one of the account's constat states (see get_account_context). | | `component.deficiencies[].state_label` | string | The état's label as the report prints it. | | `component.deficiencies[].title` | string | The constat's title (its first line). | | `component.display_code` | string | The code as the report prints it: B2020, or B2020-1 for a sub-component. | | `component.element_name` | string \| null | The UNIFORMAT element's name. | | `component.goal` | string \| null | Objective of the inspection of this component. (max length 20000) | | `component.id` | integer | The component's id (component_id in the other tools). (min 1) | | `component.install_year_estimated` | boolean | True when the installation year was estimated on site rather than documented. | | `component.is_subcomponent` | boolean | True for a sub-component added under a code (it can be deleted). | | `component.lifespan_max_years` | integer \| null | High end of the typical useful life, in years. (min 0, max 200) | | `component.lifespan_min_years` | integer \| null | Low end of the typical useful life, in years. (min 0, max 200) | | `component.lifespan_years` | integer \| null | Retained useful life, in years. (min 0, max 200) | | `component.maintenance_description` | string \| null | Maintenance description (HTML or plain text). (max length 50000) | | `component.maintenance_estimated_cost` | number \| null | Estimated maintenance cost. In CAD. (min 0) | | `component.maintenance_frequency` | string \| null | Maintenance frequency. (max length 255) | | `component.maintenance_priority` | string \| null | Maintenance priority. (max length 255) | | `component.measurement_totals` | object | Totals of the measurement takeoff, converted to metres. | | `component.measurement_totals.area_m2` | number | Total area of every row, in square metres. | | `component.measurement_totals.perimeter_m` | number | Total perimeter of every row, in metres. | | `component.measurements` | array of object | The measurement takeoff (métré) rows. | | `component.measurements[].component_id` | integer | The component it belongs to. (min 1) | | `component.measurements[].height` | number \| null | Height (or length) of one element, in unit. (min 0) | | `component.measurements[].id` | integer | The measurement's id. (min 1) | | `component.measurements[].label` | string \| null | What is measured, e.g. « Fenêtre type A ». (max length 255) | | `component.measurements[].position` | integer | Order among the component's rows. | | `component.measurements[].quantity` | integer | How many identical elements. | | `component.measurements[].unit` | string | Unit of width and height: m (metres) or ft (feet). One of: m, ft. | | `component.measurements[].width` | number \| null | Width of one element, in unit. (min 0) | | `component.method` | string \| null | Inspection method used for this component (HTML or plain text). (max length 20000) | | `component.next_cycle_year` | integer \| null | Year of the replacement after the one in the horizon. | | `component.no_intervention_note` | string \| null | Explanation printed with that reason. (max length 5000) | | `component.no_intervention_reason` | string \| null | Why no intervention is planned in the horizon, when none is. (max length 255) | | `component.notes` | string \| null | Description of the component, printed in the report (HTML or plain text). (max length 50000) | | `component.photos` | array of object | The component's photos, constat photos included. | | `component.photos[].component_id` | integer | The component it belongs to. (min 1) | | `component.photos[].content_type` | string \| null | MIME type, e.g. image/jpeg. | | `component.photos[].deficiency_id` | integer \| null | The constat it illustrates; null for a photo of the component itself. (min 1) | | `component.photos[].file_name` | string \| null | Original file name. | | `component.photos[].file_size` | integer \| null | Size in bytes. | | `component.photos[].id` | integer | The photo's id (photo_id in set_photo_title and delete_photo). (min 1) | | `component.photos[].tab` | string \| null | The editor tab it was added on (general for the reference photos). | | `component.photos[].title` | string \| null | Legend printed under the photo in the report. | | `component.photos[].url` | string \| null | A signed link to the image, valid for about one hour; call again for a fresh one. | | `component.private_note` | string \| null | The firm's private note on the component: shown in the app only, never printed in a report. (max length 20000) | | `component.restricted_group_id` | integer \| null | The restricted-use group the component belongs to, if any. (min 1) | | `component.selected_in_report` | boolean | True when the component is in the report's scope (see set_report_scope). | | `component.specific_conditions` | string \| null | Specific conditions observed (Constats tab text, HTML or plain text). (max length 50000) | | `component.subcomponent_label` | string \| null | The sub-component's own label; null on the canonical component of the code. | | `component.subcomponent_number` | integer \| null | The sub-component's number under its code; null on the canonical component. | | `component.tasks` | array of object | Works and maintenance tasks of the component. | | `component.tasks[].component_id` | integer \| null | The component it is tied to, if any. (min 1) | | `component.tasks[].display_code` | string \| null | The code as the report prints it (B2020-1 for a sub-component). | | `component.tasks[].estimated_cost` | number \| null | Estimated cost. In CAD. (min 0) | | `component.tasks[].estimated_year` | integer \| null | Year the work is planned (travaux). | | `component.tasks[].frequency` | string \| null | Maintenance frequency (entretien), e.g. annuelle. | | `component.tasks[].id` | integer | The task's id (task_id in the other tools). (min 1) | | `component.tasks[].intervention_type` | string \| null | What a travaux does to its component: major_repair, replacement, or a provision for either. Null for an entretien. One of: major_repair, replacement, major_repair_provision, replacement_provision. | | `component.tasks[].task_type` | string | travaux (a work: repair or replacement) or entretien (maintenance). One of: travaux, entretien. | | `component.tasks[].title` | string | Title of the task. | | `component.tasks[].uniformat_code` | string \| null | UNIFORMAT II code of its component. | | `component.travaux_note` | string \| null | The Travaux tab's notepad: the firm's own note, in no report. (max length 20000) | | `component.uniformat_code` | string | Its UNIFORMAT II code, e.g. B2020. | | `component.year_of_installation` | integer \| null | Year of installation. (min 1800, max 2200) | Example arguments: ```json { "component_id": 812, "condition": "passable", "etude_id": 41, "lifespan_years": 30, "notes": "

Fenêtres à battant en PVC, double vitrage. Coupe-froid usés.

", "year_of_installation": 2004 } ``` Example result: ```json { "component": { "condition": "passable", "display_code": "B2020", "id": 812, "lifespan_years": 30, "year_of_installation": 2004 } } ``` Over REST: ```sh curl -s -X PATCH https://carnetcopro.ca/api/v1/etudes/41/components/812 \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"condition":"passable","lifespan_years":30,"notes":"

Fenêtres à battant en PVC, double vitrage. Coupe-froid usés.

","year_of_installation":2004}' ``` #### Mark a component complete (`set_component_completion`) Marks a component's editor tabs complete, or reopens them. With tab (general for Description, specific for Constats, travaux, entretien) only that tab changes; without it, all four do. A component is complete once its four tabs are, and a complete tab refuses changes from the other tools until it is reopened. Returns the component in short with its completed_tabs. Does not change any field of the component (update_component). - Group: Components - REST: `PUT /api/v1/etudes/{etude_id}/components/{component_id}/completion` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `complete` | boolean | yes | true marks complete; false reopens. | | `component_id` | integer | yes | The component (see list_components). (min 1) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `tab` | string | no | Only this tab: general (Description), specific (Constats), travaux or entretien. Omit for all four. One of: general, specific, travaux, entretien. | Output: | Field | Type | Description | |---|---|---| | `component` | object | A component of the étude, in short. | | `component.completed_at` | string (date-time) \| null | When all four tabs were marked complete; null until then. ISO 8601 date-time, UTC. | | `component.completed_tabs` | array of string | Editor tabs marked complete: general (Description), specific (Constats), travaux, entretien. A complete tab no longer changes until reopened. | | `component.condition` | string \| null | General condition. One of the account's condition_states values (get_account_context); by default bon, passable, mauvais, non_visible when it could not be seen, na when outside the study's scope. | | `component.display_code` | string | The code as the report prints it: B2020, or B2020-1 for a sub-component. | | `component.element_name` | string \| null | The UNIFORMAT element's name. | | `component.id` | integer | The component's id (component_id in the other tools). (min 1) | | `component.is_subcomponent` | boolean | True for a sub-component added under a code (it can be deleted). | | `component.lifespan_years` | integer \| null | Retained useful life, in years. | | `component.selected_in_report` | boolean | True when the component is in the report's scope (see set_report_scope). | | `component.subcomponent_label` | string \| null | The sub-component's own label; null on the canonical component of the code. | | `component.subcomponent_number` | integer \| null | The sub-component's number under its code; null on the canonical component. | | `component.uniformat_code` | string | Its UNIFORMAT II code, e.g. B2020. | | `component.year_of_installation` | integer \| null | Year of installation. | Example arguments: ```json { "complete": true, "component_id": 812, "etude_id": 41, "tab": "general" } ``` Example result: ```json { "component": { "completed_at": null, "completed_tabs": [ "general" ], "display_code": "B2020", "id": 812 } } ``` Over REST: ```sh curl -s -X PUT https://carnetcopro.ca/api/v1/etudes/41/components/812/completion \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"complete":true,"tab":"general"}' ``` #### Add a sub-component (`add_subcomponent`) Adds a sub-component under a UNIFORMAT code of an étude, e.g. a second B2020 entry labelled « Fenêtres en PVC », numbered B2020-1, B2020-2… It joins the report's scope, and the account's other études offer it too (unselected). The code must be one of the étude's components (list_components). Returns the new component; fill it with update_component. Does not create canonical components, which every étude already has. - Group: Components - REST: `POST /api/v1/etudes/{etude_id}/components` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `label` | string | yes | The sub-component's label, e.g. Fenêtres en PVC. (min length 1, max length 255) | | `uniformat_code` | string | yes | The UNIFORMAT II code it goes under, e.g. B2020 (see list_components). (min length 1, max length 20) | Output: | Field | Type | Description | |---|---|---| | `component` | object | A component of the étude, in short. | | `component.completed_at` | string (date-time) \| null | When all four tabs were marked complete; null until then. ISO 8601 date-time, UTC. | | `component.completed_tabs` | array of string | Editor tabs marked complete: general (Description), specific (Constats), travaux, entretien. A complete tab no longer changes until reopened. | | `component.condition` | string \| null | General condition. One of the account's condition_states values (get_account_context); by default bon, passable, mauvais, non_visible when it could not be seen, na when outside the study's scope. | | `component.display_code` | string | The code as the report prints it: B2020, or B2020-1 for a sub-component. | | `component.element_name` | string \| null | The UNIFORMAT element's name. | | `component.id` | integer | The component's id (component_id in the other tools). (min 1) | | `component.is_subcomponent` | boolean | True for a sub-component added under a code (it can be deleted). | | `component.lifespan_years` | integer \| null | Retained useful life, in years. | | `component.selected_in_report` | boolean | True when the component is in the report's scope (see set_report_scope). | | `component.subcomponent_label` | string \| null | The sub-component's own label; null on the canonical component of the code. | | `component.subcomponent_number` | integer \| null | The sub-component's number under its code; null on the canonical component. | | `component.uniformat_code` | string | Its UNIFORMAT II code, e.g. B2020. | | `component.year_of_installation` | integer \| null | Year of installation. | Example arguments: ```json { "etude_id": 41, "label": "Fenêtres en PVC", "uniformat_code": "B2020" } ``` Example result: ```json { "component": { "completed_at": null, "completed_tabs": [], "condition": null, "display_code": "B2020-1", "element_name": "Fenêtres extérieures", "id": 1290, "is_subcomponent": true, "lifespan_years": null, "selected_in_report": true, "subcomponent_label": "Fenêtres en PVC", "subcomponent_number": 1, "uniformat_code": "B2020", "year_of_installation": null } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/etudes/41/components \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"label":"Fenêtres en PVC","uniformat_code":"B2020"}' ``` #### Delete a sub-component (`delete_subcomponent`) Deletes a sub-component of an étude (one added with add_subcomponent), with its constats, photos and measurements, and takes it out of the report's scope. Cannot be undone. The canonical component of a UNIFORMAT code cannot be deleted: take it out of the report with set_report_scope instead. Works and maintenance tasks tied to it are kept, no longer tied to a component (delete them with delete_task). - Group: Components - REST: `DELETE /api/v1/etudes/{etude_id}/components/{component_id}` - Scope: `etudes:delete` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422) Input: | Name | Type | Required | Description | |---|---|---|---| | `component_id` | integer | yes | The sub-component to delete (see list_components). (min 1) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | Output: | Field | Type | Description | |---|---|---| | `component_id` | integer | The deleted sub-component's id. (min 1) | | `deleted` | boolean | True when the sub-component was deleted. | Example arguments: ```json { "component_id": 1290, "etude_id": 41 } ``` Example result: ```json { "component_id": 1290, "deleted": true } ``` Over REST: ```sh curl -s -X DELETE https://carnetcopro.ca/api/v1/etudes/41/components/1290 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Add a measurement (`add_measurement`) Adds a row to a component's measurement takeoff (métré): a label, a count of identical elements and the width and height of one, in metres or feet. The Travaux tab's totals (area and perimeter) follow. Refused with conflict when the component's travaux tab is marked complete. Returns the new row; change it with update_measurement, remove it with delete_measurement. - Group: Components - REST: `POST /api/v1/etudes/{etude_id}/components/{component_id}/measurements` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `component_id` | integer | yes | The component measured (see list_components). (min 1) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `quantity` | integer | yes | How many identical elements. (min 0, max 1000000) | | `height` | number \| null | no | Height (or length) of one element, in unit. (min 0) | | `label` | string \| null | no | What is measured, e.g. « Fenêtre type A ». (max length 255) | | `position` | integer | no | Order among the component's rows. (min 0, max 10000) | | `unit` | string | no | Unit of width and height: m (metres) or ft (feet). One of: m, ft. | | `width` | number \| null | no | Width of one element, in unit. (min 0) | Output: | Field | Type | Description | |---|---|---| | `measurement` | object | A measurement takeoff (métré) row. | | `measurement.component_id` | integer | The component it belongs to. (min 1) | | `measurement.height` | number \| null | Height (or length) of one element, in unit. (min 0) | | `measurement.id` | integer | The measurement's id. (min 1) | | `measurement.label` | string \| null | What is measured, e.g. « Fenêtre type A ». (max length 255) | | `measurement.position` | integer | Order among the component's rows. | | `measurement.quantity` | integer | How many identical elements. | | `measurement.unit` | string | Unit of width and height: m (metres) or ft (feet). One of: m, ft. | | `measurement.width` | number \| null | Width of one element, in unit. (min 0) | Example arguments: ```json { "component_id": 812, "etude_id": 41, "height": 1.5, "label": "Fenêtre type A", "quantity": 24, "unit": "m", "width": 1.2 } ``` Example result: ```json { "measurement": { "component_id": 812, "height": 1.5, "id": 55, "label": "Fenêtre type A", "position": 0, "quantity": 24, "unit": "m", "width": 1.2 } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/etudes/41/components/812/measurements \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"height":1.5,"label":"Fenêtre type A","quantity":24,"unit":"m","width":1.2}' ``` #### Update a measurement (`update_measurement`) Changes one row of a component's measurement takeoff (métré): label, count, width, height, unit or position. Only the fields you send change. Refused with conflict when the component's travaux tab is marked complete. Find measurement ids with get_component. Does not move the row to another component; delete it and add_measurement there instead. - Group: Components - REST: `PATCH /api/v1/etudes/{etude_id}/measurements/{measurement_id}` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `measurement_id` | integer | yes | The measurement row (see get_component). (min 1) | | `height` | number \| null | no | Height (or length) of one element, in unit. (min 0) | | `label` | string \| null | no | What is measured, e.g. « Fenêtre type A ». (max length 255) | | `position` | integer | no | Order among the component's rows. (min 0, max 10000) | | `quantity` | integer | no | How many identical elements. (min 0, max 1000000) | | `unit` | string | no | Unit of width and height: m (metres) or ft (feet). One of: m, ft. | | `width` | number \| null | no | Width of one element, in unit. (min 0) | Output: | Field | Type | Description | |---|---|---| | `measurement` | object | A measurement takeoff (métré) row. | | `measurement.component_id` | integer | The component it belongs to. (min 1) | | `measurement.height` | number \| null | Height (or length) of one element, in unit. (min 0) | | `measurement.id` | integer | The measurement's id. (min 1) | | `measurement.label` | string \| null | What is measured, e.g. « Fenêtre type A ». (max length 255) | | `measurement.position` | integer | Order among the component's rows. | | `measurement.quantity` | integer | How many identical elements. | | `measurement.unit` | string | Unit of width and height: m (metres) or ft (feet). One of: m, ft. | | `measurement.width` | number \| null | Width of one element, in unit. (min 0) | Example arguments: ```json { "etude_id": 41, "measurement_id": 55, "quantity": 26 } ``` Example result: ```json { "measurement": { "component_id": 812, "height": 1.5, "id": 55, "label": "Fenêtre type A", "position": 0, "quantity": 26, "unit": "m", "width": 1.2 } } ``` Over REST: ```sh curl -s -X PATCH https://carnetcopro.ca/api/v1/etudes/41/measurements/55 \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"quantity":26}' ``` #### Delete a measurement (`delete_measurement`) Deletes one row of a component's measurement takeoff (métré); the totals follow. Cannot be undone. Refused with conflict when the component's travaux tab is marked complete. Find measurement ids with get_component. Does not touch the component's other rows or its works. - Group: Components - REST: `DELETE /api/v1/etudes/{etude_id}/measurements/{measurement_id}` - Scope: `etudes:delete` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `measurement_id` | integer | yes | The measurement row to delete (see get_component). (min 1) | Output: | Field | Type | Description | |---|---|---| | `deleted` | boolean | True when the row was deleted. | | `measurement_id` | integer | The deleted row's id. (min 1) | Example arguments: ```json { "etude_id": 41, "measurement_id": 55 } ``` Example result: ```json { "deleted": true, "measurement_id": 55 } ``` Over REST: ```sh curl -s -X DELETE https://carnetcopro.ca/api/v1/etudes/41/measurements/55 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Upload a component photo (`upload_component_photo`) Adds a photo to a component of an étude, either downloaded from an https url or sent as content_base64 with file_name and content_type. JPEG, PNG, WebP or HEIC, 10 MB at most (a base64 body is limited to about 6 MB: use url for larger files). Without deficiency_id it is a reference photo of the component (tab general by default); with deficiency_id it illustrates that constat. title is the legend printed under it. The file is stored in the firm's private storage. Refused with conflict when the tab is marked complete. Change the legend with set_photo_title. - Group: Components - REST: `POST /api/v1/etudes/{etude_id}/components/{component_id}/photos` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint true - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `component_id` | integer | yes | The component photographed (see list_components). (min 1) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `content_base64` | string | no | The image itself, base64-encoded. Send either url or content_base64. (max length 11000000) | | `content_type` | string | no | The image's type (required with content_base64). One of: image/jpeg, image/png, image/webp, image/heic. | | `deficiency_id` | integer | no | A constat of this component the photo illustrates (see get_component). (min 1) | | `file_name` | string | no | The file's name, e.g. toiture-nord.jpg (required with content_base64). (max length 255) | | `tab` | string | no | The editor tab the photo belongs to (default general, the reference photos). Ignored with deficiency_id. One of: general, specific, travaux, entretien. | | `title` | string | no | Legend printed under the photo. (max length 500) | | `url` | string | no | An https link to the image to download. Send either url or content_base64. (max length 2048) | Output: | Field | Type | Description | |---|---|---| | `photo` | object | A photo of a component. | | `photo.component_id` | integer | The component it belongs to. (min 1) | | `photo.content_type` | string \| null | MIME type, e.g. image/jpeg. | | `photo.deficiency_id` | integer \| null | The constat it illustrates; null for a photo of the component itself. (min 1) | | `photo.file_name` | string \| null | Original file name. | | `photo.file_size` | integer \| null | Size in bytes. | | `photo.id` | integer | The photo's id (photo_id in set_photo_title and delete_photo). (min 1) | | `photo.tab` | string \| null | The editor tab it was added on (general for the reference photos). | | `photo.title` | string \| null | Legend printed under the photo in the report. | | `photo.url` | string \| null | A signed link to the image, valid for about one hour; call again for a fresh one. | Example arguments: ```json { "component_id": 812, "etude_id": 41, "title": "Coupe-froid détaché, façade nord", "url": "https://photos.exemple.ca/visite/fenetre-nord.jpg" } ``` Example result: ```json { "photo": { "component_id": 812, "content_type": "image/jpeg", "deficiency_id": null, "file_name": "fenetre-nord.jpg", "file_size": 845211, "id": 3021, "tab": "general", "title": "Coupe-froid détaché, façade nord", "url": "https://stockage.exemple.ca/pro-documents/3/1761660000_fenetre-nord.jpg?X-Amz-Expires=3600" } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/etudes/41/components/812/photos \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"title":"Coupe-froid détaché, façade nord","url":"https://photos.exemple.ca/visite/fenetre-nord.jpg"}' ``` #### Set a photo's legend (`set_photo_title`) Sets the legend of a component's or a constat's photo: the line printed under it in the report. Send null or an empty string to remove it. Refused with conflict when the photo's editor tab is marked complete. Find photo ids with get_component. Does not replace the image itself; delete_photo then upload_component_photo for that. - Group: Components - REST: `PATCH /api/v1/etudes/{etude_id}/photos/{photo_id}` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `photo_id` | integer | yes | The photo (see get_component). (min 1) | | `title` | string \| null | yes | The legend; null or empty removes it. (max length 500) | Output: | Field | Type | Description | |---|---|---| | `photo` | object | A photo of a component. | | `photo.component_id` | integer | The component it belongs to. (min 1) | | `photo.content_type` | string \| null | MIME type, e.g. image/jpeg. | | `photo.deficiency_id` | integer \| null | The constat it illustrates; null for a photo of the component itself. (min 1) | | `photo.file_name` | string \| null | Original file name. | | `photo.file_size` | integer \| null | Size in bytes. | | `photo.id` | integer | The photo's id (photo_id in set_photo_title and delete_photo). (min 1) | | `photo.tab` | string \| null | The editor tab it was added on (general for the reference photos). | | `photo.title` | string \| null | Legend printed under the photo in the report. | | `photo.url` | string \| null | A signed link to the image, valid for about one hour; call again for a fresh one. | Example arguments: ```json { "etude_id": 41, "photo_id": 3021, "title": "Coupe-froid détaché" } ``` Example result: ```json { "photo": { "component_id": 812, "content_type": "image/jpeg", "deficiency_id": null, "file_name": "fenetre-nord.jpg", "file_size": 845211, "id": 3021, "tab": "general", "title": "Coupe-froid détaché", "url": null } } ``` Over REST: ```sh curl -s -X PATCH https://carnetcopro.ca/api/v1/etudes/41/photos/3021 \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"title":"Coupe-froid détaché"}' ``` #### Delete a photo (`delete_photo`) Deletes a photo of a component or of a constat, with its stored file. Cannot be undone. Refused with conflict when the photo's editor tab is marked complete. Find photo ids with get_component. Does not delete the constat it illustrates (delete_deficiency) nor the component's other photos. - Group: Components - REST: `DELETE /api/v1/etudes/{etude_id}/photos/{photo_id}` - Scope: `etudes:delete` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `photo_id` | integer | yes | The photo to delete (see get_component). (min 1) | Output: | Field | Type | Description | |---|---|---| | `deleted` | boolean | True when the photo was deleted. | | `photo_id` | integer | The deleted photo's id. (min 1) | Example arguments: ```json { "etude_id": 41, "photo_id": 3021 } ``` Example result: ```json { "deleted": true, "photo_id": 3021 } ``` Over REST: ```sh curl -s -X DELETE https://carnetcopro.ca/api/v1/etudes/41/photos/3021 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` ### Constats (deficiencies) #### List constats (`list_deficiencies`) Lists the constats (deficiencies observed on site) of a whole étude, in component order, each with its component, title, HTML description, état and label, whether it is in the report, the copropriété horizontale flag and its photos (signed links valid about one hour). Filter by state, component_id or include_in_report. Paginated: pass next_cursor back as cursor. For one component's constats with its other details, use get_component. Read-only. - Group: Constats (deficiencies) - REST: `GET /api/v1/etudes/{etude_id}/deficiencies` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `component_id` | integer | no | Only the constats of this component (see list_components). (min 1) | | `cursor` | string | no | The next_cursor of a previous call, to get the next page. | | `include_in_report` | boolean | no | true: only constats printed in the report; false: only those left out. | | `limit` | integer | no | How many results to return (default 50). (min 1, max 200) | | `state` | string | no | Only constats in this état (see get_account_context for the states). (max length 60) | Output: | Field | Type | Description | |---|---|---| | `deficiencies` | array of object | The constats. | | `deficiencies[].component_display_code` | string | The component's code as printed, e.g. B2020-1. | | `deficiencies[].component_id` | integer | The component it is on. (min 1) | | `deficiencies[].component_name` | string \| null | The component's label or element name. | | `deficiencies[].copropriete_horizontale` | boolean | True when the constat concerns a horizontal co-ownership (copropriété horizontale). | | `deficiencies[].created_at` | string (date-time) \| null | When it was recorded. ISO 8601 date-time, UTC. | | `deficiencies[].description` | string \| null | The constat's text, HTML; null when it has none. | | `deficiencies[].id` | integer | The constat's id (deficiency_id in the other tools). (min 1) | | `deficiencies[].include_in_report` | boolean | False when the constat is kept out of the report. | | `deficiencies[].photos` | array of object | Photos illustrating the constat. | | `deficiencies[].photos[].component_id` | integer | The component it belongs to. (min 1) | | `deficiencies[].photos[].content_type` | string \| null | MIME type, e.g. image/jpeg. | | `deficiencies[].photos[].deficiency_id` | integer \| null | The constat it illustrates; null for a photo of the component itself. (min 1) | | `deficiencies[].photos[].file_name` | string \| null | Original file name. | | `deficiencies[].photos[].file_size` | integer \| null | Size in bytes. | | `deficiencies[].photos[].id` | integer | The photo's id (photo_id in set_photo_title and delete_photo). (min 1) | | `deficiencies[].photos[].tab` | string \| null | The editor tab it was added on (general for the reference photos). | | `deficiencies[].photos[].title` | string \| null | Legend printed under the photo in the report. | | `deficiencies[].photos[].url` | string \| null | A signed link to the image, valid for about one hour; call again for a fresh one. | | `deficiencies[].state` | string | Its état, one of the account's constat states (see get_account_context). | | `deficiencies[].state_label` | string | The état's label as the report prints it. | | `deficiencies[].title` | string | The constat's title (its first line). | | `next_cursor` | string \| null | Pass it as cursor to get the next page; null on the last page. | Example arguments: ```json { "etude_id": 41, "state": "a_corriger" } ``` Example result: ```json { "deficiencies": [ { "component_display_code": "B2020", "component_id": 812, "component_name": "Fenêtres extérieures", "copropriete_horizontale": false, "created_at": "2026-10-02T15:12:40Z", "description": "

Plusieurs coupe-froid détachés sur la façade nord.

", "id": 977, "include_in_report": true, "photos": [], "state": "a_corriger", "state_label": "À corriger immédiatement", "title": "Coupe-froid détachés" } ], "next_cursor": null } ``` Over REST: ```sh curl -s "https://carnetcopro.ca/api/v1/etudes/41/deficiencies?state=a_corriger" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Add a constat (`add_deficiency`) Records a constat (a deficiency observed on site) on a component of an étude: a one-line title, an optional HTML or plain-text description, its état from the account's constat states (get_account_context), whether it is printed in the report and the copropriété horizontale flag. Refused with conflict when the component's Constats tab (specific) is marked complete. Add photos to it with upload_component_photo (deficiency_id). Does not change the component's general condition (update_component). - Group: Constats (deficiencies) - REST: `POST /api/v1/etudes/{etude_id}/components/{component_id}/deficiencies` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `component_id` | integer | yes | The component the constat is on (see list_components). (min 1) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `title` | string | yes | The constat's title, one line. (min length 1, max length 500) | | `copropriete_horizontale` | boolean | no | True when the constat concerns a horizontal co-ownership (copropriété horizontale); default false. | | `description` | string \| null | no | The constat's text, HTML or plain text, printed in the report. (max length 50000) | | `include_in_report` | boolean | no | False keeps the constat out of the report (default true). | | `state` | string | no | Its état: one of the account's constat states, e.g. a_surveiller (see get_account_context). The account's first state when omitted on creation. (max length 60) | Output: | Field | Type | Description | |---|---|---| | `deficiency` | object | A constat (deficiency) on a component. | | `deficiency.component_display_code` | string | The component's code as printed, e.g. B2020-1. | | `deficiency.component_id` | integer | The component it is on. (min 1) | | `deficiency.component_name` | string \| null | The component's label or element name. | | `deficiency.copropriete_horizontale` | boolean | True when the constat concerns a horizontal co-ownership (copropriété horizontale). | | `deficiency.created_at` | string (date-time) \| null | When it was recorded. ISO 8601 date-time, UTC. | | `deficiency.description` | string \| null | The constat's text, HTML; null when it has none. | | `deficiency.id` | integer | The constat's id (deficiency_id in the other tools). (min 1) | | `deficiency.include_in_report` | boolean | False when the constat is kept out of the report. | | `deficiency.photos` | array of object | Photos illustrating the constat. | | `deficiency.photos[].component_id` | integer | The component it belongs to. (min 1) | | `deficiency.photos[].content_type` | string \| null | MIME type, e.g. image/jpeg. | | `deficiency.photos[].deficiency_id` | integer \| null | The constat it illustrates; null for a photo of the component itself. (min 1) | | `deficiency.photos[].file_name` | string \| null | Original file name. | | `deficiency.photos[].file_size` | integer \| null | Size in bytes. | | `deficiency.photos[].id` | integer | The photo's id (photo_id in set_photo_title and delete_photo). (min 1) | | `deficiency.photos[].tab` | string \| null | The editor tab it was added on (general for the reference photos). | | `deficiency.photos[].title` | string \| null | Legend printed under the photo in the report. | | `deficiency.photos[].url` | string \| null | A signed link to the image, valid for about one hour; call again for a fresh one. | | `deficiency.state` | string | Its état, one of the account's constat states (see get_account_context). | | `deficiency.state_label` | string | The état's label as the report prints it. | | `deficiency.title` | string | The constat's title (its first line). | Example arguments: ```json { "component_id": 812, "description": "

Plusieurs coupe-froid détachés sur la façade nord.

", "etude_id": 41, "state": "a_corriger", "title": "Coupe-froid détachés" } ``` Example result: ```json { "deficiency": { "component_display_code": "B2020", "component_id": 812, "component_name": "Fenêtres extérieures", "copropriete_horizontale": false, "created_at": "2026-10-28T14:03:11Z", "description": "

Plusieurs coupe-froid détachés sur la façade nord.

", "id": 977, "include_in_report": true, "photos": [], "state": "a_corriger", "state_label": "À corriger immédiatement", "title": "Coupe-froid détachés" } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/etudes/41/components/812/deficiencies \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"description":"

Plusieurs coupe-froid détachés sur la façade nord.

","state":"a_corriger","title":"Coupe-froid détachés"}' ``` #### Update a constat (`update_deficiency`) Changes a constat of an étude: its title, description, état (one of the account's constat states, see get_account_context), whether it is printed in the report, or the copropriété horizontale flag. Only the fields you send change; send description null to remove it. Refused with conflict when its component's Constats tab (specific) is marked complete. Find constat ids with list_deficiencies. Does not move it to another component, nor change its photos (set_photo_title, delete_photo). - Group: Constats (deficiencies) - REST: `PATCH /api/v1/etudes/{etude_id}/deficiencies/{deficiency_id}` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `deficiency_id` | integer | yes | The constat to change (see list_deficiencies). (min 1) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `copropriete_horizontale` | boolean | no | True when the constat concerns a horizontal co-ownership (copropriété horizontale); default false. | | `description` | string \| null | no | The constat's text, HTML or plain text, printed in the report. (max length 50000) | | `include_in_report` | boolean | no | False keeps the constat out of the report (default true). | | `state` | string | no | Its état: one of the account's constat states, e.g. a_surveiller (see get_account_context). The account's first state when omitted on creation. (max length 60) | | `title` | string | no | The constat's title, one line. (min length 1, max length 500) | Output: | Field | Type | Description | |---|---|---| | `deficiency` | object | A constat (deficiency) on a component. | | `deficiency.component_display_code` | string | The component's code as printed, e.g. B2020-1. | | `deficiency.component_id` | integer | The component it is on. (min 1) | | `deficiency.component_name` | string \| null | The component's label or element name. | | `deficiency.copropriete_horizontale` | boolean | True when the constat concerns a horizontal co-ownership (copropriété horizontale). | | `deficiency.created_at` | string (date-time) \| null | When it was recorded. ISO 8601 date-time, UTC. | | `deficiency.description` | string \| null | The constat's text, HTML; null when it has none. | | `deficiency.id` | integer | The constat's id (deficiency_id in the other tools). (min 1) | | `deficiency.include_in_report` | boolean | False when the constat is kept out of the report. | | `deficiency.photos` | array of object | Photos illustrating the constat. | | `deficiency.photos[].component_id` | integer | The component it belongs to. (min 1) | | `deficiency.photos[].content_type` | string \| null | MIME type, e.g. image/jpeg. | | `deficiency.photos[].deficiency_id` | integer \| null | The constat it illustrates; null for a photo of the component itself. (min 1) | | `deficiency.photos[].file_name` | string \| null | Original file name. | | `deficiency.photos[].file_size` | integer \| null | Size in bytes. | | `deficiency.photos[].id` | integer | The photo's id (photo_id in set_photo_title and delete_photo). (min 1) | | `deficiency.photos[].tab` | string \| null | The editor tab it was added on (general for the reference photos). | | `deficiency.photos[].title` | string \| null | Legend printed under the photo in the report. | | `deficiency.photos[].url` | string \| null | A signed link to the image, valid for about one hour; call again for a fresh one. | | `deficiency.state` | string | Its état, one of the account's constat states (see get_account_context). | | `deficiency.state_label` | string | The état's label as the report prints it. | | `deficiency.title` | string | The constat's title (its first line). | Example arguments: ```json { "deficiency_id": 977, "etude_id": 41, "state": "a_surveiller" } ``` Example result: ```json { "deficiency": { "id": 977, "state": "a_surveiller", "state_label": "À surveiller", "title": "Coupe-froid détachés" } } ``` Over REST: ```sh curl -s -X PATCH https://carnetcopro.ca/api/v1/etudes/41/deficiencies/977 \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"state":"a_surveiller"}' ``` #### Delete a constat (`delete_deficiency`) Deletes a constat of an étude, with the photos attached to it. Cannot be undone. To keep it but leave it out of the report, use update_deficiency with include_in_report false instead. Refused with conflict when its component's Constats tab (specific) is marked complete. Find constat ids with list_deficiencies. - Group: Constats (deficiencies) - REST: `DELETE /api/v1/etudes/{etude_id}/deficiencies/{deficiency_id}` - Scope: `etudes:delete` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `deficiency_id` | integer | yes | The constat to delete (see list_deficiencies). (min 1) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | Output: | Field | Type | Description | |---|---|---| | `deficiency_id` | integer | The deleted constat's id. (min 1) | | `deleted` | boolean | True when the constat was deleted. | Example arguments: ```json { "deficiency_id": 977, "etude_id": 41 } ``` Example result: ```json { "deficiency_id": 977, "deleted": true } ``` Over REST: ```sh curl -s -X DELETE https://carnetcopro.ca/api/v1/etudes/41/deficiencies/977 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` ### Works and maintenance #### List works and maintenance (`list_tasks`) Lists the works (travaux: repairs and replacements) and maintenance tasks (entretiens) of an étude, oldest first, each with its component, code, intervention type, estimated cost, planned year and frequency. Filter by task_type, uniformat_code prefix or component_id. Paginated: pass next_cursor back as cursor. Use get_task for a task's description, cost lines and maintenance steps. Read-only; scheduling in financing scenarios is not shown here. - Group: Works and maintenance - REST: `GET /api/v1/etudes/{etude_id}/tasks` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `component_id` | integer | no | Only tasks tied to this component (see list_components). (min 1) | | `cursor` | string | no | The next_cursor of a previous call, to get the next page. | | `limit` | integer | no | How many results to return (default 50). (min 1, max 200) | | `task_type` | string | no | Only travaux (works) or only entretien (maintenance). One of: travaux, entretien. | | `uniformat_code` | string | no | Only tasks whose code starts with this, e.g. B30. (max length 20) | Output: | Field | Type | Description | |---|---|---| | `next_cursor` | string \| null | Pass it as cursor to get the next page; null on the last page. | | `tasks` | array of object | The tasks, oldest first. | | `tasks[].component_id` | integer \| null | The component it is tied to, if any. (min 1) | | `tasks[].display_code` | string \| null | The code as the report prints it (B2020-1 for a sub-component). | | `tasks[].estimated_cost` | number \| null | Estimated cost. In CAD. (min 0) | | `tasks[].estimated_year` | integer \| null | Year the work is planned (travaux). | | `tasks[].frequency` | string \| null | Maintenance frequency (entretien), e.g. annuelle. | | `tasks[].id` | integer | The task's id (task_id in the other tools). (min 1) | | `tasks[].intervention_type` | string \| null | What a travaux does to its component: major_repair, replacement, or a provision for either. Null for an entretien. One of: major_repair, replacement, major_repair_provision, replacement_provision. | | `tasks[].task_type` | string | travaux (a work: repair or replacement) or entretien (maintenance). One of: travaux, entretien. | | `tasks[].title` | string | Title of the task. | | `tasks[].uniformat_code` | string \| null | UNIFORMAT II code of its component. | Example arguments: ```json { "etude_id": 41, "task_type": "travaux" } ``` Example result: ```json { "next_cursor": null, "tasks": [ { "component_id": 812, "display_code": "B2020", "estimated_cost": 8.64e4, "estimated_year": 2034, "frequency": null, "id": 530, "intervention_type": "replacement", "task_type": "travaux", "title": "Remplacement des fenêtres", "uniformat_code": "B2020" } ] } ``` Over REST: ```sh curl -s "https://carnetcopro.ca/api/v1/etudes/41/tasks?task_type=travaux" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Get a work or maintenance task (`get_task`) Returns one work (travaux) or maintenance task (entretien) of an étude in full: title, description, the firm's private note (never printed), component, intervention type, cost and its cost lines, taxes, planned year, lifespan and recurrence, frequency and recommended months, responsibility, the restricted-use group paying for it and its named maintenance steps. Use list_tasks to find task ids. Read-only. - Group: Works and maintenance - REST: `GET /api/v1/etudes/{etude_id}/tasks/{task_id}` - Scope: `etudes:read` - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `task_id` | integer | yes | The task (see list_tasks). (min 1) | Output: | Field | Type | Description | |---|---|---| | `task` | object | A work or maintenance task, in full. | | `task.component_id` | integer \| null | The component it is tied to, if any. (min 1) | | `task.created_at` | string (date-time) \| null | When it was created. ISO 8601 date-time, UTC. | | `task.description` | string \| null | Description printed in the report (HTML or plain text). (max length 50000) | | `task.display_code` | string \| null | The code as the report prints it (B2020-1 for a sub-component). | | `task.estimated_cost` | number \| null | Estimated cost; computed from line_items when they are sent. In CAD. (min 0) | | `task.estimated_year` | integer \| null | Year the work is planned (travaux); places it in the financing scenarios. (min 1900, max 2200) | | `task.frequency` | string \| null | Maintenance frequency (entretien), e.g. annuelle. | | `task.id` | integer | The task's id (task_id in the other tools). (min 1) | | `task.intervention_type` | string \| null | What a travaux does to its component: major_repair, replacement, or a provision for either. Null for an entretien. One of: major_repair, replacement, major_repair_provision, replacement_provision. | | `task.is_one_time` | boolean | True for a one-off work; false (default) when it recurs after its lifespan. | | `task.lifespan_years` | integer \| null | Useful life after the work, in years. (min 0, max 200) | | `task.line_items` | array of object | Cost lines. | | `task.line_items[].description` | string \| null | What the line covers. | | `task.line_items[].id` | integer | The line's id. (min 1) | | `task.line_items[].price_id` | integer \| null | The catalogue price it came from. (min 1) | | `task.line_items[].price_overridden` | boolean | True when it keeps its own unit price. | | `task.line_items[].quantity` | number \| null | Quantity. | | `task.line_items[].subtotal` | number \| null | Unit price times quantity. In CAD. (min 0) | | `task.line_items[].unit_price` | number \| null | Unit price. In CAD. (min 0) | | `task.maintenance_steps` | array of object | Named steps of a maintenance intervention. | | `task.maintenance_steps[].description` | string \| null | What the step involves. | | `task.maintenance_steps[].id` | integer | The step's id. (min 1) | | `task.maintenance_steps[].label` | string | Name of the step, e.g. Inspection visuelle. | | `task.maintenance_steps[].position` | integer | Order of the step. | | `task.next_due_year` | integer \| null | Next due year of the maintenance. (min 1900, max 2200) | | `task.priority` | string \| null | Priority. (max length 50) | | `task.private_note` | string \| null | The firm's private note on the task: shown in the app only, in no report. (max length 20000) | | `task.recommended_months` | array of integer | Months the maintenance should be done (1-12). | | `task.recurrence_years` | integer \| null | Years between occurrences; the lifespan when null. (min 1, max 200) | | `task.responsibility` | string \| null | Who carries out the maintenance. | | `task.restricted_group_id` | integer \| null | The restricted-use group that pays for the work, when not the whole building. (min 1) | | `task.status` | string \| null | Status of the task (open by default). | | `task.task_type` | string | travaux (a work: repair or replacement) or entretien (maintenance). One of: travaux, entretien. | | `task.taxes_included` | boolean | True (default) when estimated_cost includes sales taxes; false to add them. | | `task.title` | string | Title of the task. | | `task.uniformat_code` | string \| null | UNIFORMAT II code of its component. | | `task.updated_at` | string (date-time) \| null | Last change. ISO 8601 date-time, UTC. | Example arguments: ```json { "etude_id": 41, "task_id": 530 } ``` Example result: ```json { "task": { "component_id": 812, "estimated_cost": 8.64e4, "estimated_year": 2034, "id": 530, "intervention_type": "replacement", "line_items": [ { "description": "Fenêtre PVC à battant", "id": 77, "price_id": 14, "price_overridden": false, "quantity": 24.0, "subtotal": 8.64e4, "unit_price": 3.6e3 } ], "maintenance_steps": [], "task_type": "travaux", "title": "Remplacement des fenêtres" } } ``` Over REST: ```sh curl -s https://carnetcopro.ca/api/v1/etudes/41/tasks/530 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Create a work or maintenance task (`create_task`) Creates a work (task_type travaux: repair, replacement or provision) or a maintenance task (entretien) in an étude, usually tied to a component. A travaux takes an intervention type (replacement by default), a planned year, lifespan and recurrence, and a cost: estimated_cost, or cost lines (line_items) whose subtotals make it. With a planned year, a travaux is placed in the financing scenarios that pay for it. An entretien takes a frequency and recommended months. Refused with conflict when the component's matching tab is marked complete. Returns the new task. - Group: Works and maintenance - REST: `POST /api/v1/etudes/{etude_id}/tasks` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `task_type` | string | yes | travaux (a work: repair, replacement) or entretien (maintenance). One of: travaux, entretien. | | `title` | string | yes | Title of the task. (min length 1, max length 255) | | `component_id` | integer \| null | no | The component it is tied to (see list_components); sets its uniformat_code. (min 1) | | `description` | string \| null | no | Description printed in the report (HTML or plain text). (max length 50000) | | `estimated_cost` | number \| null | no | Estimated cost; computed from line_items when they are sent. In CAD. (min 0) | | `estimated_year` | integer \| null | no | Year the work is planned (travaux); places it in the financing scenarios. (min 1900, max 2200) | | `frequency` | string \| null | no | Maintenance frequency (entretien): semi_annuelle, annuelle, biannuelle (every 2 years), 5_ans, 10_ans, 15_ans, 20_ans or au_besoin (as needed). One of: semi_annuelle, annuelle, biannuelle, 5_ans, 10_ans, 15_ans, 20_ans, au_besoin. | | `intervention_type` | string \| null | no | What a travaux does to its component: major_repair, replacement, or a provision for either. Null for an entretien. One of: major_repair, replacement, major_repair_provision, replacement_provision. | | `is_one_time` | boolean | no | True for a one-off work; false (default) when it recurs after its lifespan. | | `lifespan_years` | integer \| null | no | Useful life after the work, in years. (min 0, max 200) | | `line_items` | array of object | no | Cost lines of a travaux; their subtotals make estimated_cost. (max items 100) | | `line_items[].quantity` | number | yes | Quantity. (min 0) | | `line_items[].description` | string \| null | no | What the line covers. (max length 500) | | `line_items[].price_id` | integer \| null | no | A price from the account's catalogue (see list_prices); gives the unit price when unit_price is omitted. (min 1) | | `line_items[].price_overridden` | boolean | no | True when the line keeps its own unit price instead of the catalogue's. | | `line_items[].unit_price` | number \| null | no | Unit price. In CAD. (min 0) | | `next_due_year` | integer \| null | no | Next due year of the maintenance. (min 1900, max 2200) | | `priority` | string \| null | no | Priority. (max length 50) | | `private_note` | string \| null | no | The firm's private note on the task: shown in the app only, in no report. (max length 20000) | | `recommended_months` | array of integer | no | Months the maintenance should be done (1-12). (max items 12) | | `recurrence_years` | integer \| null | no | Years between occurrences; the lifespan when null. (min 1, max 200) | | `responsibility` | string | no | Who carries out the maintenance: syndicat (default), coproprietaire (each co-owner) or shared. One of: syndicat, coproprietaire, shared. | | `taxes_included` | boolean | no | True (default) when estimated_cost includes sales taxes; false to add them. | | `uniformat_code` | string \| null | no | UNIFORMAT II code, when the task is tied to no component. (max length 20) | Output: | Field | Type | Description | |---|---|---| | `task` | object | A work or maintenance task, in full. | | `task.component_id` | integer \| null | The component it is tied to, if any. (min 1) | | `task.created_at` | string (date-time) \| null | When it was created. ISO 8601 date-time, UTC. | | `task.description` | string \| null | Description printed in the report (HTML or plain text). (max length 50000) | | `task.display_code` | string \| null | The code as the report prints it (B2020-1 for a sub-component). | | `task.estimated_cost` | number \| null | Estimated cost; computed from line_items when they are sent. In CAD. (min 0) | | `task.estimated_year` | integer \| null | Year the work is planned (travaux); places it in the financing scenarios. (min 1900, max 2200) | | `task.frequency` | string \| null | Maintenance frequency (entretien), e.g. annuelle. | | `task.id` | integer | The task's id (task_id in the other tools). (min 1) | | `task.intervention_type` | string \| null | What a travaux does to its component: major_repair, replacement, or a provision for either. Null for an entretien. One of: major_repair, replacement, major_repair_provision, replacement_provision. | | `task.is_one_time` | boolean | True for a one-off work; false (default) when it recurs after its lifespan. | | `task.lifespan_years` | integer \| null | Useful life after the work, in years. (min 0, max 200) | | `task.line_items` | array of object | Cost lines. | | `task.line_items[].description` | string \| null | What the line covers. | | `task.line_items[].id` | integer | The line's id. (min 1) | | `task.line_items[].price_id` | integer \| null | The catalogue price it came from. (min 1) | | `task.line_items[].price_overridden` | boolean | True when it keeps its own unit price. | | `task.line_items[].quantity` | number \| null | Quantity. | | `task.line_items[].subtotal` | number \| null | Unit price times quantity. In CAD. (min 0) | | `task.line_items[].unit_price` | number \| null | Unit price. In CAD. (min 0) | | `task.maintenance_steps` | array of object | Named steps of a maintenance intervention. | | `task.maintenance_steps[].description` | string \| null | What the step involves. | | `task.maintenance_steps[].id` | integer | The step's id. (min 1) | | `task.maintenance_steps[].label` | string | Name of the step, e.g. Inspection visuelle. | | `task.maintenance_steps[].position` | integer | Order of the step. | | `task.next_due_year` | integer \| null | Next due year of the maintenance. (min 1900, max 2200) | | `task.priority` | string \| null | Priority. (max length 50) | | `task.private_note` | string \| null | The firm's private note on the task: shown in the app only, in no report. (max length 20000) | | `task.recommended_months` | array of integer | Months the maintenance should be done (1-12). | | `task.recurrence_years` | integer \| null | Years between occurrences; the lifespan when null. (min 1, max 200) | | `task.responsibility` | string \| null | Who carries out the maintenance. | | `task.restricted_group_id` | integer \| null | The restricted-use group that pays for the work, when not the whole building. (min 1) | | `task.status` | string \| null | Status of the task (open by default). | | `task.task_type` | string | travaux (a work: repair or replacement) or entretien (maintenance). One of: travaux, entretien. | | `task.taxes_included` | boolean | True (default) when estimated_cost includes sales taxes; false to add them. | | `task.title` | string | Title of the task. | | `task.uniformat_code` | string \| null | UNIFORMAT II code of its component. | | `task.updated_at` | string (date-time) \| null | Last change. ISO 8601 date-time, UTC. | Example arguments: ```json { "component_id": 812, "estimated_year": 2034, "etude_id": 41, "intervention_type": "replacement", "lifespan_years": 30, "line_items": [ { "description": "Fenêtre PVC à battant", "quantity": 24, "unit_price": 3.6e3 } ], "task_type": "travaux", "title": "Remplacement des fenêtres" } ``` Example result: ```json { "task": { "component_id": 812, "estimated_cost": 8.64e4, "estimated_year": 2034, "id": 530, "task_type": "travaux", "title": "Remplacement des fenêtres" } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/etudes/41/tasks \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"component_id":812,"estimated_year":2034,"intervention_type":"replacement","lifespan_years":30,"line_items":[{"description":"Fenêtre PVC à battant","quantity":24,"unit_price":3.6e3}],"task_type":"travaux","title":"Remplacement des fenêtres"}' ``` #### Update a work or maintenance task (`update_task`) Changes a work (travaux) or maintenance task (entretien) of an étude: title, description, private note, component, intervention type, cost, taxes, planned year, lifespan, recurrence, frequency, recommended months, responsibility. Only the fields you send change. line_items, when sent, replace the whole list of cost lines and the cost becomes their sum; an empty list removes them. A travaux with a planned year moves in the financing scenarios. Refused with conflict when the component's matching tab is marked complete. Does not change the task type: delete_task and create_task for that. - Group: Works and maintenance - REST: `PATCH /api/v1/etudes/{etude_id}/tasks/{task_id}` - Scope: `etudes:write` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `task_id` | integer | yes | The task to change (see list_tasks). (min 1) | | `component_id` | integer \| null | no | The component it is tied to (see list_components); sets its uniformat_code. (min 1) | | `description` | string \| null | no | Description printed in the report (HTML or plain text). (max length 50000) | | `estimated_cost` | number \| null | no | Estimated cost; computed from line_items when they are sent. In CAD. (min 0) | | `estimated_year` | integer \| null | no | Year the work is planned (travaux); places it in the financing scenarios. (min 1900, max 2200) | | `frequency` | string \| null | no | Maintenance frequency (entretien): semi_annuelle, annuelle, biannuelle (every 2 years), 5_ans, 10_ans, 15_ans, 20_ans or au_besoin (as needed). One of: semi_annuelle, annuelle, biannuelle, 5_ans, 10_ans, 15_ans, 20_ans, au_besoin. | | `intervention_type` | string \| null | no | What a travaux does to its component: major_repair, replacement, or a provision for either. Null for an entretien. One of: major_repair, replacement, major_repair_provision, replacement_provision. | | `is_one_time` | boolean | no | True for a one-off work; false (default) when it recurs after its lifespan. | | `lifespan_years` | integer \| null | no | Useful life after the work, in years. (min 0, max 200) | | `line_items` | array of object | no | Cost lines of a travaux; their subtotals make estimated_cost. (max items 100) | | `line_items[].quantity` | number | yes | Quantity. (min 0) | | `line_items[].description` | string \| null | no | What the line covers. (max length 500) | | `line_items[].price_id` | integer \| null | no | A price from the account's catalogue (see list_prices); gives the unit price when unit_price is omitted. (min 1) | | `line_items[].price_overridden` | boolean | no | True when the line keeps its own unit price instead of the catalogue's. | | `line_items[].unit_price` | number \| null | no | Unit price. In CAD. (min 0) | | `next_due_year` | integer \| null | no | Next due year of the maintenance. (min 1900, max 2200) | | `priority` | string \| null | no | Priority. (max length 50) | | `private_note` | string \| null | no | The firm's private note on the task: shown in the app only, in no report. (max length 20000) | | `recommended_months` | array of integer | no | Months the maintenance should be done (1-12). (max items 12) | | `recurrence_years` | integer \| null | no | Years between occurrences; the lifespan when null. (min 1, max 200) | | `responsibility` | string | no | Who carries out the maintenance: syndicat (default), coproprietaire (each co-owner) or shared. One of: syndicat, coproprietaire, shared. | | `taxes_included` | boolean | no | True (default) when estimated_cost includes sales taxes; false to add them. | | `title` | string | no | Title of the task. (min length 1, max length 255) | | `uniformat_code` | string \| null | no | UNIFORMAT II code, when the task is tied to no component. (max length 20) | Output: | Field | Type | Description | |---|---|---| | `task` | object | A work or maintenance task, in full. | | `task.component_id` | integer \| null | The component it is tied to, if any. (min 1) | | `task.created_at` | string (date-time) \| null | When it was created. ISO 8601 date-time, UTC. | | `task.description` | string \| null | Description printed in the report (HTML or plain text). (max length 50000) | | `task.display_code` | string \| null | The code as the report prints it (B2020-1 for a sub-component). | | `task.estimated_cost` | number \| null | Estimated cost; computed from line_items when they are sent. In CAD. (min 0) | | `task.estimated_year` | integer \| null | Year the work is planned (travaux); places it in the financing scenarios. (min 1900, max 2200) | | `task.frequency` | string \| null | Maintenance frequency (entretien), e.g. annuelle. | | `task.id` | integer | The task's id (task_id in the other tools). (min 1) | | `task.intervention_type` | string \| null | What a travaux does to its component: major_repair, replacement, or a provision for either. Null for an entretien. One of: major_repair, replacement, major_repair_provision, replacement_provision. | | `task.is_one_time` | boolean | True for a one-off work; false (default) when it recurs after its lifespan. | | `task.lifespan_years` | integer \| null | Useful life after the work, in years. (min 0, max 200) | | `task.line_items` | array of object | Cost lines. | | `task.line_items[].description` | string \| null | What the line covers. | | `task.line_items[].id` | integer | The line's id. (min 1) | | `task.line_items[].price_id` | integer \| null | The catalogue price it came from. (min 1) | | `task.line_items[].price_overridden` | boolean | True when it keeps its own unit price. | | `task.line_items[].quantity` | number \| null | Quantity. | | `task.line_items[].subtotal` | number \| null | Unit price times quantity. In CAD. (min 0) | | `task.line_items[].unit_price` | number \| null | Unit price. In CAD. (min 0) | | `task.maintenance_steps` | array of object | Named steps of a maintenance intervention. | | `task.maintenance_steps[].description` | string \| null | What the step involves. | | `task.maintenance_steps[].id` | integer | The step's id. (min 1) | | `task.maintenance_steps[].label` | string | Name of the step, e.g. Inspection visuelle. | | `task.maintenance_steps[].position` | integer | Order of the step. | | `task.next_due_year` | integer \| null | Next due year of the maintenance. (min 1900, max 2200) | | `task.priority` | string \| null | Priority. (max length 50) | | `task.private_note` | string \| null | The firm's private note on the task: shown in the app only, in no report. (max length 20000) | | `task.recommended_months` | array of integer | Months the maintenance should be done (1-12). | | `task.recurrence_years` | integer \| null | Years between occurrences; the lifespan when null. (min 1, max 200) | | `task.responsibility` | string \| null | Who carries out the maintenance. | | `task.restricted_group_id` | integer \| null | The restricted-use group that pays for the work, when not the whole building. (min 1) | | `task.status` | string \| null | Status of the task (open by default). | | `task.task_type` | string | travaux (a work: repair or replacement) or entretien (maintenance). One of: travaux, entretien. | | `task.taxes_included` | boolean | True (default) when estimated_cost includes sales taxes; false to add them. | | `task.title` | string | Title of the task. | | `task.uniformat_code` | string \| null | UNIFORMAT II code of its component. | | `task.updated_at` | string (date-time) \| null | Last change. ISO 8601 date-time, UTC. | Example arguments: ```json { "estimated_year": 2033, "etude_id": 41, "task_id": 530 } ``` Example result: ```json { "task": { "estimated_year": 2033, "id": 530, "task_type": "travaux", "title": "Remplacement des fenêtres" } } ``` Over REST: ```sh curl -s -X PATCH https://carnetcopro.ca/api/v1/etudes/41/tasks/530 \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"estimated_year":2033}' ``` #### Delete a work or maintenance task (`delete_task`) Deletes a work (travaux) or maintenance task (entretien) of an étude, with its cost lines and maintenance steps; a work leaves the financing scenarios it was scheduled in. Cannot be undone. Refused with conflict when its component's travaux or entretien tab is marked complete. Find task ids with list_tasks. Does not touch the component itself. - Group: Works and maintenance - REST: `DELETE /api/v1/etudes/{etude_id}/tasks/{task_id}` - Scope: `etudes:delete` - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403), `conflict` (409) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `task_id` | integer | yes | The task to delete (see list_tasks). (min 1) | Output: | Field | Type | Description | |---|---|---| | `deleted` | boolean | True when the task was deleted. | | `task_id` | integer | The deleted task's id. (min 1) | Example arguments: ```json { "etude_id": 41, "task_id": 530 } ``` Example result: ```json { "deleted": true, "task_id": 530 } ``` Over REST: ```sh curl -s -X DELETE https://carnetcopro.ca/api/v1/etudes/41/tasks/530 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` ### Restricted-use groups #### List restricted-use groups (`list_groups`) Lists the restricted-use groups of an étude, in report order: the co-owners who alone bear the major repairs of one restricted-use common portion under a clause of the declaration (e.g. rooftop terraces of units 601-604). Each group comes with its units, allocation method, starting balance, the components it bears, the works it pays for and its scenario ids. The report prints one distinct-contribution block per group. Read-only; not available to inspectors. Create one with create_group; compute its contribution with create_scenario and group_id. - Group: Restricted-use groups - REST: `GET /api/v1/etudes/{etude_id}/groups` - Scope: `etudes:read` — owners, administrators and technicians - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | Output: | Field | Type | Description | |---|---|---| | `groups` | array of object | The groups, in report order. | | `groups[].allocation_method` | string | How the contribution is split. One of: relative_value, equal_shares. | | `groups[].basis_reference` | string \| null | The clause of the declaration. | | `groups[].components` | array of object | The components this group bears (set with set_group_components). | | `groups[].components[].id` | integer | The component's id. (min 1) | | `groups[].components[].name` | string | Component name, with its subcomponent label. | | `groups[].components[].uniformat_code` | string \| null | UNIFORMAT code. | | `groups[].id` | integer | The group's id. (min 1) | | `groups[].name` | string | The restricted-use common portion. | | `groups[].position` | integer | Order in the report (0 first). | | `groups[].scenario_ids` | array of integer | The scenario(s) computing the group's distinct contribution; create one with create_scenario and group_id. | | `groups[].starting_balance` | number | Money already set aside for the group, in CAD. | | `groups[].starting_balance_note` | string \| null | Note on the starting balance. | | `groups[].unit_numbers` | array of string | The units that bear it. | | `groups[].works` | array of object | The works (travaux) the group pays for: those of its components. | | `groups[].works[].estimated_year` | integer \| null | Planned year. | | `groups[].works[].id` | integer | The work's (task's) id. (min 1) | | `groups[].works[].title` | string \| null | Title of the work. | Example arguments: ```json { "etude_id": 41 } ``` Example result: ```json { "groups": [ { "allocation_method": "relative_value", "basis_reference": "Déclaration, art. 8.6", "components": [ { "id": 310, "name": "Toiture — terrasses", "uniformat_code": "B3010" } ], "id": 5, "name": "Terrasses au toit", "position": 0, "scenario_ids": [ 77 ], "starting_balance": 0.0, "starting_balance_note": null, "unit_numbers": [ "601", "602", "603", "604" ], "works": [ { "estimated_year": 2031, "id": 902, "title": "Réfection des terrasses" } ] } ] } ``` Over REST: ```sh curl -s https://carnetcopro.ca/api/v1/etudes/41/groups \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Create a restricted-use group (`create_group`) Adds a restricted-use group to an étude: the units whose co-owners alone bear the major repairs of one restricted-use common portion, per a clause of the declaration (C.c.Q. 1064). It is placed after the existing groups in the report. A new group has no components: attach them with set_group_components (their works then move to the group's scenario), then create its scenario with create_scenario and group_id. Not available to inspectors. - Group: Restricted-use groups - REST: `POST /api/v1/etudes/{etude_id}/groups` - Scope: `etudes:write` — owners, administrators and technicians - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `name` | string | yes | The restricted-use common portion, e.g. « Terrasses au toit ». (min length 1, max length 255) | | `unit_numbers` | array of string | yes | The units whose co-owners alone bear this portion's major repairs; at least one. (max items 500) | | `allocation_method` | string | no | How the group's contribution is split among its units: by relative value (the default under the Civil Code) or in equal shares. One of: relative_value, equal_shares. | | `basis_reference` | string \| null | no | The clause of the declaration it rests on, e.g. « Déclaration, art. 8.6 ». (max length 500) | | `starting_balance` | number \| null | no | Money already set aside for the group (usually 0). In CAD. (min 0) | | `starting_balance_note` | string \| null | no | A note on that balance, printed in the report. (max length 2000) | Output: | Field | Type | Description | |---|---|---| | `group` | object | A restricted-use group. | | `group.allocation_method` | string | How the contribution is split. One of: relative_value, equal_shares. | | `group.basis_reference` | string \| null | The clause of the declaration. | | `group.components` | array of object | The components this group bears (set with set_group_components). | | `group.components[].id` | integer | The component's id. (min 1) | | `group.components[].name` | string | Component name, with its subcomponent label. | | `group.components[].uniformat_code` | string \| null | UNIFORMAT code. | | `group.id` | integer | The group's id. (min 1) | | `group.name` | string | The restricted-use common portion. | | `group.position` | integer | Order in the report (0 first). | | `group.scenario_ids` | array of integer | The scenario(s) computing the group's distinct contribution; create one with create_scenario and group_id. | | `group.starting_balance` | number | Money already set aside for the group, in CAD. | | `group.starting_balance_note` | string \| null | Note on the starting balance. | | `group.unit_numbers` | array of string | The units that bear it. | | `group.works` | array of object | The works (travaux) the group pays for: those of its components. | | `group.works[].estimated_year` | integer \| null | Planned year. | | `group.works[].id` | integer | The work's (task's) id. (min 1) | | `group.works[].title` | string \| null | Title of the work. | Example arguments: ```json { "allocation_method": "relative_value", "basis_reference": "Déclaration, art. 8.6", "etude_id": 41, "name": "Terrasses au toit", "unit_numbers": [ "601", "602", "603", "604" ] } ``` Example result: ```json { "group": { "allocation_method": "relative_value", "basis_reference": "Déclaration, art. 8.6", "components": [], "id": 5, "name": "Terrasses au toit", "position": 0, "scenario_ids": [], "starting_balance": 0.0, "starting_balance_note": null, "unit_numbers": [ "601", "602", "603", "604" ], "works": [] } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/etudes/41/groups \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"allocation_method":"relative_value","basis_reference":"Déclaration, art. 8.6","name":"Terrasses au toit","unit_numbers":["601","602","603","604"]}' ``` #### Update a restricted-use group (`update_group`) Changes a restricted-use group of an étude: its name, units, clause of the declaration, allocation method, starting balance and note. Only the fields you send change; unit_numbers replaces the whole list. Does not change the group's components (set_group_components) nor its scenario's figures (update_scenario); the scenario keeps the units it was created with. Not available to inspectors. - Group: Restricted-use groups - REST: `PATCH /api/v1/etudes/{etude_id}/groups/{group_id}` - Scope: `etudes:write` — owners, administrators and technicians - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `group_id` | integer | yes | The group to change (see list_groups). (min 1) | | `allocation_method` | string | no | How the group's contribution is split among its units: by relative value (the default under the Civil Code) or in equal shares. One of: relative_value, equal_shares. | | `basis_reference` | string \| null | no | The clause of the declaration it rests on, e.g. « Déclaration, art. 8.6 ». (max length 500) | | `name` | string | no | The restricted-use common portion, e.g. « Terrasses au toit ». (min length 1, max length 255) | | `starting_balance` | number \| null | no | Money already set aside for the group (usually 0). In CAD. (min 0) | | `starting_balance_note` | string \| null | no | A note on that balance, printed in the report. (max length 2000) | | `unit_numbers` | array of string | no | The units whose co-owners alone bear this portion's major repairs; at least one. (max items 500) | Output: | Field | Type | Description | |---|---|---| | `group` | object | A restricted-use group. | | `group.allocation_method` | string | How the contribution is split. One of: relative_value, equal_shares. | | `group.basis_reference` | string \| null | The clause of the declaration. | | `group.components` | array of object | The components this group bears (set with set_group_components). | | `group.components[].id` | integer | The component's id. (min 1) | | `group.components[].name` | string | Component name, with its subcomponent label. | | `group.components[].uniformat_code` | string \| null | UNIFORMAT code. | | `group.id` | integer | The group's id. (min 1) | | `group.name` | string | The restricted-use common portion. | | `group.position` | integer | Order in the report (0 first). | | `group.scenario_ids` | array of integer | The scenario(s) computing the group's distinct contribution; create one with create_scenario and group_id. | | `group.starting_balance` | number | Money already set aside for the group, in CAD. | | `group.starting_balance_note` | string \| null | Note on the starting balance. | | `group.unit_numbers` | array of string | The units that bear it. | | `group.works` | array of object | The works (travaux) the group pays for: those of its components. | | `group.works[].estimated_year` | integer \| null | Planned year. | | `group.works[].id` | integer | The work's (task's) id. (min 1) | | `group.works[].title` | string \| null | Title of the work. | Example arguments: ```json { "etude_id": 41, "group_id": 5, "unit_numbers": [ "601", "602", "603" ] } ``` Example result: ```json { "group": { "allocation_method": "relative_value", "basis_reference": "Déclaration, art. 8.6", "components": [], "id": 5, "name": "Terrasses au toit", "position": 0, "scenario_ids": [ 77 ], "starting_balance": 0.0, "starting_balance_note": null, "unit_numbers": [ "601", "602", "603" ], "works": [] } } ``` Over REST: ```sh curl -s -X PATCH https://carnetcopro.ca/api/v1/etudes/41/groups/5 \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"unit_numbers":["601","602","603"]}' ``` #### Delete a restricted-use group (`delete_group`) Deletes a restricted-use group of an étude. Its scenario is deleted with it, even when completed. Its components stay in the inventory but are no longer restricted-use, and its works fall back to the whole building and join the building scenarios again. Cannot be undone. To change a group, use update_group instead. Not available to inspectors. - Group: Restricted-use groups - REST: `DELETE /api/v1/etudes/{etude_id}/groups/{group_id}` - Scope: `etudes:delete` — owners, administrators and technicians - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `group_id` | integer | yes | The group to delete (see list_groups). (min 1) | Output: | Field | Type | Description | |---|---|---| | `deleted` | boolean | True once deleted. | | `group_id` | integer | The deleted group's id. (min 1) | Example arguments: ```json { "etude_id": 41, "group_id": 5 } ``` Example result: ```json { "deleted": true, "group_id": 5 } ``` Over REST: ```sh curl -s -X DELETE https://carnetcopro.ca/api/v1/etudes/41/groups/5 \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Set a group's components (`set_group_components`) Sets which components of an étude a restricted-use group bears, replacing the whole list (send [] to detach all). Attached components become restricted-use; a component already in another group moves to this one; detached ones are no longer restricted-use. The works of these components follow them: they are paid by the group and move to its scenario, or back to the building scenarios. Get component ids from list_components. Not available to inspectors. - Group: Restricted-use groups - REST: `PUT /api/v1/etudes/{etude_id}/groups/{group_id}/components` - Scope: `etudes:write` — owners, administrators and technicians - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `component_ids` | array of integer | yes | Every component the group bears, replacing the current list. (max items 1000) | | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `group_id` | integer | yes | The group (see list_groups). (min 1) | Output: | Field | Type | Description | |---|---|---| | `group` | object | A restricted-use group. | | `group.allocation_method` | string | How the contribution is split. One of: relative_value, equal_shares. | | `group.basis_reference` | string \| null | The clause of the declaration. | | `group.components` | array of object | The components this group bears (set with set_group_components). | | `group.components[].id` | integer | The component's id. (min 1) | | `group.components[].name` | string | Component name, with its subcomponent label. | | `group.components[].uniformat_code` | string \| null | UNIFORMAT code. | | `group.id` | integer | The group's id. (min 1) | | `group.name` | string | The restricted-use common portion. | | `group.position` | integer | Order in the report (0 first). | | `group.scenario_ids` | array of integer | The scenario(s) computing the group's distinct contribution; create one with create_scenario and group_id. | | `group.starting_balance` | number | Money already set aside for the group, in CAD. | | `group.starting_balance_note` | string \| null | Note on the starting balance. | | `group.unit_numbers` | array of string | The units that bear it. | | `group.works` | array of object | The works (travaux) the group pays for: those of its components. | | `group.works[].estimated_year` | integer \| null | Planned year. | | `group.works[].id` | integer | The work's (task's) id. (min 1) | | `group.works[].title` | string \| null | Title of the work. | Example arguments: ```json { "component_ids": [ 310, 311 ], "etude_id": 41, "group_id": 5 } ``` Example result: ```json { "group": { "allocation_method": "relative_value", "basis_reference": null, "components": [ { "id": 310, "name": "Toiture — terrasses", "uniformat_code": "B3010" }, { "id": 311, "name": "Garde-corps", "uniformat_code": "B2010" } ], "id": 5, "name": "Terrasses au toit", "position": 0, "scenario_ids": [], "starting_balance": 0.0, "starting_balance_note": null, "unit_numbers": [ "601", "602" ], "works": [] } } ``` Over REST: ```sh curl -s -X PUT https://carnetcopro.ca/api/v1/etudes/41/groups/5/components \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"component_ids":[310,311]}' ``` ### Financing scenarios #### List financing scenarios (`list_scenarios`) Lists the financing scenarios of an étude: first the building scenarios (the reserve-fund strategies compared in the report, oldest first, one of them possibly recommended), then the scenarios computing a restricted-use group's distinct contribution. Each comes with its hypotheses (period, rates, balances, target contribution and ramp), its recommended flag and its locked flag (completed scenarios are read only). Read-only; not available to inspectors. Use get_scenario_projection for a scenario's year-by-year figures. - Group: Financing scenarios - REST: `GET /api/v1/etudes/{etude_id}/scenarios` - Scope: `etudes:read` — owners, administrators and technicians - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | Output: | Field | Type | Description | |---|---|---| | `scenarios` | array of object | Building scenarios first, then group scenarios. | | `scenarios[].annual_contribution` | number | Target yearly contribution (reached after the ramp), in CAD. | | `scenarios[].completed_at` | string (date-time) \| null | When it was marked completed. ISO 8601 date-time, UTC. | | `scenarios[].contribution_ramp_years` | integer | Years taken to go from the current contribution to the target, in equal steps. | | `scenarios[].contribution_rate` | number \| null | Yearly increase of the contribution after the ramp, in percent. | | `scenarios[].current_annual_contribution` | number \| null | Contribution paid today, in CAD. | | `scenarios[].duration_years` | integer \| null | Length of the projection in years. | | `scenarios[].end_month` | string | End of the projection. Month as YYYY-MM. (min length 7, max length 7) | | `scenarios[].group_id` | integer \| null | The restricted-use group, for a group scenario. (min 1) | | `scenarios[].id` | integer | The scenario's id. (min 1) | | `scenarios[].inflation_rate` | number | Yearly inflation applied to work costs, in percent. | | `scenarios[].initial_balance` | number | Fund balance at the start, in CAD. | | `scenarios[].investment_return_rate` | number \| null | Yearly return on the fund's average balance, in percent. | | `scenarios[].is_base` | boolean | The étude's base scenario: one per étude, created with it and never deleted. Placing a work in it, or moving the work's first occurrence, sets the work's estimated_year (« Année prévue »); taking the work out clears it. | | `scenarios[].is_recommended` | boolean | The étude's recommended strategy (at most one building scenario). | | `scenarios[].locked` | boolean | Completed, so read only: hypotheses, works and deletion are refused until reopened with update_scenario completed=false. | | `scenarios[].name` | string | Name of the scenario. | | `scenarios[].safety_threshold` | number \| null | Minimum balance; a year falling below it gets a special contribution, in CAD. | | `scenarios[].scope` | string | building: a strategy for the whole reserve fund; group: the distinct contribution of a restricted-use group. One of: building, group. | | `scenarios[].start_month` | string | First month of the projection. Month as YYYY-MM. (min length 7, max length 7) | | `scenarios[].unit_numbers` | array of string | Units paying it (a group scenario); empty for the building. | | `scenarios[].updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | Example arguments: ```json { "etude_id": 41 } ``` Example result: ```json { "scenarios": [ { "annual_contribution": 6.2e4, "completed_at": null, "contribution_ramp_years": 3, "contribution_rate": 2.0, "current_annual_contribution": 3.8e4, "duration_years": 25, "end_month": "2051-12", "group_id": null, "id": 77, "inflation_rate": 3.0, "initial_balance": 1.845e5, "investment_return_rate": 1.5, "is_base": false, "is_recommended": false, "locked": false, "name": "Scénario recommandé", "safety_threshold": 2.5e4, "scope": "building", "start_month": "2027-01", "unit_numbers": [], "updated_at": "2026-10-20T14:03:11Z" } ] } ``` Over REST: ```sh curl -s https://carnetcopro.ca/api/v1/etudes/41/scenarios \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Get a scenario's projection (`get_scenario_projection`) Computes a financing scenario's projection over its period, as its page shows it: one row per year with opening balance, contributions, special contribution (added when the fund would fall below the safety threshold), interest, works paid (taxes and inflation included) and closing balance; the study's metrics (totals, special contribution years, lowest and final balance, and the smallest target contribution avoiding special contributions); and every work the scenario can plan with its start month and moved occurrences. include_minimal_targets adds the smallest target for each ramp length (slower). Amounts in CAD. Read-only; not available to inspectors. List scenarios with list_scenarios. - Group: Financing scenarios - REST: `GET /api/v1/etudes/{etude_id}/scenarios/{scenario_id}/projection` - Scope: `etudes:read` — owners, administrators and technicians - Annotations: readOnlyHint true, destructiveHint false, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `scenario_id` | integer | yes | The scenario (see list_scenarios). (min 1) | | `include_minimal_targets` | boolean | no | Also compute the minimal target for each ramp length (default false; slower). | Output: | Field | Type | Description | |---|---|---| | `metrics` | object \| null | The study's figures; null when the scenario has no month to project. | | `metrics.contribution_first_year` | number | Contribution of the first year, in CAD. | | `metrics.contribution_last_year` | number | Contribution of the last year, in CAD. | | `metrics.final_balance` | number | Balance at the end of the study, in CAD. | | `metrics.final_ratio_years` | number \| null | That balance in years of the last contribution. | | `metrics.first_year` | integer | First year. | | `metrics.last_year` | integer | Last year of the study. | | `metrics.lowest_balance` | number \| null | Lowest month-end balance of the study, in CAD. | | `metrics.special_total` | number | All special contributions, in CAD. | | `metrics.special_years` | array of object | The years with a special contribution. | | `metrics.special_years[].amount` | number | Special contribution, in CAD. | | `metrics.special_years[].year` | integer | Year. | | `metrics.suggested_target` | integer \| null | When there are special contributions: the smallest target yearly contribution (steps of 100 $) that avoids them with the current ramp; null otherwise or when none below 10 M$ does. | | `metrics.total_contributions` | number | All regular contributions, in CAD. | | `metrics.total_interest` | number | All investment return, in CAD. | | `metrics.total_works` | number | All works paid, in CAD. | | `minimal_targets` | array of object \| null | Minimal targets by ramp; null unless include_minimal_targets was true. | | `minimal_targets[].ramp_years` | integer | Years of ramp from the current contribution. | | `minimal_targets[].target` | integer \| null | Smallest target yearly contribution with no special contribution, in CAD. | | `scenario` | object | A financing scenario with its planned works. | | `scenario.annual_contribution` | number | Target yearly contribution (reached after the ramp), in CAD. | | `scenario.completed_at` | string (date-time) \| null | When it was marked completed. ISO 8601 date-time, UTC. | | `scenario.contribution_ramp_years` | integer | Years taken to go from the current contribution to the target, in equal steps. | | `scenario.contribution_rate` | number \| null | Yearly increase of the contribution after the ramp, in percent. | | `scenario.current_annual_contribution` | number \| null | Contribution paid today, in CAD. | | `scenario.duration_years` | integer \| null | Length of the projection in years. | | `scenario.end_month` | string | End of the projection. Month as YYYY-MM. (min length 7, max length 7) | | `scenario.group_id` | integer \| null | The restricted-use group, for a group scenario. (min 1) | | `scenario.id` | integer | The scenario's id. (min 1) | | `scenario.inflation_rate` | number | Yearly inflation applied to work costs, in percent. | | `scenario.initial_balance` | number | Fund balance at the start, in CAD. | | `scenario.investment_return_rate` | number \| null | Yearly return on the fund's average balance, in percent. | | `scenario.is_base` | boolean | The étude's base scenario: one per étude, created with it and never deleted. Placing a work in it, or moving the work's first occurrence, sets the work's estimated_year (« Année prévue »); taking the work out clears it. | | `scenario.is_recommended` | boolean | The étude's recommended strategy (at most one building scenario). | | `scenario.locked` | boolean | Completed, so read only: hypotheses, works and deletion are refused until reopened with update_scenario completed=false. | | `scenario.name` | string | Name of the scenario. | | `scenario.safety_threshold` | number \| null | Minimum balance; a year falling below it gets a special contribution, in CAD. | | `scenario.scope` | string | building: a strategy for the whole reserve fund; group: the distinct contribution of a restricted-use group. One of: building, group. | | `scenario.start_month` | string | First month of the projection. Month as YYYY-MM. (min length 7, max length 7) | | `scenario.summary_narrative` | string \| null | The report's paragraph on this strategy (HTML). | | `scenario.unit_numbers` | array of string | Units paying it (a group scenario); empty for the building. | | `scenario.updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | | `scenario.works` | array of object | Every work this scenario can plan (paid by the same payer), planned or not. | | `scenario.works[].estimated_year` | integer \| null | Year planned on the component's Travaux tab. | | `scenario.works[].moved_occurrences` | array of object | Occurrences moved to another year in this scenario. | | `scenario.works[].moved_occurrences[].from_year` | integer | Year the recurrence gives the occurrence. | | `scenario.works[].moved_occurrences[].to_year` | integer | Year it is paid in, in this scenario. | | `scenario.works[].planned_month` | string \| null | Start of the work in this scenario, from which its recurrence counts; null when the scenario leaves it out. Month as YYYY-MM. (min length 7, max length 7) | | `scenario.works[].task_id` | integer | The work's id (see list_tasks). (min 1) | | `scenario.works[].title` | string \| null | Title of the work. | | `years` | array of object | The projection, one row per year. | | `years[].closing_balance` | number | Balance at the end of the year, in CAD. | | `years[].contribution` | number | Regular contributions of the year, in CAD. | | `years[].interest` | number | Investment return credited, in CAD. | | `years[].lowest_balance` | number | Lowest month-end balance of the year, in CAD. | | `years[].opening_balance` | number | Balance at the start of the year, in CAD. | | `years[].special_contribution` | number | Special contribution needed to stay above the safety threshold, in CAD. | | `years[].works` | array of object | The works paid that year. | | `years[].works[].cost` | number | Cost paid that year, in CAD. | | `years[].works[].moved_from_year` | integer \| null | Year the recurrence gave it, when moved to this year. | | `years[].works[].task_id` | integer \| null | The work's id. (min 1) | | `years[].works[].title` | string \| null | Title of the work. | | `years[].works_total` | number | Works paid, taxes and inflation included, in CAD. | | `years[].year` | integer | Calendar year. | Example arguments: ```json { "etude_id": 41, "scenario_id": 77 } ``` Example result: ```json { "metrics": { "contribution_first_year": 4.6e4, "contribution_last_year": 9.87e4, "final_balance": 3.555e5, "final_ratio_years": 3.6, "first_year": 2027, "last_year": 2051, "lowest_balance": 3.12e4, "special_total": 0.0, "special_years": [], "suggested_target": null, "total_contributions": 1.82e6, "total_interest": 6.1e4, "total_works": 1.71e6 }, "minimal_targets": null, "scenario": { "annual_contribution": 6.2e4, "completed_at": null, "contribution_ramp_years": 3, "contribution_rate": 2.0, "current_annual_contribution": 3.8e4, "duration_years": 25, "end_month": "2051-12", "group_id": null, "id": 77, "inflation_rate": 3.0, "initial_balance": 1.845e5, "investment_return_rate": 1.5, "is_base": false, "is_recommended": false, "locked": false, "name": "Scénario recommandé", "safety_threshold": 2.5e4, "scope": "building", "start_month": "2027-01", "summary_narrative": null, "unit_numbers": [], "updated_at": "2026-10-20T14:03:11Z", "works": [] }, "years": [ { "closing_balance": 215212.5, "contribution": 4.6e4, "interest": 3112.5, "lowest_balance": 184210.0, "opening_balance": 1.845e5, "special_contribution": 0.0, "works": [ { "cost": 1.84e4, "moved_from_year": null, "task_id": 902, "title": "Scellant des joints" } ], "works_total": 1.84e4, "year": 2027 } ] } ``` Over REST: ```sh curl -s https://carnetcopro.ca/api/v1/etudes/41/scenarios/77/projection \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` #### Create a financing scenario (`create_scenario`) Creates a financing scenario in an étude, already planned with every work that has a planned year. Without group_id it is a building scenario (a reserve-fund strategy): send name, start_month, duration_years and annual_contribution; the contribution increase defaults to 2 %; its opening balance, current contribution, safety threshold, inflation rate and return rate come from the étude's financial basis (update_financial_basis), and the rates sent here override them. With group_id it computes that restricted-use group's distinct contribution, starting from the recommended strategy's rates and period and the group's starting balance; the other fields then override those. A group has one scenario. To start from an existing scenario, use duplicate_scenario. Not available to inspectors. - Group: Financing scenarios - REST: `POST /api/v1/etudes/{etude_id}/scenarios` - Scope: `etudes:write` — owners, administrators and technicians - Annotations: readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `annual_contribution` | number | no | Target yearly contribution to the fund, reached after the ramp. In CAD. (min 0) | | `contribution_ramp_years` | integer | no | Years to go from the current contribution to the target in equal steps; 0 applies the target from the first year. (min 0, max 100) | | `contribution_rate` | number | no | Yearly increase of the contribution once the target is reached, in percent. (min 0, max 99.99) | | `duration_years` | integer | no | Length of the projection in years (the study horizon is usually 25 to 30). (min 1, max 100) | | `group_id` | integer | no | For a restricted-use group's scenario: the group (see list_groups). (min 1) | | `inflation_rate` | number | no | Yearly inflation applied to work costs, in percent (e.g. 3). (min 0, max 99.99) | | `investment_return_rate` | number | no | Yearly return on the fund's average balance, in percent. (min 0, max 99.99) | | `name` | string | no | Name of the scenario. (min length 1, max length 255) | | `start_month` | string | no | First month of the projection. Month as YYYY-MM. (min length 7, max length 7) | Output: | Field | Type | Description | |---|---|---| | `scenario` | object | A financing scenario with its planned works. | | `scenario.annual_contribution` | number | Target yearly contribution (reached after the ramp), in CAD. | | `scenario.completed_at` | string (date-time) \| null | When it was marked completed. ISO 8601 date-time, UTC. | | `scenario.contribution_ramp_years` | integer | Years taken to go from the current contribution to the target, in equal steps. | | `scenario.contribution_rate` | number \| null | Yearly increase of the contribution after the ramp, in percent. | | `scenario.current_annual_contribution` | number \| null | Contribution paid today, in CAD. | | `scenario.duration_years` | integer \| null | Length of the projection in years. | | `scenario.end_month` | string | End of the projection. Month as YYYY-MM. (min length 7, max length 7) | | `scenario.group_id` | integer \| null | The restricted-use group, for a group scenario. (min 1) | | `scenario.id` | integer | The scenario's id. (min 1) | | `scenario.inflation_rate` | number | Yearly inflation applied to work costs, in percent. | | `scenario.initial_balance` | number | Fund balance at the start, in CAD. | | `scenario.investment_return_rate` | number \| null | Yearly return on the fund's average balance, in percent. | | `scenario.is_base` | boolean | The étude's base scenario: one per étude, created with it and never deleted. Placing a work in it, or moving the work's first occurrence, sets the work's estimated_year (« Année prévue »); taking the work out clears it. | | `scenario.is_recommended` | boolean | The étude's recommended strategy (at most one building scenario). | | `scenario.locked` | boolean | Completed, so read only: hypotheses, works and deletion are refused until reopened with update_scenario completed=false. | | `scenario.name` | string | Name of the scenario. | | `scenario.safety_threshold` | number \| null | Minimum balance; a year falling below it gets a special contribution, in CAD. | | `scenario.scope` | string | building: a strategy for the whole reserve fund; group: the distinct contribution of a restricted-use group. One of: building, group. | | `scenario.start_month` | string | First month of the projection. Month as YYYY-MM. (min length 7, max length 7) | | `scenario.summary_narrative` | string \| null | The report's paragraph on this strategy (HTML). | | `scenario.unit_numbers` | array of string | Units paying it (a group scenario); empty for the building. | | `scenario.updated_at` | string (date-time) | Last change. ISO 8601 date-time, UTC. | | `scenario.works` | array of object | Every work this scenario can plan (paid by the same payer), planned or not. | | `scenario.works[].estimated_year` | integer \| null | Year planned on the component's Travaux tab. | | `scenario.works[].moved_occurrences` | array of object | Occurrences moved to another year in this scenario. | | `scenario.works[].moved_occurrences[].from_year` | integer | Year the recurrence gives the occurrence. | | `scenario.works[].moved_occurrences[].to_year` | integer | Year it is paid in, in this scenario. | | `scenario.works[].planned_month` | string \| null | Start of the work in this scenario, from which its recurrence counts; null when the scenario leaves it out. Month as YYYY-MM. (min length 7, max length 7) | | `scenario.works[].task_id` | integer | The work's id (see list_tasks). (min 1) | | `scenario.works[].title` | string \| null | Title of the work. | Example arguments: ```json { "annual_contribution": 62000, "contribution_ramp_years": 3, "duration_years": 25, "etude_id": 41, "name": "Scénario recommandé", "start_month": "2027-01" } ``` Example result: ```json { "scenario": { "annual_contribution": 6.2e4, "completed_at": null, "contribution_ramp_years": 3, "contribution_rate": 2.0, "current_annual_contribution": 3.8e4, "duration_years": 25, "end_month": "2051-12", "group_id": null, "id": 77, "inflation_rate": 3.0, "initial_balance": 1.845e5, "investment_return_rate": 1.5, "is_base": false, "is_recommended": false, "locked": false, "name": "Scénario recommandé", "safety_threshold": 2.5e4, "scope": "building", "start_month": "2027-01", "summary_narrative": null, "unit_numbers": [], "updated_at": "2026-10-20T14:03:11Z", "works": [ { "estimated_year": 2031, "moved_occurrences": [], "planned_month": "2031-01", "task_id": 902, "title": "Réfection de la toiture" } ] } } ``` Over REST: ```sh curl -s -X POST https://carnetcopro.ca/api/v1/etudes/41/scenarios \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"annual_contribution":62000,"contribution_ramp_years":3,"duration_years":25,"name":"Scénario recommandé","start_month":"2027-01"}' ``` #### Update a financing scenario (`update_scenario`) Changes a financing scenario: its hypotheses (name, period, rates, target contribution and ramp), its recommendation, its report paragraph, and whether it is completed. Only the fields you send change. Recommending a building scenario withdraws the recommendation from the étude's other scenarios. completed=true locks the scenario (hypotheses, works and deletion refused); completed=false reopens it and may be sent with other changes. A locked scenario accepts only is_recommended, summary_narrative and completed; anything else fails with scenario_locked. initial_balance, current_annual_contribution and safety_threshold change this scenario's alone; update_financial_basis sets them for every building scenario at once, overwriting such changes. Works are planned with schedule_work_in_scenario. Not available to inspectors. - Group: Financing scenarios - REST: `PATCH /api/v1/etudes/{etude_id}/scenarios/{scenario_id}` - Scope: `etudes:write` — owners, administrators and technicians - Annotations: readOnlyHint false, destructiveHint true, idempotentHint true, openWorldHint false - Errors: `not_found` (404), `invalid_arguments` (422), `insufficient_scope` (403), `validation_failed` (422), `forbidden` (403) Input: | Name | Type | Required | Description | |---|---|---|---| | `etude_id` | integer | yes | The étude (see list_etudes). (min 1) | | `scenario_id` | integer | yes | The scenario to change (see list_scenarios). (min 1) | | `annual_contribution` | number | no | Target yearly contribution to the fund, reached after the ramp. In CAD. (min 0) | | `completed` | boolean | no | true marks it completed (locked, read only); false reopens it for changes. | | `contribution_ramp_years` | integer | no | Years to go from the current contribution to the target in equal steps; 0 applies the target from the first year. (min 0, max 100) | | `contribution_rate` | number | no | Yearly increase of the contribution once the target is reached, in percent. (min 0, max 99.99) | | `current_annual_contribution` | number \| null | no | The contribution paid today, as this scenario takes it. In CAD. (min 0) | | `duration_years` | integer | no | Length of the projection in years (the study horizon is usually 25 to 30). (min 1, max 100) | | `inflation_rate` | number | no | Yearly inflation applied to work costs, in percent (e.g. 3). (min 0, max 99.99) | | `initial_balance` | number \| null | no | The fund balance this scenario starts from. In CAD. (min 0) | | `investment_return_rate` | number | no | Yearly return on the fund's average balance, in percent. (min 0, max 99.99) | | `is_recommended` | boolean | no | Building scenarios only: true makes it the étude's recommended strategy. | | `name` | string | no | Name of the scenario. (min length 1, max length 255) | | `safety_threshold` | number \| null | no | The minimum balance this scenario keeps the fund above. In CAD. (min 0) | | `start_month` | string | no | First month of the projection. Month as YYYY-MM. (min length 7, max length 7) | | `summary_narrative` | string \| null | no | Building scenarios only: the report's paragraph on this strategy, as simple HTML (

, ,