---
updatedAt: 2026-04-21T03:40:36.000Z
agentTools:
  projectIndex: https://docs.ternary.app/llms.txt
---

# Create scoped view

Create a scoped view that applies default filters to restrict data visibility for users. Scoped views enforce data boundaries across reports and dashboards.

See [Scoped Views](https://docs.ternary.app/docs/scoped-views) for configuration guidance.

Names must be nonempty and contain no HTML. PRIVATE creation requires `userConfigs` to be absent or empty. Assigned users must belong to the tenant. These creation rules differ from the private-view update limit.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Core API",
    "description": "Ternary Resource Management API",
    "version": "1.0.0",
    "contact": {},
    "license": {
      "name": "MIT",
      "identifier": "MIT"
    }
  },
  "tags": [
    {
      "name": "Scoped View",
      "description": "Manage scoped views that apply default filters to restrict data visibility."
    }
  ],
  "servers": [
    {
      "url": "https://core-api.ternary.app/api",
      "description": "Core API"
    },
    {
      "url": "https://core-api.eu.ternary.app/api",
      "description": "Core API (EU)"
    }
  ],
  "externalDocs": {
    "description": "Raw JSON",
    "url": "https://core-api.ternary.app/api/docs.json"
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "Operator": {
        "type": "string",
        "enum": [
          "CONTAINS",
          "EQUALS",
          "GT",
          "GTE",
          "LT",
          "LTE",
          "REGEX_MATCHES",
          "NOT_CONTAINS",
          "NOT_EQUALS",
          "NOT_SET",
          "SET"
        ],
        "description": "The comparison a filter applies to a dimension."
      },
      "FailureResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "HTTP status code",
            "example": "400 - Bad Request"
          },
          "message": {
            "type": "string",
            "description": "Error message",
            "example": "ERROR_INVALID_PARAMS"
          },
          "reason": {
            "type": "string",
            "description": "Error reason code"
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "CreateScopedViewResponseBody": {
        "type": "object",
        "properties": {
          "scopedViewID": {
            "type": "string"
          }
        },
        "required": [
          "scopedViewID"
        ]
      },
      "CreateScopedViewRequestBody": {
        "type": "object",
        "properties": {
          "tenantID": {
            "type": "string",
            "format": "uuid",
            "description": "A unique identifier for an organization",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "example": "92f36764-5af2-4ff5-a494-d841f32040be"
          },
          "applyToNewUserStatus": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "DISABLED",
              "ENABLED",
              "ENABLED_STRICT",
              "ENFORCED",
              null
            ],
            "description": "Applied scoped view status to a new user"
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScopedViewFilterInput"
            },
            "description": "Scoped view filters"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Scoped view name"
          },
          "type": {
            "type": "string",
            "enum": [
              "ADMIN",
              "PRIVATE"
            ],
            "description": "Scoped view type"
          },
          "userConfigs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "userID": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                  "example": "92f36764-5af2-4ff5-a494-d841f32040be"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "DISABLED",
                    "ENABLED",
                    "ENABLED_STRICT",
                    "ENFORCED"
                  ]
                }
              },
              "required": [
                "userID",
                "status"
              ]
            },
            "description": "Scoped view user configs"
          }
        },
        "required": [
          "tenantID",
          "filters",
          "name",
          "type"
        ]
      },
      "ScopedViewFilterInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Filter field name"
          },
          "operator": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Operator"
              },
              {
                "description": "Filter operator"
              }
            ]
          },
          "values": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Filter values"
          }
        },
        "required": [
          "name",
          "operator",
          "values"
        ]
      }
    }
  },
  "paths": {
    "/scoped-views": {
      "post": {
        "summary": "Create scoped view",
        "tags": [
          "Scoped View"
        ],
        "operationId": "createScopedView",
        "description": "Create a scoped view that applies default filters to restrict data visibility for users. Scoped views enforce data boundaries across reports and dashboards.\n\nSee [Scoped Views](https://docs.ternary.app/docs/scoped-views) for configuration guidance.\n\nNames must be nonempty and contain no HTML. PRIVATE creation requires `userConfigs` to be absent or empty. Assigned users must belong to the tenant. These creation rules differ from the private-view update limit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScopedViewRequestBody"
              },
              "examples": {
                "createScopedView": {
                  "value": {
                    "tenantID": "92f36764-5af2-4ff5-a494-d841f32040be",
                    "applyToNewUserStatus": "DISABLED",
                    "filters": [
                      {
                        "name": "category",
                        "operator": "CONTAINS",
                        "values": [
                          "Analytics",
                          "eng"
                        ]
                      }
                    ],
                    "name": "Analytics team billing view",
                    "type": "ADMIN",
                    "userConfigs": [
                      {
                        "userID": "6fa85f64-5717-4309-b3fc-2c963f66afa4",
                        "status": "ENABLED"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateScopedViewResponseBody"
                },
                "examples": {
                  "createScopedView": {
                    "value": {
                      "scopedViewID": "yYkmSHSDag4PHcYj09ba"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResponse"
                },
                "examples": {
                  "400Response": {
                    "value": {
                      "code": "400 - Bad Request",
                      "message": "ERROR_INVALID_PARAMS"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResponse"
                },
                "examples": {
                  "401Response": {
                    "value": {
                      "code": "401 - Unauthorized",
                      "message": "ERROR_UNAUTHORIZED"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResponse"
                },
                "examples": {
                  "403Response": {
                    "value": {
                      "code": "403 - Forbidden",
                      "message": "ERROR_PERMISSION_DENIED"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The tenant or required user does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailureResponse"
                },
                "examples": {
                  "404Response": {
                    "value": {
                      "code": "404 - Not Found",
                      "message": "HTTP/ERROR",
                      "reason": "CreateScopedViewCommandFailure/TENANT_NOT_FOUND"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-tagGroups": [
    {
      "name": "Core API",
      "tags": [
        "Alert Rule",
        "Alert Rule Events",
        "API Keys",
        "AWS Rate Recommendations",
        "Azure Rate Recommendations",
        "Billing Rules",
        "Budget",
        "Cases",
        "Cost Alerts",
        "Custom Label",
        "Custom Measures",
        "Data Integration",
        "Data Integration: Alibaba",
        "Data Integration: AWS",
        "Data Integration: Azure",
        "Data Integration: Custom Data",
        "Data Integration: Databricks",
        "Data Integration: GCP",
        "Data Integration: Oracle",
        "Data Integration: Snowflake",
        "Dimension Preferences",
        "GCP Rate Recommendations",
        "Integrations",
        "Label Map",
        "MCP Availability",
        "MCP Client Usage",
        "Measure Preferences",
        "MSP Billing Information",
        "MSP Child",
        "MSP Shared Payer Integrations",
        "MSP Tenant Settings",
        "Permissions",
        "Ramp Plans",
        "Report",
        "Resource Subscriptions",
        "Role",
        "Savings Opportunity Filter",
        "Scoped View",
        "Support Tickets",
        "Tenant",
        "Tenant SSO Config",
        "Usage Recommendations",
        "User",
        "User Group Config"
      ]
    }
  ]
}
```