Overview of Views

With the Matterport Model API, you can query existing View IDs, add new Views, or delete existing Views for a space.

Up to 10 unique Views can be created in your digital twin for different groups or teams. Each View is shareable with its own tags, tours, and more. You can use this, for example, to promote various features to different clients or create multiple views of the same space for different training modules or teams.

More Information on Views

Views FAQ

Overview of Layers

Layers are coming soon to the Model API.

Layers let visitors to your model show or hide groupings of Tags, Labels, Notes, and Measurements. Layers are conceptually similar to Views in that they’re collections of edits that you group together. Layers provide a different level of organization. If you use Views, Layers are nestled under Views. Visitors can select checkboxes to see all, some, or none of the Layers in your View.

Working with Layers

Query Views

Retrieve View IDs for a model.

Query View IDs

The following query returns the ID and a few other details for Views in a space.

query getViewIDs($modelId: ID!){
  model(id: $modelId){
    id
    name
    views{
      id
      name
      type
      modified
    }
  }
}

# variables
{
  "modelId": "Dyc2vZg54be"
}

Sample Response:

{
  "data": {
    "model": {
      "id": "Dyc2vZg54be",
      "name": "Demo Space",
      "views": [
        {
          "id": "Dyc2vZg54be",
          "name": "Main View",
          "type": "matterport.model.layered",
          "modified": "2023-11-16T18:13:14Z"
        },
        {
          "id": "0ehmdabhd31ra7pyai5igb9sb",
          "name": "Training View",
          "type": "matterport.user.view",
          "modified": "2023-11-16T17:38:05Z"
        },
        {
          "id": "w3mc532z2qgs2i20z0wz1y0wc",
          "name": "Data View",
          "type": "matterport.user.view",
          "modified": "2023-11-16T18:12:45Z"
        }
      ]
    }
  }
}

Try this query in our interactive console

Query a View

You can use a View ID where you would use a Model ID to query data about the View.

query getModelData($modelID: ID!){
  model(id: $modelID){
    id
    created
    modified
    mattertags{
      id
      label
      description
    }
  }
}

# variables
{
  "modelID": "w3mc532z2qgs2i20z0wz1y0wc"
}

Sample Response:

{
  "data": {
    "model": {
      "id": "w3mc532z2qgs2i20z0wz1y0wc",
      "created": "2023-11-16T17:38:16Z",
      "modified": "2023-11-16T18:55:35Z",
      "mattertags": [
        {
          "id": "p3fUvV5RLEY",
          "label": "Data Tag",
          "description": "My Data here"
        }
      ]
    }
  }
}

Try this query in our interactive console

Add or Delete Views

Add a View to a model
mutation addView($modelId: ID!, $name: String,){
  addView(
    id: $modelId,
    name: $name,
    enabled: true,
    generateIds: false
  ){
    id
    name
    type
    model{
      id
      name
    }
    modified
  }
}
# variables
{
  "modelId": "Dyc2vZg54be",
  "name": "my new view"
}

Sample Response:

{
  "data": {
    "addView": {
      "id": "dwexd66y2xsfxuxqbrzkb73fc",
      "name": "my new view",
      "type": "matterport.user.view",
      "model": {
        "id": "dwexd66y2xsfxuxqbrzkb73fc",
        "name": "Demo Space"
      },
      "modified": "2023-11-16T22:14:59Z"
    }
  }
}

Try this query in our interactive console

Delete a View in a model
mutation deleteView($modelId: ID!, $viewId: ID!){
  deleteView(id: $modelId, viewId: $viewId)
}
# variables
{
  "modelId" : "Dyc2vZg54be",
  "viewId": "dwexd66y2xsfxuxqbrzkb73fc"
}

Sample Response:

{
  "data": {
    "deleteView": true
  }
}

Try this query in our interactive console