1Save Data Security Rules Mapping
Overview
This API adds or updates the Data Security Rules mapping for a Semantic Model.
Method: POST
Request URL: {kyvos-url}/rest/v2/semantic-models/{name-or-id}/data-security-rules-mappings
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 |
|---|---|---|---|
Content-Type (Required) | String | Specifies the media type of the request body. |
|
sessionid | String | The session ID is the token received from the Login API. Note: Session ID is required for token-based authentication. | – |
Path Parameters
Parameter Name | Type | Description | Possible Values |
|---|---|---|---|
name-or-id (Required) | String | Name or ID of the Semantic Model for which the data security rules mapping is to be saved. Note: If the Semantic Model name is provided, then either folderName or folderId 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 |
|---|---|---|---|
rulesMappingJson (Required) | String | JSON containing Data Security Rules mappings. Note: An example JSON is provided under the Resources section below. | – |
folderName | String | Name of the folder containing the Semantic Model. If the Semantic Model is present in the root directory, specify Note: If neither folderId nor folderName is provided, the Semantic Model will be treated as a root-level entity by default. | – |
folderId | String | ID of the folder containing the Semantic Model. | – |
Responses
200 Success
{
"res": [
{
"code": 0,
"entityId": "RULE_17778799388428127041054164258650",
"message": "Successfully replaced the rule:second-new-rule",
"extMessage": "Successfully replaced the rule:second-new-rule"
}
]
}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 rulesMappingJson parameter in the request body.
{
"rulesMappings":[
{
"appDetails":[
{
"name":"user1",
"id":"397039469",
"type":"USER"
}
],
"rules":[
{
"name":"Allow All Rows",
"id":"RULE_ALLOW_ALL_ROWS"
},
{
"name":"Allow All Columns",
"id":"RULE_ALLOW_ALL_COLUMNS"
}
],
"id":"RULES_MAPPING_17754804489725127050095140091501"
},
{
"appDetails":[
{
"name":"new-group-user1",
"id":"12345",
"type":"GROUP"
}
],
"rules":[
{
"name":"New-rule",
"id":"RULE_17754804815658127093067137855675"
}
],
"id":"RULES_MAPPING_17778795583625127078021163972300"
},
{
"appDetails":[
{
"name":"Automation_2 20260320223405",
"id":"17740316239148127070068122854696",
"type":"GROUP"
}
],
"rules":[
{
"name":"Allow All Rows",
"id":"RULE_ALLOW_ALL_ROWS"
},
{
"name":"Allow All Columns",
"id":"RULE_ALLOW_ALL_COLUMNS"
}
],
"id":"RULES_MAPPING_17754802858081127038063175990243"
},
{
"appDetails":[
{
"name":"user2",
"id":"409021709",
"type":"USER"
}
],
"rules":[
{
"name":"Allow All Rows",
"id":"RULE_ALLOW_ALL_ROWS"
},
{
"name":"Allow All Columns",
"id":"RULE_ALLOW_ALL_COLUMNS"
}
],
"id":"RULES_MAPPING_17792621944592127068045144683383"
}
]
}JSON Fields Description
Field | Type | Description | Possible Values | Example |
rulesMappings | Array | Root array containing data security rules mapping definitions. Each mapping assigns security rules to users or groups | Array of RulesMapping objects | [{...}] |
rulesMappings[].id | String | Unique identifier for this rules mapping entry. Auto-generated if not provided | GUID | "RULES_MAPPING_17764122062715" |
rulesMappings[].appDetails | Array | Array of user or group details to which the security rules are assigned. Defines WHO gets the security rules | Array of AppDetail objects | [{...}] |
rulesMappings[].appDetails[].id | String | Unique identifier of the user or group. This is the system-generated ID for the user/group in Kyvos | User/Group GUID | "user_17764122062715" |
rulesMappings[].appDetails[].type | String | Type of the entity - whether it's a user or a group | "USER","GROUP" | "USER" |
rulesMappings[].appDetails[].name | String | Display name of the user or group. Used for identification and display purposes in UI | User/Group name | "john.doe" |
rulesMappings[].rules | Array | Array of data security rules assigned to the users/groups in appDetails. Defines WHICH rules are applied | Array of Rule objects | [{...}] |
rulesMappings[].rules[].id | String | Unique identifier of the data security rule being assigned. Must reference an existing rule created via Save Data Security Rules API | Rule GUID | "rule_17764122062715" |
rulesMappings[].rules[].name | String | Display name of the data security rule. Optional - used for reference and display purposes | Rule name | "Sales Region Access Rule" |