Key Pydantic Schemas¶
These are the most commonly used request and response schemas.
Community¶
CommunityPayloadSchema (create/update)¶
{
"name": "REC Matosinhos",
"phone": "+351 220 000 000",
"address": "Rua do Porto, 123, Matosinhos",
"nif": "500000000",
"market_rate": "VANILLA_IMR",
"market_divisor": 0.5,
"market_compensation": 0.5,
"lem_trading_fee": 0.01,
"settlement_sale_price_type": "INDIVIDUAL",
"transaction_adjustment_tolerance": 0.001,
"method_alloc_coeff": "FIXED",
"start_date": "2026-01-01",
"end_date": null
}
Dated fields
start_date is required and end_date is optional on every create and update of a
community, membership, meter, resource, ownership, contract, fixed bilateral price, RESP
and EMS configuration. Both are inclusive calendar dates in Europe/Lisbon; end_date: null
means open-ended. Responses also include the version_id of the returned version. See
Business Validity.
Energy Management Configuration¶
UnifiedConfigCreateSchema¶
{
"module_type": "OSTEC_SIMPLE",
"horizon": 24,
"delta_t": 1.0,
"strict_pos_coeffs": true,
"total_share_coeffs": false,
"config_data": {
"l_extra": 10.0,
"l_market_buy": 500.0,
"l_market_sell": -500.0,
"solver": "CPLEX"
},
"is_active": true,
"start_date": "2026-01-01",
"end_date": null
}
Flexibility Offer¶
ExternalFlexibilityOfferSchema¶
{
"external_offer_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"flexibility_zone_id": "3fa85f64-5717-4562-b3fc-2c963f66afa7",
"quantity": 10.5,
"divisible": true,
"activation_price": 50.0,
"reservation_price": 5.0,
"recovery_time": 30,
"start_datetime": "2024-01-15T10:00:00",
"end_datetime": "2024-01-15T11:00:00",
"offer_data": {}
}
Energy Setpoint¶
ExternalSetpointSchema¶
{
"resource_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"meter_id": null,
"datetime_timestamp": "2024-01-15T10:00:00",
"setpoint_value": 5.2,
"setpoint_type": "STORAGE_CHARGE",
"calculation_metadata": {
"solver_status": "optimal",
"solve_time_ms": 234
}
}
Load Data¶
LoadPayloadSchema¶
{
"meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"datetime_timestamp": "2024-01-15T10:00:00",
"energy_value": 0.452,
"is_estimated": false
}
Business Validity¶
EffectivePeriodSchema¶
Shared by every dated payload.
Version list item¶
Returned by the /business-validity/.../versions endpoints, ordered by start_date. Each item
also contains the versioned fields of that entity.
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"start_date": "2026-01-01",
"end_date": "2026-01-13",
"created_at": "2026-01-01T09:00:00Z"
}