

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "3DDS Metadata Service API",
    "description": "Provides endpoints to query 3D model hierarchy and metadata.",
    "contact": {
      "name": "API Support",
      "x-slack-channel-alerts": "#unity-cloud-support"
    },
    "license": {
      "name": "Unity Legal",
      "url": "https://unity.com/legal"
    },
    "version": "1"
  },
  "servers": [
    {
      "url": "https://services.api.unity.com/assets/data-streaming/v1",
      "description": "Production"
    }
  ],
  "paths": {
    "/projects/{projectId}/assets/{assetId}/versions/{assetVersion}/datasets/{datasetId}/instances/groups/{groupId}": {
      "get": {
        "tags": [
          "Assets"
        ],
        "summary": "Get the requested metadata for all instances inside a group.",
        "description": "Allows 3DDS viewers to download metadata of instances contained in a specific tile in order to enable efficient filtering and highlighting of displayed instances.",
        "operationId": "GetAssetMetadataGroup",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The identifier of the Unity project containing the asset.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetId",
            "in": "path",
            "description": "The identifier of the asset.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetVersion",
            "in": "path",
            "description": "The asset version.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "datasetId",
            "in": "path",
            "description": "The identifier of the dataset within the asset.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "description": "The identifier of the group.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "The list of root level fields to return in the response. If unspecified, all fields will be returned.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a dictionary of metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetGroupMetadataResponse"
                }
              }
            }
          },
          "404": {
            "description": "When the asset, asset version or dataset does not exist, or if the dataset is not the result of a 3d data streaming transformation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/projects/{projectId}/assets/{assetId}/versions/{assetVersion}/datasets/{datasetId}/instances/filter": {
      "post": {
        "tags": [
          "Assets"
        ],
        "summary": "Get the requested metadata info from an asset's dataset.",
        "description": "Allows navigating and filtering the hierarchy of the 3D model.",
        "operationId": "GetAssetMetadata",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The identifier of the Unity project containing the asset.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetId",
            "in": "path",
            "description": "The identifier of the asset.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetVersion",
            "in": "path",
            "description": "The asset version.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "datasetId",
            "in": "path",
            "description": "The identifier of the dataset within the asset.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The cursor from where the next set of items should be returned, obtained from the next property of a previous response.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of items that should be returned by the query.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "description": "The body of the request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetMetadataFilter"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetMetadataFilter"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetMetadataFilter"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns a dictionary of metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDatasetMetadataResponse"
                }
              }
            }
          },
          "404": {
            "description": "When the asset, asset version or dataset does not exist, or if the dataset is not the result of a 3d data streaming transformation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/projects/{projectId}/assets/{assetId}/versions/{assetVersion}/datasets/{datasetId}/instances/keys": {
      "get": {
        "tags": [
          "Assets"
        ],
        "summary": "Get all possible root keys in the asset's dataset",
        "description": "All distinct root level metadata keys found in the 3D model will be returned.",
        "operationId": "GetAssetMetadataKeys",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The identifier of the Unity project containing the asset.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetId",
            "in": "path",
            "description": "The identifier of the asset.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetVersion",
            "in": "path",
            "description": "The asset version.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "datasetId",
            "in": "path",
            "description": "The identifier of the dataset within the asset.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "The pagination offset.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of keys to return.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of root keys as string.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetMetadataKeysResponse"
                }
              }
            }
          },
          "404": {
            "description": "When the asset, asset version or dataset does not exist, or if the dataset is not the result of a 3d data streaming transformation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ByteRange": {
        "type": "object",
        "properties": {
          "offset": {
            "type": "integer",
            "description": "The start of the range.",
            "format": "int64"
          },
          "length": {
            "type": "integer",
            "description": "The size of file.",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "The byte range where the content is located inside the file."
      },
      "DatasetMetadataFilter": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A subset of elements to filter on.",
            "nullable": true
          },
          "whereConditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WhereCondition"
            },
            "description": "The filter to apply on metadata. All specified conditions must match for a result to be returned.",
            "nullable": true
          },
          "selectedKeys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The metadata keys to return. Use null to return all keys and empty array to return no keys.",
            "nullable": true
          },
          "parentId": {
            "type": "string",
            "description": "The root element in the hierarchy to search from.",
            "format": "uuid",
            "nullable": true
          },
          "maxDepth": {
            "type": "integer",
            "description": "The maximum depth to search for in the hierarchy relative to ParentId.",
            "format": "int32",
            "nullable": true
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The list of root level fields to return in the response. If unspecified, all fields will be returned.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Metadata filtering parameters."
      },
      "Geometry": {
        "type": "object",
        "properties": {
          "worldTransform": {
            "maxItems": 16,
            "minItems": 16,
            "type": "array",
            "items": {
              "type": "number",
              "format": "double"
            },
            "description": "The world transform of the element, expressed as a 4x4 matrix. The matrix is provided in a column-major order with the translation in the last four elements. The coordinate system is right-handed, with y-axis pointing upward, and using meters as the base unit."
          },
          "boundingBox": {
            "maxItems": 12,
            "minItems": 12,
            "type": "array",
            "items": {
              "type": "number",
              "format": "double"
            },
            "description": "The bounding box of the element. The array of 12 numbers defines an oriented bounding box in a right-handed coordinate system where the y-axis is up. The first three numbers define the x, y, and z values for the center of the box. The next three numbers (with indices 3, 4, and 5) define the x-axis direction and half-length. The next three numbers (indices 6, 7, and 8) define the y-axis direction and half-length. The last three numbers (indices 9, 10, and 11) define the z-axis direction and half-length."
          },
          "content": {
            "$ref": "#/components/schemas/Location"
          }
        },
        "additionalProperties": false,
        "description": "The geometry of an element."
      },
      "GetDatasetMetadataResponse": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Match"
            },
            "description": "Elements matching the filter."
          },
          "next": {
            "type": "string",
            "description": "The value to be used as the cursor parameter to navigate to the next set of results. A null value means that the end of the result set has been reached.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The response of the filter endpoint."
      },
      "GetGroupMetadataResponse": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupMatch"
            },
            "description": "All instances that are part of this group."
          }
        },
        "additionalProperties": false,
        "description": "The response of the instance groups endpoint."
      },
      "GetMetadataKeysResponse": {
        "type": "object",
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The list of all possible metadata keys contained in the dataset."
          },
          "offset": {
            "type": "integer",
            "description": "The offset of the first result returned.",
            "format": "int32"
          },
          "limit": {
            "type": "integer",
            "description": "The maximum number of results to return.",
            "format": "int32"
          },
          "total": {
            "type": "integer",
            "description": "The total number of metadata keys available.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Response returned by the GetMetadataKeys endpoint."
      },
      "GroupMatch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The identifier of the element in the hierarchy.",
            "nullable": true
          },
          "parentId": {
            "type": "string",
            "description": "The identifier of the immediate parent of this element.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "An element of the instance groups endpoint response."
      },
      "Location": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string",
            "description": "The Uri of the content file."
          },
          "range": {
            "$ref": "#/components/schemas/ByteRange"
          }
        },
        "additionalProperties": false,
        "description": "The location of a geometric payload."
      },
      "Match": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The identifier of the element in the hierarchy.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "The name of the element in the hierarchy.",
            "nullable": true
          },
          "ancestorIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Identifiers of the ancestors, starting from the root.",
            "nullable": true
          },
          "hasChildren": {
            "type": "boolean",
            "description": "Whether this element has children elements.",
            "nullable": true
          },
          "requestedMetadata": {
            "description": "The metadata of the element.",
            "nullable": true
          },
          "geometry": {
            "$ref": "#/components/schemas/Geometry"
          }
        },
        "additionalProperties": false,
        "description": "An element of the filter endpoint response."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "WhereCondition": {
        "type": "object",
        "properties": {
          "path": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The path to the property to filter on."
          },
          "value": {
            "type": "string",
            "description": "The value of the property to filter on.",
            "nullable": true
          },
          "operator": {
            "$ref": "#/components/schemas/WhereConditionOperator"
          }
        },
        "additionalProperties": false,
        "description": "Object used to filter on metadata fields."
      },
      "WhereConditionOperator": {
        "enum": [
          "Equals",
          "NotEquals"
        ],
        "type": "string",
        "description": "The operator to use when comparing values specified in WhereCondition."
      }
    },
    "securitySchemes": {
      "Client": {
        "type": "http",
        "description": "To get started with Authentication, please visit the [Client Authentication section](https://services.docs.unity.com/docs/client-auth).",
        "scheme": "bearer"
      },
      "ServiceAccount": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "Client": []
    },
    {
      "ServiceAccount": []
    }
  ],
  "tags": [
    {
      "name": "Assets",
      "description": "Navigate and search the hierarchy of a 3D model."
    }
  ]
}
```