API Reference > Manage data access assets > Data filter API
  

Data filter API

Use the data filter API to create, update, delete, or retrieve data filter policies and data filter rules.
Data filter policies restrict or limit the records that Data Access Management delivers to users.
For more information on data filter rules, see Creating data filter rules in the Data Governance and Catalog help.

Retrieve data filter assets

Send a GET request to retrieve the details of data filter policies and data filter rules. The prefix, indicated by <prefix>, for each endpoint is /data360/dam/api/v1/.

Methods and endpoints

The following table describes retrieval methods and associated endpoints for the data filter API:
Method
Endpoint
Description
GET
<baseApiUrl><prefix>/data-filters
Retrieve the list of all published data filter policies.
GET
<baseApiUrl><prefix>/data-filters/{ID}
Retrieve the draft or published version of a specified data filter policy.

Request parameters

The following table describes the parameters that you can specify in the endpoint of the request:
Parameter
Type
Description
offset
Integer
Optional. Specify the record number from which to begin returning assets. The default value is zero.
limit
Integer
Optional. Specify the total number of records to return. The default value is 500.
fetchDraft
Boolean
Optional. Retrieve the draft version of a specified data filter policy. When using the <baseApiUrl><prefix>/data-filters/{ID} endpoint, use fetchDraft=true.The default value is false.
Note:
To retrieve the draft version of all data filter policies, see Retrieve assets in the catalog.

Create data filter assets

Send a POST request to create data filter policies. The prefix, indicated by <prefix>, for each endpoint is /data360/dam/api/v1/.

Method and endpoint

The following table describes the creation method and associated endpoint for the data filter API:
Method
Endpoint
Description
POST
<baseApiUrl><prefix>/data-filters
Create new data filter policies.

Request parameters

The following table describes the parameters that you can specify in the endpoint of the request:
Parameter
Type
Description
name
String
Required. Specify the name of the asset.
externalId
String
Optional. Specify the external identifier of the asset.
description
String
Optional. Specify the description of the asset.
enabled
Boolean
Optional. Specify the status of the asset: true|false.
effectiveDate
String
Optional. Specify the start date of the asset in the format yyyy-mm-dd.
endDate
String
Optional. Specify the end date of the asset in the format yyyy-mm-dd.
enforcementMethod
String
Optional. Specify the enforcement method as either PUSHDOWN or ON_QUERY. The default method is ON_QUERY.
stakeholders
Object
Optional. Specify the following attributes to add a stakeholder to the asset.
stakeholderId: The internal ID of the stakeholder. You can find this ID by looking at the URL of the stakeholder page in Data Governance and Catalog.
roleId: The internal ID of the role for the stakeholder. You can find this ID in the role details in Administrator. Navigate to the User Roles page, open the user role, and copy the ID at the end of the URL.
stakeholderType: Specify whether the stakeholder is a USER or GROUP.
dataFilterRules
Object
Optional. Define one or more data filter rules.
ruleName: String. Name of the rule.
ruleDescription: String. Description of the rule.
enabled: Boolean. Status of the rule.
rank: Integer. Ranking of the rule within the policy.
condition: Object. Set of conditions for the rule.
queries: Object. The asset query used when you set the enforcement method to PUSHDOWN.
filter: Object. The filter used to deny access to data.

Request body for on-query enforcement

In the body of the request, specify the parameters in the following format:
{

"name": "Third-Party Access Control Policy",

"description": "Restrict access for third-party.",

"enabled": true,

"dataFilterRules": [

{ "ruleName": "Access Control Rule",

"ruleDescription": "",

"enabled": true,

"rank": 0,

"condition": {

"dialect": "structured-predicate",

"version": "1.0",

"predicate": {

"and": [

{"isAnyOf": [

{

"path": "context::request.usage"

}, {

"constant": "{{Data-Access-Management}}"

}]

}, {

"isAnyOf": [

{

"path": "cdgc::dataset.glossaries[*].id"

}, {

"constant": "{{DAM - Account}}"

}] }] }},

"filter": {

"dialect": "structured-predicate",

"predicate": {

"or": [

{

"isAnyOf": [

{

"fieldValue": {

"fieldLocatorQuery": {

"dialect": "basic-object-locator",

"version": "1.0",

"query": {

"path": "cdgc::dataelement.classifications[*].id",

"value": "{{DAM - Customer Status}}"

} },

"type": "STRING"

} },

{

"constant": "1"

}] }] },

"version": "1.0"

} } ]

}

Request body for pushdown enforcement

In the body of the request, specify the parameters in the following format:
{

"name": "Data Filter Pushdown Policy",

"description": "Enforce row-level security natively through a data filter policy.",

"enabled": false,

"enforcementMethod": ["PUSHDOWN"],

"dataFilterRules": [

{ "ruleName": "Data Filter Pushdown Rule",

"rank": 0,

"ruleDescription": "",

"enabled": true,

"condition": {

"dialect": "structured-predicate",

"version": "1.0",

"predicate": {

"or": [{

"isAnyOf": [

{

"path": "context::principal.groups"

}, { "constant": {

"__type": "group_identifier",

"type": "PLAIN", "id": "USER_GROUP"

} } ] } ] },

"queries": [

{

"dialect": "knowledge-graph-search", "version": "1.0",

"query": {"query": "tables related to business term '*Customer'",

"filter": [ "{\"bool\":{\"filter\":[{\"terms\":{\"core.classType\":[\"com.infa.odin.models.relational.Table\"]}},{\"terms\":{\"core.resourceType\":[\"Databricks Notebooks\"]}},{\"terms\":{\"core.assetLifecycle\":[\"Published\"]}}]}}"

] } } ] },

"filter": {

"dialect": "structured-predicate",

"predicate": {

"or": [{

"isNotAnyOf": [

{

"fieldValue": {

"fieldLocatorQuery": {

"dialect": "basic-object-locator",

"query": {

"path": "cdgc::dataelement.classifications[*].id",

"value": "{{DAM - Person Country}}"

},

"version": "1.0" },

"type": "STRING"} },

{"constant": "USA"}, {"constant": "CANADA"}

] } ] },

"version": "1.0"

} }]

}

Modify data filter assets

Send a PUT request to replace a specific data filter policy. Send a PATCH request to modify the details of a specific data filter policy. The prefix, indicated by <prefix>, for each endpoint is /data360/dam/api/v1/.

Methods and endpoints

The following table describes modification methods and associated endpoints for the data filter API:
Method
Endpoint
Description
PUT
<baseApiUrl><prefix>/data-filters/{ID}
Replace a specified data filter policy.
PATCH
<baseApiUrl><prefix>/data-filters/{ID}
Modify the details of a specified data filter policy.

Request parameters

The following table describes the parameters that you can specify in the endpoint of the request:
Parameter
Type
Description
name
String
Required. Specify the name of the asset.
externalId
String
Optional. Specify the external identifier of the asset.
description
String
Optional. Specify the description of the asset.
enabled
Boolean
Optional. Specify the status of the asset: true|false.
effectiveDate
String
Optional. Specify the start date of the asset in the format yyyy-mm-dd.
endDate
String
Optional. Specify the end date of the asset in the format yyyy-mm-dd.
stakeholders
Object
Optional. Specify the following attributes to add a stakeholder to the asset.
stakeholderId: The internal ID of the stakeholder. You can find this ID by looking at the URL of the stakeholder page in Data Governance and Catalog.
roleId: The internal ID of the role for the stakeholder. You can find this ID in the role details in Administrator. Navigate to the User Roles page, open the user role, and copy the ID at the end of the URL.
stakeholderType: Specify whether the stakeholder is a USER or GROUP.
dataFilterRules
Object
Optional. Define one or more data filter rules.
ruleName: String. Name of the rule.
ruleDescription: String. Description of the rule.
enabled: Boolean. Status of the rule.
rank: Integer. Ranking of the rule within the policy.
condition: Object. Set of conditions for the rule.
queries: Object. The asset query used when you set the enforcement method to PUSHDOWN.
filter: Object. The filter used to deny access to data.

Request body

In the body of the request, specify the parameters in the following format:
{

"description": "Enforce row level security natively, updated.",

"enabled": true

}
This example request body uses the PATCH method to modify only the policy's description and status.

Delete data filter assets

Send a DELETE request to delete a specific data filter policy. The prefix, indicated by <prefix>, for each endpoint is /data360/dam/api/v1/.

Method and endpoint

The following table describes the deletion method and associated endpoint for the data filter API:
Method
Endpoint
Description
DELETE
<baseApiUrl><prefix>/data-filters/{ID}
Delete a specified data filter policy.

Request body

This endpoint has no request body.