SchemaDefinition
Note: The nsfilter (namespace filter) query parameter is mandatory for every request. It sets the context, helping you look up resources within that namespace. Example: GET /itemsvc/api/v1/schemadefinitions?nsfilter=proj_DrZrSNrW
Generate Schema Definition#
Generates schema definitions from all RelatedItems in all NamedUserCollections within the given namespace. Nothing is persisted automatically—the generated schema must be reviewed and modified by users before using the update API to save it
Endpoints#
POST /itemsvc/api/v1/schemadefinitions/generateRequest#
Query parameters#
| Parameter | Type | Description | Required |
|---|---|---|---|
nsfilter | String | Namespace context | Required |
Response#
Response codes#
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
Response body example#
{ "_itemTypes": [ { "_typeName": "RevitElement", "_type": "object", "_properties": { "type_id": { "_type": "number" }, "source_filename": { "_type": "string" }, "_id": { "_type": "string" }, "package_id": { "_type": "number" }, "source_id": { "_type": "string" }, "_metadata": { "_type": "object", "_properties": { "_updatedById": { "_type": "string" }, "_createdAt": { "_type": "number" }, "_createdById": { "_type": "string" }, "_updatedAt": { "_type": "number" } } } }, "_relationshipTypes": [ { "_isInverse": false, "_ref": { "_relatedTypeName": "RevitElementProps", "_relatedUserType": "rvt_element_props", "_relatedUserItemId": "ex11034-inv_elprops_rHf5FiueMi" } }, { "_isInverse": false, "_ref": { "_relatedTypeName": "RevitTypeElement", "_relatedUserType": "rvt_type_elements", "_relatedUserItemId": "ex11034-inv_type_el_xiK91Hkryj" } } } ] }, { "_typeName": "RevitElementProps", "_type": "object", "_properties": { "_id": { "_type": "string" }, "_metadata": { "_type": "object", "_properties": { "_updatedById": { "_type": "string" }, "_createdAt": { "_type": "number" }, "_createdById": { "_type": "string" }, "_updatedAt": { "_type": "number" } } }, "properties": { "_type": "object", "_properties": { "SystemelementId": { "_type": "object", "_properties": { "val": { "_type": "number" }, "name": { "_type": "string" }, "dName": { "_type": "string" }, "id": { "_type": "number" } } } } }, "_relationshipTypes": [ { "_isInverse": true, "_ref": { "_relatedTypeName": "RevitElement", "_relatedUserType": "rvt_elements", "_relatedUserItemId": "ex11034-inv_ba_elem_6Q4Ci61Md0" } } ] }, { "_typeName": "RevitTypeElement", "_type": "object", "_properties": { "name": { "_type": "string" }, "_id": { "_type": "string" }, "id": { "_type": "number" }, "source_id": { "_type": "string" }, "_metadata": { "_type": "object", "_properties": { "_updatedById": { "_type": "string" }, "_createdAt": { "_type": "number" }, "_createdById": { "_type": "string" }, "_updatedAt": { "_type": "number" } } }, "properties": { "_type": "object", "_properties": { "Revit Type": { "_type": "object", "_properties": { "val": { "_type": "string" }, "name": { "_type": "string" }, "dName": { "_type": "string" }, "id": { "_type": "number" } } }, "Revit Class": { "_type": "object", "_properties": { "val": { "_type": "string" }, "name": { "_type": "string" }, "dName": { "_type": "string" }, "id": { "_type": "number" } } }, "Revit Family": { "_type": "object", "_properties": { "val": { "_type": "string" }, "name": { "_type": "string" }, "dName": { "_type": "string" }, "id": { "_type": "number" } } }, "Revit Category": { "_type": "object", "_properties": { "val": { "_type": "string" }, "dVal": { "_type": "string" }, "name": { "_type": "string" }, "dName": { "_type": "string" }, "id": { "_type": "number" } } } } } }, "_relationshipTypes": [ { "_isInverse": true, "_ref": { "_relatedTypeName": "RevitElement", "_relatedUserType": "rvt_elements", "_relatedUserItemId": "ex11034-inv_ba_elem_6Q4Ci61Md0" } } ] } ], "_readingTypes": [], "_collections": [ { "_uri": "/nameduseritems/6698c3f620ae2d3c8f682f8e", "_name": "EX11034-INV-Federated_elements", "_userType": "rvt_elements", "_tipId": "6698c3f620ae2d3c8f682f8f", "_irn": "itemsvc:nameduseritem:6698c3f620ae2d3c8f682f8e", "_itemTypes": [ "RevitElement" ], "_namespaces": [ "iputgraph_w3SARCv6" ], "_nextVersion": 2, "_shortName": "EX11034-INV_ba_elem", "_tipVersion": 1, "_versionsCount": 1, "_itemClass": "NamedUserCollection", "_userItemId": "ex11034-inv_ba_elem_6Q4Ci61Md0", "_id": "6698c3f620ae2d3c8f682f8e", "_description": "Elements in BA model", "_kind": "collection" }, { "_uri": "/nameduseritems/6698c3f620ae2d3c8f682f91", "_name": "EX11034-INV-Federated_elem_props", "_userType": "rvt_element_props", "_tipId": "6698c3f620ae2d3c8f682f92", "_irn": "itemsvc:nameduseritem:6698c3f620ae2d3c8f682f91", "_itemTypes": [ "RevitElementProps" ], "_namespaces": [ "iputgraph_w3SARCv6" ], "_nextVersion": 2, "_shortName": "EX11034-INV_elprops", "_tipVersion": 1, "_versionsCount": 1, "_itemClass": "NamedUserCollection", "_userItemId": "ex11034-inv_elprops_rHf5FiueMi", "_id": "6698c3f620ae2d3c8f682f91", "_description": "Element Props in BA model", "_kind": "collection" }, { "_uri": "/nameduseritems/6698c3f760d3ef7ca08d6559", "_name": "EX11034-INV-Federated_type_el", "_userType": "rvt_type_elements", "_tipId": "6698c3f760d3ef7ca08d655a", "_irn": "itemsvc:nameduseritem:6698c3f760d3ef7ca08d6559", "_itemTypes": [ "RevitTypeElement" ], "_namespaces": [ "iputgraph_w3SARCv6" ], "_nextVersion": 2, "_shortName": "EX11034-INV_type_el", "_tipVersion": 1, "_versionsCount": 1, "_itemClass": "NamedUserCollection", "_userItemId": "ex11034-inv_type_el_xiK91Hkryj", "_id": "6698c3f760d3ef7ca08d6559", "_description": "Type Elements in BA Check model", "_kind": "collection" } ]}Get Schema Definitions#
Returns the current schema definitions for the namespace.
Endpoints#
GET /itemsvc/api/v1/schemadefinitionsRequest#
Query parameters#
| Parameter | Type | Description | Required |
|---|---|---|---|
nsfilter | String | Namespace context | Required |
Response#
Response codes#
| Code | Description |
|---|---|
200 | Success |
Response body example#
{ "_readingTypes": [ { "_typeName": "PressureReading", "_type": "object", "_properties": { "_tsMetadata": { "_type": "object", "_properties": { "_telItemId": { "_type": "string" }, "_sourceId": { "_type": "string" } } }, "pressure": { "_type": "number" }, "_ts": { "_type": "isodate" } }, "_description": "This reading captures the pressure measurement of the coolant for the chiller post-compression in PSI" } ], "_itemTypes": [ { "_typeName": "HVACSystemComponent", "_type": "object", "_properties": { "componentProperties": { "_type": "object", "_properties": { "coolingCapacityTons": { "_type": "number", "_description": "Cooling capacity in refrigeration tons." }, "efficiency": { "_type": "number", "_description": "Efficiency as a decimal (e.g., 0.85 = 85%)." }, "pressureSensorType": { "_type": "string", "_description": "Type of pressure sensor, e.g., Strain Gauge or Capacitive." } } }, "componentType": { "_type": "string", "_enum": [ "AirHandlingUnit", "HeatingCoil", "CoolingCoil", "Fan", "Damper", "TemperatureSensor", "Chiller", "Boiler", "PressureSensor" ], "_description": "The componentType property for a HVAC System Component can have the values in the enum with their description provided here. 1) AirHandlingUnit: Central mechanical unit responsible for conditioning and circulating air through the building. 2) HeatingCoil: Heat exchanger used to warm the air, typically using hot water or electric resistance. 3) CoolingCoil: Component that cools and dehumidifies air, typically using chilled water or refrigerant. 4) Fan: Moves conditioned air from the AHU to the building's ductwork or Draws air from building zones back to the AHU. 5) Damper: Regulates the intake of outside (fresh) air into the AHU. 6) TemperatureSensor: Measures the temperature of supply air leaving the AHU. 7) Chiller: Provides chilled water to the cooling coil via a closed loop. 8) Boiler: Provides hot water to the heating coil for air heating. 9) PressureSensor: Measures the pressure in the condensor post-compression" }, "componentId": { "_type": "string" } }, "_description": "A schema for all HVAC system components. These system components will have an inverse relationship with the HVAC systems in the system collection and will have relationships which show different types of connections with other HVAC system components.", "_relationshipTypes": [ { "_isInverse": true, "_userType": "hasSystemComponent", "_ref": { "_relatedTypeName": "System", "_relatedUserType": "system_collection" }, "_description": "This relationship is an inverse relationship between a System component item in this collection and System item in the System collection. The semantics of this relationship are defined by the _userType on this relationship" } ] }, { "_readingTypes": [ "PressureReading" ], "_typeName": "SensorDataPoint", "_type": "object", "_properties": { "unit": { "_type": "string", "_description": "Unit of measure, e.g. deg Celcius, PSI, etc" }, "measurementType": { "_type": "string", "_description": "The type of measurement e.g. temperature, pressure, humidity, etc" }, "_sourceId": { "_type": "string", "_description": "Id if the sensor data point" } }, "_description": "A sensor can have more than one data points. The data points are represented in this collection as TelemetryItems. The sensors in the System Components Collection can have one to many relationships with the SensorDataPoints", "_relationshipTypes": [ { "_isInverse": true, "_userType": "hasSensorDataPoint", "_ref": { "_relatedTypeName": "HVACSystemComponent", "_relatedUserType": "system_component_collection" }, "_description": "This inverse relationship is between a sensor data point item in this collection with a sensor System Component item in the System Component collection. The semantics of this relationship are defined by the _userType on this relationship" } ] }, { "_typeName": "System", "_type": "object", "_properties": { "name": { "_type": "string", "_description": "Name of the system" }, "type": { "_type": "string", "_enum": [ "HVAC", "FireProtection" ], "_description": "What type of system it is. Can be HVAC or Fire Protection" } }, "_description": "this item type represents a System in a building like HVAC, Fire protection etc. The systems have an aggregation type relationships with the system components item type", "_relationshipTypes": [ { "_isInverse": false, "_userType": "hasSystemComponent", "_ref": { "_relatedTypeName": "HVACSystemComponent", "_relatedUserType": "system_component_collection" }, "_description": "This relationship is an aggregation relationship between a System item in this collection and System component items is the System Component collection. The semantics of this relationship are defined by the _userType on this relationship" } ] } ], "_collections": [ { "_uri": "/nameduseritems/685b74152ea2a97a54135d3b", "_name": "System Collection", "_userType": "system_collection", "_tipId": "685b74152ea2a97a54135d3c", "_irn": "itemsvc:nameduseritem:685b74152ea2a97a54135d3b", "_itemTypes": [ "System" ], "_namespaces": [ "Amoghtestworkspace_m8NrvPU3" ], "_nextVersion": 2, "_shortName": "systemcoll", "_tipVersion": 1, "_versionsCount": 1, "_itemClass": "NamedUserCollection", "_userItemId": "systemcoll_1U4iBYq52f", "_id": "685b74152ea2a97a54135d3b", "_description": "this collection contains all the systems. The systems in this collection have relationships with the system components in the System Components Collection", "_metadata": { "_updatedById": "3fd24bb0-c795-47c0-a61e-33986088edc0", "_createdAt": 1750823957590, "_createdById": "3fd24bb0-c795-47c0-a61e-33986088edc0", "_updatedAt": 1750823957590 }, "_kind": "collection" }, { "_uri": "/nameduseritems/685b74152ea2a97a54135d3d", "_name": "System Components Collection", "_userType": "system_component_collection", "_tipId": "685b74152ea2a97a54135d3e", "_irn": "itemsvc:nameduseritem:685b74152ea2a97a54135d3d", "_itemTypes": [ "FireProtectionSystemComponent", "HVACSystemComponent" ], "_namespaces": [ "Amoghtestworkspace_m8NrvPU3" ], "_nextVersion": 2, "_shortName": "syscompcoll", "_tipVersion": 1, "_versionsCount": 1, "_itemClass": "NamedUserCollection", "_userItemId": "syscompcoll_v6CLcEWRWF", "_id": "685b74152ea2a97a54135d3d", "_description": "this collection contains all the system components. The system components in this collection have inverse relationships with a system in the System Collection. In addition, the components within the same system are connected to each other with relationships", "_metadata": { "_updatedById": "3fd24bb0-c795-47c0-a61e-33986088edc0", "_createdAt": 1750823957612, "_createdById": "3fd24bb0-c795-47c0-a61e-33986088edc0", "_updatedAt": 1751515978544 }, "_kind": "collection" }, { "_uri": "/nameduseritems/685b74152ea2a97a54135d45", "_name": "System Sensor Points Collection", "_userType": "systemsensor_points_collection", "_tipId": "685b74152ea2a97a54135d46", "_irn": "itemsvc:nameduseritem:685b74152ea2a97a54135d45", "_itemTypes": [ "SensorDataPoint" ], "_namespaces": [ "Amoghtestworkspace_m8NrvPU3" ], "_nextVersion": 2, "_shortName": "systemsensorptscol", "_tipVersion": 1, "_versionsCount": 1, "_itemClass": "NamedTelemetryCollection", "_userItemId": "systemsensorptscol_BsYCWFBtJG", "_id": "685b74152ea2a97a54135d45", "_description": "this collection contains the data points for all sensors in the systems and their readings. The sensors in the System Components Collection have a relationship with the sensor data points in this collection", "_metadata": { "_updatedById": "3fd24bb0-c795-47c0-a61e-33986088edc0", "_createdAt": 1750823958111, "_createdById": "3fd24bb0-c795-47c0-a61e-33986088edc0", "_updatedAt": 1750823958111 }, "_kind": "collection" } ]}Update Schema Definitions#
Replaces the schema definitions for the namespace. Use this for full updates. Please refer meta schema to define the schema
Endpoints#
PUT /itemsvc/api/v1/schemadefinitionsRequest#
Query parameters#
| Parameter | Type | Description | Required |
|---|---|---|---|
nsfilter | String | Namespace context | Required |
Request body parameters#
| Property | Type | Description | Required |
|---|---|---|---|
_readingTypes | Array of Object | List of telemetry reading types. | Optional |
_readingTypes._typeName | String | Name of the reading type. | Optional |
_readingTypes._type | String | Reading type, for example "object". | Optional |
_readingTypes._properties | Object | Schema of fields inside the reading. | Optional |
_itemTypes | Array of Object | List of domain item type definitions. | Optional |
_itemTypes._typeName | String | Name of the item type. | Optional |
_itemTypes._type | String | Item type, for example "object". | Optional |
_itemTypes._properties | Object | Schema of fields inside the item type. | Optional |
Request body example#
{ "_readingTypes": [ { "_typeName": "PressureReading", "_type": "object", "_properties": { "_tsMetadata": { "_type": "object", "_properties": { "_telItemId": { "_type": "string" }, "_sourceId": { "_type": "string" } } }, "pressure": { "_type": "number" }, "_ts": { "_type": "isodate" } }, "_description": "This reading captures the pressure measurement of the coolant for the chiller post-compression in PSI" } ], "_itemTypes": [ { "_typeName": "Asset", "_type": "object", "_properties": { "Building": { "_type": "string" }, "Floor": { "_type": "string" } } }, { "_typeName": "HVACSystemComponent", "_type": "object", "_properties": { "manufacturer": { "_type": "string" }, "coolingCapacityKW": { "_type": "number" } } } ]}Response#
Response codes#
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
Response body example#
{ "_readingTypes": [ { "_typeName": "PressureReading", "_type": "object", "_properties": { "_tsMetadata": { "_type": "object", "_properties": { "_telItemId": { "_type": "string" }, "_sourceId": { "_type": "string" } } }, "pressure": { "_type": "number" }, "_ts": { "_type": "isodate" } }, "_description": "This reading captures the pressure measurement of the coolant for the chiller post-compression in PSI" } ], "_itemTypes": [ { "_typeName": "Asset", "_type": "object", "_properties": { "Building": { "_type": "string" }, "Floor": { "_type": "string" } } }, { "_typeName": "HVACSystemComponent", "_type": "object", "_properties": { "manufacturer": { "_type": "string" }, "coolingCapacityKW": { "_type": "number" } } } ]}Update Schema Definitions - Partial#
Partially updates the schema definitions for the namespace. Use this to change a subset such as just the reading types. Please refer meta schema to define the schema
Endpoints#
PATCH /itemsvc/api/v1/schemadefinitionsRequest#
Query parameters#
| Parameter | Type | Description | Required |
|---|---|---|---|
nsfilter | String | Namespace context | Required |
Request body example#
{ "_readingTypes": [ { "_typeName": "PressureReading", "_type": "object", "_properties": { "pressure": { "_type": "number" }, "_ts": { "_type": "isodate" } }, "_description": "Pressure in PSI" } ]}Response#
Response codes#
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
Response body example#
{ "_readingTypes": [ { "_typeName": "PressureReading", "_type": "object", "_properties": { "_tsMetadata": { "_type": "object", "_properties": { "_telItemId": { "_type": "string" }, "_sourceId": { "_type": "string" } } }, "pressure": { "_type": "number" }, "_ts": { "_type": "isodate" } }, "_description": "This reading captures the pressure measurement of the coolant for the chiller post-compression in PSI" } ], "_itemTypes": [ { "_typeName": "Asset", "_type": "object", "_properties": { "Building": { "_type": "string" }, "Floor": { "_type": "string" } } }, { "_typeName": "HVACSystemComponent", "_type": "object", "_properties": { "manufacturer": { "_type": "string" }, "coolingCapacityKW": { "_type": "number" } } } ]}Download Meta Schema#
Downloads the JSON Schema describing the structure of schema definitions.
Endpoints#
GET /itemsvc/api/v1/schemadefinitions/metaschemaRequest#
Query parameters#
| Parameter | Type | Description | Required |
|---|---|---|---|
nsfilter | String | Namespace context | Required |
Response#
Response codes#
| Code | Description |
|---|---|
200 | Success |
Response body example#
{ "type": "object", "required": [ "_type" ], "properties": { "_typeName": { "type": "string" }, "_type": { "type": "string", "enum": [ "object", "array", "string", "number", "boolean", "null", "isodate" ] }, "_properties": { "type": "object", "additionalProperties": { "$ref": "#" } }, "_description": { "type": "string" }, "_items": { "$ref": "#" }, "_required": { "type": "array", "uniqueItems": true, "items": { "type": "string" } }, "_enum": { "type": "array", "uniqueItems": true, "minItems": 1, "items": { "type": [ "string", "number", "boolean", "null" ] } }, "_relationshipTypes": { "type": "array", "items": { "type": "object", "properties": { "_isInverse": { "type": "boolean" }, "_ref": { "type": "object", "properties": { "_relatedTypeName": { "type": "string" }, "_relatedUserType": { "type": "string" }, "_relatedUserItemId": { "type": "string" } } }, "_userType": { "type": "string" }, "_description": { "type": "string" } } } }, "_readingTypes": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false}