5. Complete a unit (updateUnit)
Observed — several updateUnit calls on the same id, from the ownership / rent / surfaces / EPC tabs.
Each call sends a partial patch in UnitInputV2: only the provided fields are updated.
5.1 Attach the organization
Matches the “Property / organization” section of the UI.
- GraphQL
- Node.js
- curl
mutation updateUnit($id: UUID!, $unit: UnitInputV2!) {
updateUnit(id: $id, unit: $unit) {
id
businessUnit { id name }
}
}
{
"id": "00000000-0000-4000-8000-000000000020",
"unit": {
"businessUnitId": "00000000-0000-4000-8000-000000000002"
}
}
await ublo(
`mutation updateUnit($id: UUID!, $unit: UnitInputV2!) {
updateUnit(id: $id, unit: $unit) { id }
}`,
{
id: process.env.UNIT_ID,
unit: { businessUnitId: process.env.BUSINESS_UNIT_ID },
},
);
- Bearer
- Cookie session
# payload.json = query + variables from the GraphQL tab (id + unit.businessUnitId)
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H "Authorization: Bearer $UBLO_API_TOKEN" \
-H 'Content-Type: application/json' \
-d @payload.json
# payload.json = query + variables from the GraphQL tab (id + unit.businessUnitId)
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H 'Content-Type: application/json' \
-b cookies.txt \
-d @payload.json
5.2 Surfaces
{
"id": "00000000-0000-4000-8000-000000000020",
"unit": {
"unitSurfaces": [
{
"unitId": "00000000-0000-4000-8000-000000000020",
"surfaceType": "REAL_SURFACE",
"value": 30,
"measurementUnit": "M2",
"measurementSource": "AREA_CERTIFICATE",
"measurementDate": "2026-07-27",
"isReference": true
}
]
}
}
- Bearer
- Cookie session
# payload.json = updateUnit mutation from section 5.1, with the variables above
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H "Authorization: Bearer $UBLO_API_TOKEN" \
-H 'Content-Type: application/json' \
-d @payload.json
# payload.json = updateUnit mutation from section 5.1, with the variables above
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H 'Content-Type: application/json' \
-b cookies.txt \
-d @payload.json
5.3 Rent & charges (cents)
Prerequisites: accountingOperations with usage: "invoicing" (see Accounting). The operationId values on rentItems point to those operations. Also provide vatCodeId and vatExemptionCodeId (RentItemInput — optional today, expected to become required; listVatCodes / listVatExemptionCodes).
Observed example (rent €1,000.00 + charges €200.00 + deposit €3,000.00 / 3 months):
{
"id": "00000000-0000-4000-8000-000000000020",
"unit": {
"rentReferenceV2": {
"chargesType": "fixed",
"rentItems": [
{
"amount": 100000,
"operationId": "00000000-0000-4000-8000-000000000031",
"vatCodeId": "00000000-0000-4000-8000-000000000201",
"vatExemptionCodeId": "00000000-0000-4000-8000-000000000202",
"vatMention": "not_applicable",
"vatRate": 0,
"vatSpecific": "accounting"
},
{
"amount": 20000,
"operationId": "00000000-0000-4000-8000-000000000032",
"vatCodeId": "00000000-0000-4000-8000-000000000201",
"vatExemptionCodeId": "00000000-0000-4000-8000-000000000202",
"vatMention": "not_applicable",
"vatRate": 0,
"vatSpecific": "accounting"
}
],
"warrantyDepositItem": {
"amount": 300000,
"depositLength": 3,
"operationId": null
}
}
}
}
- Bearer
- Cookie session
# payload.json = updateUnit mutation from section 5.1, with the variables above
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H "Authorization: Bearer $UBLO_API_TOKEN" \
-H 'Content-Type: application/json' \
-d @payload.json
# payload.json = updateUnit mutation from section 5.1, with the variables above
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H 'Content-Type: application/json' \
-b cookies.txt \
-d @payload.json
Set up the chart of accounts and operations first so “rent excluding charges” and “charges” appear correctly.
5.4 DPE (EPC)
{
"id": "00000000-0000-4000-8000-000000000020",
"unit": {
"epc": {
"startDate": "2026-07-27",
"endDate": "2036-07-27",
"energyComsumption": 75,
"gazEmission": 7,
"epcNumber": "DPE-EXEMPLE-001",
"pecLabel": "B",
"ghgLabel": "B",
"id": null
},
"documents": {}
}
}
- Bearer
- Cookie session
# payload.json = updateUnit mutation from section 5.1, with the variables above
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H "Authorization: Bearer $UBLO_API_TOKEN" \
-H 'Content-Type: application/json' \
-d @payload.json
# payload.json = updateUnit mutation from section 5.1, with the variables above
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H 'Content-Type: application/json' \
-b cookies.txt \
-d @payload.json
The captured field is indeed energyComsumption (historical schema typo).
5.5 Usage / template
{
"unit": {
"usage": "private",
"unitTemplateId": "00000000-0000-4000-8000-000000000010"
}
}
- Bearer
- Cookie session
# payload.json = updateUnit mutation from section 5.1, with the variables above
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H "Authorization: Bearer $UBLO_API_TOKEN" \
-H 'Content-Type: application/json' \
-d @payload.json
# payload.json = updateUnit mutation from section 5.1, with the variables above
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H 'Content-Type: application/json' \
-b cookies.txt \
-d @payload.json