Facilities API
The Facilities API allows you to create, retrieve, update, and delete facilities within your organization. Each facility represents a physical site (office, warehouse, factory, etc.) and tracks energy consumption and CO2e emissions.New API: This endpoint is part of the new API architecture with improved design and maintainability.
Key Features
- Site Management: Create and manage facilities in your organization
- Consumption Categories: Configure which consumption types apply to each facility (heat, electricity, water, recharge)
- CO2e Tracking: Automatic emissions calculation based on facility consumption data
- Regional Support: ISO country codes for region-specific emission factors
- CUPS Integration: Associate electricity supply point codes (CUPS) with facilities
- Pagination Support: Efficiently retrieve large lists of facilities
Authentication
All endpoints require authentication using either:- API Key: Include in
x-api-keyheader - JWT Token: Include in
Authorizationheader asBearer {JWT_TOKEN}
Headers
All requests must include:Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faYour API key for authenticationExample:
sk_live_1234567890abcdefAvailable Endpoints
List Facilities
Retrieve all facilities with filtering and pagination
Get Facility
Retrieve a single facility by ID
Create Facility
Add a new facility to your organization
Update Facility
Modify facility details
Delete Facility
Remove a facility from your organization
Facility Attributes
Core Information
- name (
string, required): Name of the facility (e.g., “Madrid Office”, “Barcelona Warehouse”) - type (
string, required): Type of facility (e.g., “office”, “warehouse”, “factory”) - country (
string, required): ISO 3166-1 country code (e.g., “ES”, “FR”, “DE”) - address (
string, optional): Physical address of the facility
Configuration
- categories (
array[string], optional): Consumption categories enabled for this facility (e.g.,["heat", "electricity", "water", "recharge"]) - cups_list (
array[string], optional): List of CUPS (electricity supply point) codes associated with the facility - logistic_factor (
float, optional): Logistic factor for scope 2 calculation in logistics reports (0 to 1, default 0.8)
Emission Data
- co2e (
float, read-only): Total CO2 equivalent emissions in kg CO2e - co2e_biomass (
float, read-only): CO2e from biomass sources - status (
string): Current status:activeorarchived
Response Format
Facility Object
Error Handling
Common HTTP Status Codes
| Status | Meaning | Solution |
|---|---|---|
| 200 | Success | - |
| 201 | Created | - |
| 204 | No Content (delete successful) | - |
| 401 | Unauthorized | Verify API key or JWT token |
| 404 | Not Found | Check resource ID or organization |
| 422 | Validation Error | Review error details in response |
| 500 | Server Error | Contact support if persists |

