Create Data Security Rules

Create Data Security Rules

This documentation is for Kyvos 2026.6.x. To view documentation for other Kyvos versions, click here.

This documentation is for Kyvos 2026.6.x. To view documentation for other Kyvos versions, click here.

Overview

This API creates Data Security Rules for a Semantic Model. It allows you to define column-level restrictions and masking rules. The masking value must match the data type of the column. For example, numeric columns should be masked with a numeric value, date columns with a date value, and string columns with either a string or a regular expression.

Method: POST

Request URL: {kyvos-url}/rest/v2/semantic-models/data-security-rules


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

Header Name

Type

Description

Possible Values

Content-Type (Required)

String

Specifies the media type of the request body.

application/x-www-form-urlencoded

sessionid

String

The session ID is the token received from the login API.

Note: Session ID is required for token-based authentication.

–


Request Body

Parameter Name

Type

Description

Possible Values

Parameter Name

Type

Description

Possible Values

rulesJson (Required)

String

JSON string that defines column-level restrictions. Configure restrictions for individual columns by specifying objects in the columnLevelRule array and setting the restriction property for each column.

Note: An example JSON is provided under the Resources section below.

–

bulk

Boolean

Indicates whether the request should be processed as a bulk operation for creating or updating rules.

true / false

Default: false


Responses

200 Success

{ "code": 0, "message": "Successfully added semantic model object: Account Model" }

Status Code

Description

Status Code

Description

401

Authorization information is missing or invalid.

404

Connection, database, schema, or table not found.

412

Precondition failed. Required parameter is missing.

500

Internal Server Error


Resources

Below is an example of JSON structure which can be used as a reference for the rulesJson parameter in the request body.

{ "semanticModelName":"account1", "folderName":"Admin", "ruleName":"Allow All Columns", "description":"", "dataSecurityRule":{ "rowLevelRule":[ { "fieldName":"date", "fieldType":"LEVEL", "dimensionName":"RestAPI", "restriction":"RESTRICT_DATA", "operator":"INLIST", "value":"6" } ] } }

Copyright Kyvos, Inc. 2026. All rights reserved.