Create Perspective Model
This documentation is for Kyvos 2026.6.x. To view documentation for other Kyvos versions, click here. |
|---|
Overview
This API creates a new Perspective Model based on an existing base Semantic Model. The Perspective Model exposes only a subset of the base model's dimensions, hierarchies, attributes, etc. for specific users or groups.
Method: POST
Request URL: {kyvos-url}/rest/v2/semantic-models/{name-or-id}/perspective-model
Authorization
API Key: sessionid
This method authenticates requests using a session ID which acts like an API key.
BasicAuth: HTTP Authorization Scheme
This method authenticates requests using a username and password sent in the HTTP Authorization header.
Headers
Header Name | Type | Description | Possible Values |
|---|---|---|---|
sessionid | String | The session ID is the token received from the login API. Note: Session ID is required for token-based authentication. | – |
Content-Type (Required) | String | Specifies media type of request body. |
|
Path Parameters
Parameter Name | Type | Description | Possible Values |
|---|---|---|---|
name-or-id (Required) | String | Name or ID of the base Semantic Model from which the Perspective Model will be created. Note: If the Semantic Model name is provided, either baseFolderName or baseFolderId must also be provided. | – |
Query Parameters
Parameter Name | Type | Description | Possible Values |
|---|---|---|---|
by | String | Specifies whether the name-or-id parameter should be interpreted as a Semantic Model name or Semantic Model ID. If by=name, provide the Semantic Model name in the name-or-id parameter. If by=id, provide the Semantic Model ID in the name-or-id parameter. The default value is name. | – |
Request Body
Parameter Name | Type | Description | Possible Values |
|---|---|---|---|
baseFolderName | String | Folder name in which the base Semantic Model is located. If the Semantic Model is present in the root directory, specify [Root]. Note: If neither baseFolderName nor baseFolderId is provided, the Semantic Model will be treated as a root-level entity by default. | – |
baseFolderId | String | Folder ID in which the base Semantic Model is located. | – |
perspectiveName (Required) | String | Name of the Perspective Model to be created. | – |
perspectiveFolderName | String | Name of the folder in which the Perspective Model will be created. Note: Either perspectiveFolderName or perspectiveFolderId must be provided. | – |
perspectiveFolderId | String | ID of the folder in which the Perspective Model will be created. | – |
perspectiveModelJson (Required) | String | JSON definition containing dimensions, attributes, hierarchies and measures for the Perspective Model. Note: An example JSON is provided under the Resources section below. | – |
Responses
200 Success
{
"status": "SUCCESS",
"message": "Perspective Model created successfully."
}Status Code | Description |
|---|---|
401 | Authorization information is missing or invalid. |
404 | No matching record found. |
412 | Precondition failed. Parameter missing. |
500 | Internal Server Error |
Resources
Below is an example of JSON structure which can be used as a reference for the perspectiveModelJson parameter in the request body.
{
"dimensions":[
{
"name":"CustomerName"
},
{
"name":"Geo",
"attributes":[
{
"name":"PostalCode"
}
],
"hierarchies":[
{
"name":"H_Orders Date"
}
]
}
],
"measures":[
{
"name":"FOA_1"
},
{
"name":"Sum Sales"
}
]
}JSON Fields Description
Field | Type | Description | Possible values | Example |
dimensions | Array of objects | List of dimensions to include in the perspective model. A dimension is a business category used to organize or group data, such as Date, Product, Employee, or Region.At least one supplied dimension must match a visible dimension in the base model. | Array of dimension objects. Each selected name must match a visible dimension in the base model. | `[{"name":"Date"},{"name":"Employee","attributes":[...],"hierarchies":[...]}]` |
dimensions[].name | String | Name of a dimension from the base semantic model to include in the perspective model. Required | Must exactly match a visible base-model dimension name. | `"Employee"` |
dimensions[].attributes | Array of objects | Lists only the attributes from this dimension that should be available. Attributes are descriptive fields such as Department, City, Category, or Base Rate. Optional | Array of attribute objects, each with `name`. If supplied with one or more entries, only those valid visible attributes are included. | `[{"name":"Department"},{"name":"baserate"}]` |
dimensions[].attributes[].name | String | Display name of an attribute from the selected base-model dimension. Required for every attribute. | Must exactly match a visible attribute display name under the selected dimension. | `"Department"` |
dimensions[].hierarchies | Array of objects | Lists only the hierarchies from this dimension that should be available. A hierarchy defines a drill path, such as Year → Quarter → Month or Country → State → City. Optional | Array of hierarchy objects, each with `name`. If supplied with one or more entries, only those valid visible hierarchies are included. | `[{"name":"H_Employee"}]` |
dimensions[].hierarchies[].name | String | Name of a hierarchy from the selected base-model dimension. Required for every `hierarchies` item. | Must exactly match a visible hierarchy name under the selected dimension. | `"H_Employee"` |
measures | Array of objects | List of numeric values or calculated business metrics to include in the perspective model, such as Sales Amount, Order Quantity, or Profit. At least one supplied measure must match a visible measure in the base model. | Array of measure objects. Each selected name must match a visible base-model measure name. | `[{"name":"Order Quantity"},{"name":"Unit PriceD"}]` |
measures[].name | String | Name of a measure from the base semantic model to include in the perspective model. Required for every `measures` item. | Must exactly match a visible base-model measure name. Kyvos automatically keeps the base model’s default measure where available; otherwise it selects the first valid requested measure as default. | `"Order Quantity"` |