Skip to main content

API Documentation

This document provides a comprehensive list of API endpoints available in the backend application.

1. AirQualityObserved

Base Path: /api/v1/air-quality

MethodEndpointDescriptionInputOutput
GET/Query AirQualityObserved EntitiesQuery Params: id, q, pick, attrs, georel, geometry, coordinates, geoproperty, limit, offset, count, format, options, localList[Dict] or int
GET/{entity_id}Get AirQualityObserved Entity by IDPath: entity_id
Query Params: pick, attrs, format, options
Dict
POST/Create AirQualityObserved EntityBody: AirQualityObserved model{"message": str, "id": str}
PATCH/{entity_id}/attrsUpdate Entity Attributes (Partial Update)Path: entity_id
Body: Dict[str, NgsiLdAttributePatch]
None (204 No Content)
PUT/{entity_id}Replace Entity (Full Update)Path: entity_id
Body: AirQualityObserved model
None (204 No Content)
DELETE/{entity_id}Delete AirQualityObserved EntityPath: entity_idNone (204 No Content)
DELETE/{entity_id}/attrs/{attribute_name}Delete Entity AttributePath: entity_id, attribute_nameNone (204 No Content)
POST/batch/createBatch Create EntitiesBody: BatchOperationRequest (entities: List[Dict])List[str] or {"success": True}
POST/batch/upsertBatch Upsert EntitiesBody: BatchOperationRequest
Query Params: options ('update' or 'replace')
List[str] or {"success": True}
POST/batch/deleteBatch Delete EntitiesBody: BatchDeleteRequest (entity_ids: List[str])None (204 No Content)

2. Building

Base Path: /api/v1/buildings

MethodEndpointDescriptionInputOutput
GET/Query Building EntitiesQuery Params: id, q, pick, attrs, georel, geometry, coordinates, geoproperty, limit, offset, count, format, options, localList[Dict] or int
GET/{entity_id}Get Building by IDPath: entity_id
Query Params: pick, attrs, format, options
Dict
POST/Create BuildingBody: Building model{"message": str, "id": str}
PATCH/{entity_id}/attrsUpdate Building AttributesPath: entity_id
Body: Dict[str, NgsiLdAttributePatch]
None (204 No Content)
PUT/{entity_id}Replace BuildingPath: entity_id
Body: Building model
None (204 No Content)
DELETE/{entity_id}Delete BuildingPath: entity_idNone (204 No Content)
DELETE/{entity_id}/attrs/{attribute_name}Delete Building AttributePath: entity_id, attribute_nameNone (204 No Content)
POST/batch/createBatch Create BuildingsBody: BatchOperationRequestList[str] or {"success": True}
POST/batch/upsertBatch Upsert BuildingsBody: BatchOperationRequest
Query Params: options
List[str] or {"success": True}
POST/batch/deleteBatch Delete BuildingsBody: BatchDeleteRequestNone (204 No Content)
GET/location/nearbyFind buildings near a locationQuery Params: lon, lat, max_distance, limit, format, pickList[Dict]
GET/category/{category}Find buildings by categoryPath: category
Query Params: limit, format
List[Dict]
GET/tallFind tall buildingsQuery Params: min_floors, limit, formatList[Dict]

3. CarbonFootprint

Base Path: /api/v1/carbon-footprint

MethodEndpointDescriptionInputOutput
GET/Query CarbonFootprint EntitiesQuery Params: id, q, pick, attrs, georel, geometry, coordinates, geoproperty, limit, offset, count, format, options, localList[Dict] or int
GET/{entity_id}Get CarbonFootprint by IDPath: entity_id
Query Params: pick, attrs, format, options
Dict
POST/Create CarbonFootprintBody: CarbonFootprint model{"message": str, "id": str}
PATCH/{entity_id}/attrsUpdate CarbonFootprint AttributesPath: entity_id
Body: Dict[str, NgsiLdAttributePatch]
None (204 No Content)
PUT/{entity_id}Replace CarbonFootprintPath: entity_id
Body: CarbonFootprint model
None (204 No Content)
DELETE/{entity_id}Delete CarbonFootprintPath: entity_idNone (204 No Content)
DELETE/{entity_id}/attrs/{attribute_name}Delete AttributePath: entity_id, attribute_nameNone (204 No Content)
POST/batch/createBatch Create CarbonFootprintBody: BatchOperationRequestList[str] or {"success": True}
POST/batch/upsertBatch Upsert CarbonFootprintBody: BatchOperationRequest
Query Params: options
List[str] or {"success": True}
POST/batch/deleteBatch Delete CarbonFootprintBody: BatchDeleteRequestNone (204 No Content)
GET/source/{emission_source}Find emissions by source typePath: emission_source
Query Params: limit, format
List[Dict]
GET/high-emissionsFind emissions exceeding thresholdQuery Params: threshold, limit, formatList[Dict]
GET/recentGet recent emission recordsQuery Params: since, limit, format, pickList[Dict]
GET/location/nearbyFind emission records near locationQuery Params: lon, lat, max_distance, limit, format, pickList[Dict]

4. ContextSourceRegistrations

Base Path: /api/v1/csourceRegistrations

MethodEndpointDescriptionInputOutput
POST/Create a new context source registrationBody: RegistrationCreate
Query Params: tenant
{"message": str, "id": str, "mode": str}
GET/Get all context source registrationsQuery Params: entity_type, limit, offset, tenantList[Dict]
GET/{registration_id}Get details of a registrationPath: registration_id
Query Params: tenant
Dict
PATCH/{registration_id}Update a registrationPath: registration_id
Body: RegistrationUpdate
Query Params: tenant
None (204 No Content)
DELETE/{registration_id}Delete a registrationPath: registration_id
Query Params: tenant
None (204 No Content)
POST/quick/redirectQuick redirect registrationQuery Params: entity_type, endpoint, description, tenant{"message": str, "id": str}
POST/quick/federationQuick federation registrationQuery Params: entity_type, endpoint, description, tenant{"message": str, "id": str}
POST/quick/deviceQuick device registrationQuery Params: entity_id, entity_type, properties, iot_agent, description, tenant{"message": str, "id": str}

5. Device

Base Path: /api/v1/devices

MethodEndpointDescriptionInputOutput
GET/Query Device EntitiesQuery Params: id, q, pick, attrs, georel, geometry, coordinates, geoproperty, limit, offset, count, format, options, localList[Dict] or int
GET/{entity_id}Get Device by IDPath: entity_id
Query Params: pick, attrs, format, options
Dict
POST/Create DeviceBody: Device model{"message": str, "id": str}
PATCH/{entity_id}/attrsUpdate Device AttributesPath: entity_id
Body: Dict[str, NgsiLdAttributePatch]
None (204 No Content)
PUT/{entity_id}Replace DevicePath: entity_id
Body: Device model
None (204 No Content)
DELETE/{entity_id}Delete DevicePath: entity_idNone (204 No Content)
DELETE/{entity_id}/attrs/{attribute_name}Delete Device AttributePath: entity_id, attribute_nameNone (204 No Content)
POST/batch/createBatch Create DevicesBody: BatchOperationRequestList[str] or {"success": True}
POST/batch/upsertBatch Upsert DevicesBody: BatchOperationRequest
Query Params: options
List[str] or {"success": True}
POST/batch/deleteBatch Delete DevicesBody: BatchDeleteRequestNone (204 No Content)
GET/category/{category}Find devices by categoryPath: category
Query Params: limit, format
List[Dict]
GET/low-batteryFind devices with low batteryQuery Params: threshold, limit, formatList[Dict]
GET/state/{device_state}Find devices by statePath: device_state
Query Params: limit, format
List[Dict]
GET/property/{controlled_property}Find devices by propertyPath: controlled_property
Query Params: limit, format
List[Dict]
GET/inactiveFind inactive devicesQuery Params: days, limit, formatList[Dict]
GET/location/nearbyFind devices near locationQuery Params: lon, lat, max_distance, limit, format, pickList[Dict]

6. RoadSegment

Base Path: /api/v1/road-segments

MethodEndpointDescriptionInputOutput
GET/Query RoadSegment EntitiesQuery Params: id, q, pick, attrs, georel, geometry, coordinates, geoproperty, limit, offset, count, format, options, localList[Dict] or int
GET/{entity_id}Get RoadSegment by IDPath: entity_id
Query Params: attrs, options
Dict
POST/Create RoadSegment EntityBody: DictResponse
PATCH/{entity_id}Update RoadSegment EntityPath: entity_id
Body: Dict[str, NgsiLdAttributePatch]
Response
PUT/{entity_id}Replace RoadSegment EntityPath: entity_id
Body: RoadSegment or Dict
Response
DELETE/{entity_id}Delete RoadSegment EntityPath: entity_idResponse
POST/batch/createBatch Create RoadSegment EntitiesBody: BatchOperationRequestResponse
POST/batch/upsertBatch Upsert RoadSegment EntitiesBody: BatchOperationRequest
Query Params: options
Response
POST/batch/updateBatch Update RoadSegment EntitiesBody: BatchOperationRequest
Query Params: options
Response
POST/batch/deleteBatch Delete RoadSegment EntitiesBody: BatchDeleteRequestResponse
GET/by-road-class/{road_class}Query by Road ClassPath: road_class
Query Params: limit
List[Dict]
GET/by-speed-limitQuery by Speed Limit RangeQuery Params: min_speed, max_speed, limitList[Dict]
GET/by-lengthQuery by Length RangeQuery Params: min_length, max_length, limitList[Dict]
GET/by-lane-countQuery by Lane CountQuery Params: min_lanes, max_lanes, limitList[Dict]
GET/by-road-nameQuery by Road NameQuery Params: road_name, exact_match, limitList[Dict]
GET/by-status/{status}Query by StatusPath: status
Query Params: limit
List[Dict]
GET/by-vehicle-type/{vehicle_type}Query by Vehicle TypePath: vehicle_type
Query Params: limit
List[Dict]

7. Subscriptions

Base Path: /api/v1/subscriptions

MethodEndpointDescriptionInputOutput
POST/Create a new subscriptionBody: SubscriptionCreate
Query Params: tenant
{"message": str, "id": str}
GET/Get all subscriptionsQuery Params: limit, offset, tenantList[Dict]
GET/{subscription_id}Get details of a subscriptionPath: subscription_id
Query Params: tenant
Dict
PATCH/{subscription_id}Update a subscriptionPath: subscription_id
Body: SubscriptionUpdate
Query Params: tenant
None (204 No Content)
DELETE/{subscription_id}Delete a subscriptionPath: subscription_id
Query Params: tenant
None (204 No Content)
POST/quick/entity-typeQuick subscription to entity typeQuery Params: entity_type, notification_uri, attributes, q, description, tenant{"message": str, "id": str}

8. TrafficEnvironmentImpact

Base Path: /api/v1/traffic-environment-impact

MethodEndpointDescriptionInputOutput
GET/Query TrafficEnvironmentImpact EntitiesQuery Params: id, q, pick, attrs, georel, geometry, coordinates, geoproperty, limit, offset, count, format, options, localList[Dict] or int
GET/{entity_id}Get TrafficEnvironmentImpact by IDPath: entity_id
Query Params: attrs, options
Dict
POST/Create TrafficEnvironmentImpact EntityBody: DictResponse
PATCH/{entity_id}Update TrafficEnvironmentImpact EntityPath: entity_id
Body: Dict[str, NgsiLdAttributePatch]
Response
PUT/{entity_id}Replace TrafficEnvironmentImpact EntityPath: entity_id
Body: TrafficEnvironmentImpact or Dict
Response
DELETE/{entity_id}Delete TrafficEnvironmentImpact EntityPath: entity_idResponse
POST/batch/createBatch Create EntitiesBody: BatchOperationRequestResponse
POST/batch/upsertBatch Upsert EntitiesBody: BatchOperationRequest
Query Params: options
Response
POST/batch/updateBatch Update EntitiesBody: BatchOperationRequest
Query Params: options
Response
POST/batch/deleteBatch Delete EntitiesBody: BatchDeleteRequestResponse
GET/by-co2-rangeQuery by CO2 RangeQuery Params: min_co2, max_co2, limitList[Dict]
GET/by-time-rangeQuery by Time RangeQuery Params: start_time, end_time, limitList[Dict]
GET/by-vehicle-class/{vehicle_class}Query by Vehicle ClassPath: vehicle_class
Query Params: limit
List[Dict]
GET/by-traffic-flow/{traffic_flow_id}Query by Traffic Flow ReferencePath: traffic_flow_id
Query Params: limit
List[Dict]

9. WaterQualityObserved

Base Path: /api/v1/water-quality

MethodEndpointDescriptionInputOutput
GET/Query WaterQualityObserved EntitiesQuery Params: id, q, pick, attrs, georel, geometry, coordinates, geoproperty, limit, offset, count, format, options, localList[Dict] or int
GET/{entity_id}Get WaterQualityObserved by IDPath: entity_id
Query Params: pick, attrs, format, options
Dict
POST/Create WaterQualityObservedBody: WaterQualityObserved model{"message": str, "id": str}
PATCH/{entity_id}/attrsUpdate WaterQualityObserved AttributesPath: entity_id
Body: Dict[str, NgsiLdAttributePatch]
None (204 No Content)
PUT/{entity_id}Replace WaterQualityObservedPath: entity_id
Body: WaterQualityObserved model
None (204 No Content)
DELETE/{entity_id}Delete WaterQualityObservedPath: entity_idNone (204 No Content)
DELETE/{entity_id}/attrs/{attribute_name}Delete AttributePath: entity_id, attribute_nameNone (204 No Content)
POST/batch/createBatch Create WaterQualityObservedBody: BatchOperationRequestList[str] or {"success": True}
POST/batch/upsertBatch Upsert WaterQualityObservedBody: BatchOperationRequest
Query Params: options
List[str] or {"success": True}
POST/batch/deleteBatch Delete WaterQualityObservedBody: BatchDeleteRequestNone (204 No Content)
GET/poor-quality/{parameter}Find poor quality waterPath: parameter
Query Params: min_value, max_value, limit, format
List[Dict]
GET/contaminated/{contaminant}Find contaminated waterPath: contaminant
Query Params: threshold, limit, format
List[Dict]
GET/recentGet recent observationsQuery Params: since, limit, format, pickList[Dict]
GET/location/nearbyFind observations near locationQuery Params: lon, lat, max_distance, limit, format, pickList[Dict]