Resources
Service
A unit's service history: visits, repairs, fault reports and notes, from the app and from your own systems.
The service entry model
Properties
-
idstring (uuid) -
unit_idstring (uuid) -
component_idstring (uuid), nullable -
typestringOne of
service,repair,replacement,addition,inspection,other -
performed_atstring (date-time) -
textstring, nullable -
companystring, nullableThe company that did the work.
-
created_atstring (date-time)
GET/units/{unit}/service-entries
List service entries
Service history.
Scope: service:read
Path parameters
-
unitstring (uuid) requiredThe ID of the unit.
Query parameters
-
limitintegerRecords per page. At most 100, default 50.
-
cursorstringThe value of
next_cursorfrom the page before.
Response
200 A page of service notes. The fields are those of the service entry model.
curl https://api.maci.energy/v1/units/0b6f4c1e-5a1d-4a57-9f0e-2f6f3f0c9a11/service-entries \
-H "Authorization: Bearer $MACI_API_KEY"
const response = await fetch('https://api.maci.energy/v1/units/0b6f4c1e-5a1d-4a57-9f0e-2f6f3f0c9a11/service-entries', {
headers: {
Authorization: `Bearer ${process.env.MACI_API_KEY}`,
},
});
const data = await response.json();
import os
import requests
response = requests.get(
"https://api.maci.energy/v1/units/0b6f4c1e-5a1d-4a57-9f0e-2f6f3f0c9a11/service-entries",
headers={"Authorization": f"Bearer {os.environ['MACI_API_KEY']}"},
)
data = response.json()
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.maci.energy/v1/units/0b6f4c1e-5a1d-4a57-9f0e-2f6f3f0c9a11/service-entries', [
'headers' => [
'Authorization' => 'Bearer '.getenv('MACI_API_KEY'),
],
]);
$data = json_decode($response->getBody(), true);
{
"data": [
{
"id": "bd58f66a-5f7e-494b-a81b-d5429bd71ba2",
"unit_id": "0b6f4c1e-5a1d-4a57-9f0e-2f6f3f0c9a11",
"component_id": null,
"type": "service",
"performed_at": "2026-10-30T09:15:00Z",
"text": "Cleaned the condenser and checked the fans.",
"company": "Example Cooling ApS",
"created_at": "2026-10-30T09:15:00Z"
}
],
"next_cursor": null
}
POST/units/{unit}/service-entries
Create service entry
New service note.
Scope: service:write
Path parameters
-
unitstring (uuid) requiredThe ID of the unit.
Headers
-
Idempotency-KeystringA value of your own choosing, so that a repeated call does not create two records.
Body
-
typestring requiredReplacements and additions are written by the system when a component changes.
One of
service,repair,inspection,other -
textstring required -
performed_atstring (date-time), nullableWhen the work was done. The default is now.
Response
201 The service note that was created. The fields are those of the service entry model.
curl -X POST https://api.maci.energy/v1/units/0b6f4c1e-5a1d-4a57-9f0e-2f6f3f0c9a11/service-entries \
-H "Authorization: Bearer $MACI_API_KEY" \
-H "Idempotency-Key: a-value-of-your-own" \
-H "Content-Type: application/json" \
-d '{
"type": "service",
"text": "Cleaned the condenser and checked the fans.",
"performed_at": "2026-10-30T09:15:00Z"
}'
const response = await fetch('https://api.maci.energy/v1/units/0b6f4c1e-5a1d-4a57-9f0e-2f6f3f0c9a11/service-entries', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MACI_API_KEY}`,
'Idempotency-Key': 'a-value-of-your-own',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"type": "service",
"text": "Cleaned the condenser and checked the fans.",
"performed_at": "2026-10-30T09:15:00Z"
}),
});
const data = await response.json();
import os
import requests
response = requests.post(
"https://api.maci.energy/v1/units/0b6f4c1e-5a1d-4a57-9f0e-2f6f3f0c9a11/service-entries",
headers={"Authorization": f"Bearer {os.environ['MACI_API_KEY']}", "Idempotency-Key": "a-value-of-your-own"},
json={
"type": "service",
"text": "Cleaned the condenser and checked the fans.",
"performed_at": "2026-10-30T09:15:00Z"
},
)
data = response.json()
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.maci.energy/v1/units/0b6f4c1e-5a1d-4a57-9f0e-2f6f3f0c9a11/service-entries', [
'headers' => [
'Authorization' => 'Bearer '.getenv('MACI_API_KEY'),
'Idempotency-Key' => 'a-value-of-your-own',
],
'json' => [
'type' => 'service',
'text' => 'Cleaned the condenser and checked the fans.',
'performed_at' => '2026-10-30T09:15:00Z',
],
]);
$data = json_decode($response->getBody(), true);
{
"id": "bd58f66a-5f7e-494b-a81b-d5429bd71ba2",
"unit_id": "0b6f4c1e-5a1d-4a57-9f0e-2f6f3f0c9a11",
"component_id": null,
"type": "service",
"performed_at": "2026-10-30T09:15:00Z",
"text": "Cleaned the condenser and checked the fans.",
"company": "Example Cooling ApS",
"created_at": "2026-10-30T09:15:00Z"
}