Skip to main content

Metadata

This page documents the metadata management endpoints in the VAMS API. VAMS provides a centralized metadata service that handles metadata across four entity types: assets, files, databases, and asset links.

For asset management, see Assets. For file operations, see Files.


Concepts

  • Metadata Item: A key-value pair with an associated value type. Each item consists of a metadataKey, metadataValue, and metadataValueType.
  • Metadata Value Type: The data type of the metadata value. Determines validation rules and how the value is displayed in the UI.
  • File Metadata vs. File Attributes: Both use the same API path with a type query parameter. File metadata stores descriptive information, while file attributes store operational data (e.g., primaryType).
  • Bulk Operations: All create, update, and delete operations support bulk processing of multiple metadata items in a single request. Responses include partial success information.
  • Schema Validation: When metadata schemas are configured, metadata values are validated against the schema on create and update operations.

Supported Value Types

TypeDescriptionExample Value
stringPlain text string"Building A"
multiline_stringMulti-line text"Line 1\nLine 2"
inline_controlled_listString from a controlled vocabulary"approved"
numberNumeric value"42.5"
booleanBoolean value"true" or "false"
dateISO 8601 date string"2024-06-15T10:30:00Z"
xyz3D coordinate"{\"x\": 1.0, \"y\": 2.0, \"z\": 3.0}"
wxyzQuaternion rotation"{\"w\": 1.0, \"x\": 0.0, \"y\": 0.0, \"z\": 0.0}"
matrix4x44x4 transformation matrix"[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]"
geopointGeoJSON Point"{\"type\": \"Point\", \"coordinates\": [-73.9, 40.7]}"
geojsonAny valid GeoJSON"{\"type\": \"Polygon\", \"coordinates\": [...]}"
llaLatitude/Longitude/Altitude"{\"lat\": 40.7, \"long\": -73.9, \"alt\": 100.0}"
jsonArbitrary JSON"{\"custom\": \"data\"}"
Values Are Always Strings

All metadata values are stored and transmitted as strings, regardless of type. The metadataValueType field indicates how the string should be interpreted and validated.


Asset Metadata

Asset-level metadata is attached to an asset within a database.

Get Asset Metadata

GET /database/{databaseId}/assets/{assetId}/metadata

Retrieves all metadata items for the specified asset.

Request Parameters:

ParameterLocationTypeRequiredDescription
databaseIdpathstringYesDatabase identifier.
assetIdpathstringYesAsset identifier.
maxItemsqueryintegerNoMaximum items to return. Default: 30000.
pageSizequeryintegerNoPage size for pagination. Default: 3000.
startingTokenquerystringNoContinuation token from a previous response.
assetVersionIdquerystringNoRetrieve metadata from a specific asset version snapshot.

Response:

{
"metadata": [
{
"metadataKey": "material",
"metadataValue": "concrete",
"metadataValueType": "string"
},
{
"metadataKey": "height_meters",
"metadataValue": "45.5",
"metadataValueType": "number"
},
{
"metadataKey": "position",
"metadataValue": "{\"x\": 100.0, \"y\": 50.0, \"z\": 0.0}",
"metadataValueType": "xyz"
}
],
"NextToken": "eyJ..."
}

Error Responses:

StatusDescription
400Invalid parameters or pagination token.
403Not authorized to view metadata for this asset.
404Asset not found.
500Internal server error.

Create Asset Metadata

POST /database/{databaseId}/assets/{assetId}/metadata

Adds new metadata items to an asset. Supports bulk creation of multiple items in a single request.

Request Parameters:

ParameterLocationTypeRequiredDescription
databaseIdpathstringYesDatabase identifier.
assetIdpathstringYesAsset identifier.

Request Body:

{
"metadata": [
{
"metadataKey": "material",
"metadataValue": "concrete",
"metadataValueType": "string"
},
{
"metadataKey": "height_meters",
"metadataValue": "45.5",
"metadataValueType": "number"
}
]
}
FieldTypeRequiredDescription
metadataarrayYesList of metadata items. Must contain at least one item.
metadata[].metadataKeystringYesMetadata key (1-256 characters).
metadata[].metadataValuestringYesMetadata value as string.
metadata[].metadataValueTypestringNoValue type. Default: "string".

Response:

{
"success": true,
"totalItems": 2,
"successCount": 2,
"failureCount": 0,
"successfulItems": ["material", "height_meters"],
"failedItems": [],
"message": "All 2 metadata items created successfully",
"timestamp": "2024-06-15T10:30:00Z"
}

Error Responses:

StatusDescription
400Invalid parameters, validation error, or schema validation failure.
403Not authorized to create metadata for this asset.
404Asset not found.
500Internal server error.

Update Asset Metadata

PUT /database/{databaseId}/assets/{assetId}/metadata

Updates existing metadata items for an asset. Supports two update modes.

Request Parameters:

ParameterLocationTypeRequiredDescription
databaseIdpathstringYesDatabase identifier.
assetIdpathstringYesAsset identifier.

Request Body:

{
"metadata": [
{
"metadataKey": "material",
"metadataValue": "steel",
"metadataValueType": "string"
}
],
"updateType": "update"
}
FieldTypeRequiredDescription
metadataarrayYesList of metadata items to update.
updateTypestringNo"update" (default, upserts provided items) or "replace_all" (replaces all metadata).
REPLACE_ALL Mode

The replace_all update type deletes all existing metadata and replaces it with the provided items. This mode requires the user to have PUT, POST, and DELETE permissions on the entity. It is limited to 500 items per operation and includes automatic rollback on failure.

Response:

{
"success": true,
"totalItems": 1,
"successCount": 1,
"failureCount": 0,
"successfulItems": ["material"],
"failedItems": [],
"message": "All 1 metadata items updated successfully",
"timestamp": "2024-06-15T10:30:00Z"
}

Error Responses:

StatusDescription
400Invalid parameters or validation error.
403Not authorized to update metadata for this asset.
404Asset not found.
500Internal server error.

Delete Asset Metadata

DELETE /database/{databaseId}/assets/{assetId}/metadata

Removes metadata items from an asset by key.

Request Parameters:

ParameterLocationTypeRequiredDescription
databaseIdpathstringYesDatabase identifier.
assetIdpathstringYesAsset identifier.

Request Body:

{
"metadataKeys": ["material", "height_meters"]
}
FieldTypeRequiredDescription
metadataKeysarray[string]YesList of metadata keys to delete. Must contain at least one key.

Response:

{
"success": true,
"totalItems": 2,
"successCount": 2,
"failureCount": 0,
"successfulItems": ["material", "height_meters"],
"failedItems": [],
"message": "All 2 metadata items deleted successfully",
"timestamp": "2024-06-15T10:30:00Z"
}

Error Responses:

StatusDescription
400Invalid parameters.
403Not authorized to delete metadata for this asset.
404Asset not found.
500Internal server error.

File Metadata

File-level metadata is attached to individual files within an asset. The same endpoint path handles both file metadata and file attributes, distinguished by a type query parameter.

Get File Metadata

GET /database/{databaseId}/assets/{assetId}/metadata/file

Retrieves metadata for a specific file within an asset.

Request Parameters:

ParameterLocationTypeRequiredDescription
databaseIdpathstringYesDatabase identifier.
assetIdpathstringYesAsset identifier.
keyquerystringYesRelative file path.
typequerystringNo"metadata" (default) or "attribute" to retrieve file attributes instead.
maxItemsqueryintegerNoMaximum items to return.
pageSizequeryintegerNoPage size for pagination.
startingTokenquerystringNoContinuation token.

Response:

{
"metadata": [
{
"metadataKey": "author",
"metadataValue": "John Smith",
"metadataValueType": "string"
}
],
"NextToken": null
}

Error Responses:

StatusDescription
400Invalid parameters or missing key.
403Not authorized.
404Asset or file not found.
500Internal server error.

Create File Metadata

POST /database/{databaseId}/assets/{assetId}/metadata/file

Adds metadata items to a specific file.

Request Parameters:

ParameterLocationTypeRequiredDescription
databaseIdpathstringYesDatabase identifier.
assetIdpathstringYesAsset identifier.

Request Body:

{
"key": "/models/building.ifc",
"type": "metadata",
"metadata": [
{
"metadataKey": "author",
"metadataValue": "John Smith",
"metadataValueType": "string"
}
]
}
FieldTypeRequiredDescription
keystringYesRelative file path.
typestringNo"metadata" (default) or "attribute".
metadataarrayYesList of metadata items.

Response:

Returns a bulk operation response (same format as asset metadata).

Error Responses:

StatusDescription
400Invalid parameters.
403Not authorized.
404Asset or file not found.
500Internal server error.

Update File Metadata

PUT /database/{databaseId}/assets/{assetId}/metadata/file

Updates metadata items for a specific file.

Request Body:

{
"key": "/models/building.ifc",
"type": "metadata",
"metadata": [
{
"metadataKey": "author",
"metadataValue": "Jane Doe",
"metadataValueType": "string"
}
],
"updateType": "update"
}

Response:

Returns a bulk operation response.

Error Responses:

StatusDescription
400Invalid parameters.
403Not authorized.
404Asset or file not found.
500Internal server error.

Delete File Metadata

DELETE /database/{databaseId}/assets/{assetId}/metadata/file

Removes metadata items from a specific file.

Request Body:

{
"key": "/models/building.ifc",
"type": "metadata",
"metadataKeys": ["author"]
}

Response:

Returns a bulk operation response.

Error Responses:

StatusDescription
400Invalid parameters.
403Not authorized.
404Asset or file not found.
500Internal server error.

Database Metadata

Database-level metadata is attached to a database and applies to the entire collection.

Get Database Metadata

GET /database/{databaseId}/metadata

Retrieves all metadata items for the specified database.

Request Parameters:

ParameterLocationTypeRequiredDescription
databaseIdpathstringYesDatabase identifier.
maxItemsqueryintegerNoMaximum items to return. Default: 30000.
pageSizequeryintegerNoPage size for pagination. Default: 3000.
startingTokenquerystringNoContinuation token.

Response:

{
"metadata": [
{
"metadataKey": "project_name",
"metadataValue": "Downtown Development",
"metadataValueType": "string"
},
{
"metadataKey": "project_start_date",
"metadataValue": "2024-01-15T00:00:00Z",
"metadataValueType": "date"
}
],
"NextToken": null
}

Error Responses:

StatusDescription
400Invalid parameters.
403Not authorized to view metadata for this database.
404Database not found.
500Internal server error.

Create Database Metadata

POST /database/{databaseId}/metadata

Adds metadata items to a database.

Request Parameters:

ParameterLocationTypeRequiredDescription
databaseIdpathstringYesDatabase identifier.

Request Body:

{
"metadata": [
{
"metadataKey": "project_name",
"metadataValue": "Downtown Development",
"metadataValueType": "string"
}
]
}

Response:

Returns a bulk operation response.

Error Responses:

StatusDescription
400Invalid parameters or schema validation failure.
403Not authorized.
404Database not found.
500Internal server error.

Update Database Metadata

PUT /database/{databaseId}/metadata

Updates metadata items for a database.

Request Body:

{
"metadata": [
{
"metadataKey": "project_name",
"metadataValue": "Updated Project Name",
"metadataValueType": "string"
}
],
"updateType": "update"
}

Response:

Returns a bulk operation response.

Error Responses:

StatusDescription
400Invalid parameters.
403Not authorized.
404Database not found.
500Internal server error.

Delete Database Metadata

DELETE /database/{databaseId}/metadata

Removes metadata items from a database.

Request Body:

{
"metadataKeys": ["project_name"]
}

Response:

Returns a bulk operation response.

Error Responses:

StatusDescription
400Invalid parameters.
403Not authorized.
404Database not found.
500Internal server error.

Metadata can be attached to asset links (relationships between assets).

GET /asset-links/{assetLinkId}/metadata

Retrieves all metadata items for the specified asset link.

Request Parameters:

ParameterLocationTypeRequiredDescription
assetLinkIdpathstringYesAsset link identifier (UUID).
maxItemsqueryintegerNoMaximum items to return. Default: 30000.
pageSizequeryintegerNoPage size for pagination. Default: 3000.
startingTokenquerystringNoContinuation token.

Response:

{
"metadata": [
{
"metadataKey": "relationship_type",
"metadataValue": "structural_support",
"metadataValueType": "string"
}
],
"NextToken": null
}

Error Responses:

StatusDescription
400Invalid parameters or pagination token.
403Not authorized to view metadata for this asset link.
404Asset link not found.
500Internal server error.

POST /asset-links/{assetLinkId}/metadata

Adds metadata items to an asset link. Supports bulk creation.

Request Parameters:

ParameterLocationTypeRequiredDescription
assetLinkIdpathstringYesAsset link identifier (UUID).

Request Body:

{
"metadata": [
{
"metadataKey": "relationship_type",
"metadataValue": "structural_support",
"metadataValueType": "string"
}
]
}

Response:

Returns a bulk operation response.

Error Responses:

StatusDescription
400Invalid parameters or validation error.
403Not authorized.
404Asset link not found.
500Internal server error.

PUT /asset-links/{assetLinkId}/metadata

Updates metadata items for an asset link.

Request Parameters:

ParameterLocationTypeRequiredDescription
assetLinkIdpathstringYesAsset link identifier (UUID).

Request Body:

{
"metadata": [
{
"metadataKey": "relationship_type",
"metadataValue": "updated_value",
"metadataValueType": "string"
}
],
"updateType": "update"
}
FieldTypeRequiredDescription
metadataarrayYesList of metadata items to update.
updateTypestringNo"update" (default) or "replace_all".

Response:

Returns a bulk operation response.

Error Responses:

StatusDescription
400Invalid parameters.
403Not authorized.
404Asset link not found.
500Internal server error.

DELETE /asset-links/{assetLinkId}/metadata

Removes metadata items from an asset link.

Request Parameters:

ParameterLocationTypeRequiredDescription
assetLinkIdpathstringYesAsset link identifier (UUID).

Request Body:

{
"metadataKeys": ["relationship_type"]
}

Response:

Returns a bulk operation response.

Error Responses:

StatusDescription
400Invalid parameters.
403Not authorized.
404Asset link not found.
500Internal server error.

Bulk Operation Response Format

All metadata create, update, and delete operations return a consistent bulk operation response:

{
"success": true,
"totalItems": 3,
"successCount": 2,
"failureCount": 1,
"successfulItems": ["key1", "key2"],
"failedItems": [
{
"key": "key3",
"error": "Validation failed: value must be a valid number"
}
],
"message": "2 of 3 metadata items processed successfully",
"timestamp": "2024-06-15T10:30:00Z"
}
FieldTypeDescription
successbooleantrue if at least one item succeeded.
totalItemsintegerTotal number of items in the request.
successCountintegerNumber of items that succeeded.
failureCountintegerNumber of items that failed.
successfulItemsarray[string]List of metadata keys that succeeded.
failedItemsarray[object]List of failed items with error details.
messagestringHuman-readable summary of the operation.
timestampstringISO 8601 timestamp of the operation.
Partial Success

Bulk operations can partially succeed. Check both successCount and failureCount to determine the overall result. The failedItems array provides per-item error details for troubleshooting.


Metadata Limits

LimitValueDescription
Maximum metadata records per entity500Maximum number of metadata key-value pairs per asset, file, database, or asset link.
Maximum key length256 charactersMaximum length of a metadataKey.
Maximum items per REPLACE_ALL500Maximum metadata items in a single replace_all operation.