/projects/{project_id}/branches/{branch_id}/masking_rulesUpdate masking rulesUpdates the masking rules for the specified anonymized branch. Masking rules define how sensitive data should be anonymized using PostgreSQL Anonymizer.
Note: This endpoint is currently in Beta.
Parameters
project_idstringpathrequiredThe Neon project ID
branch_idstringpathrequiredThe branch ID
Request body
requiredapplication/json
masking_rulesarray of objectrequiredList of masking rules to apply to the branch. This will replace all existing masking rules for the branch.
Show child attributes
Show array items
column_namestringrequiredThe name of the column to be masked
database_namestringrequiredThe name of the database containing the table to be masked
masking_functionstringThe PostgreSQL Anonymizer masking function to apply. Can be a predefined function (e.g., 'anon.random_string(10)', 'anon.fake_email()') or a custom function definition (e.g., 'anon.hash(column_name)')
masking_valuestringA literal value to set on the column when masking.
schema_namestringrequiredThe name of the schema containing the table to be masked
table_namestringrequiredThe name of the table containing the column to be masked
{
"masking_rules": [
{
"column_name": "email",
"database_name": "neondb",
"masking_function": "anon.fake_email()",
"schema_name": "public",
"table_name": "users"
}
]
}Responses
masking_rulesarray of objectrequiredList of masking rules for the branch
Show child attributes
{
"masking_rules": [
{
"column_name": "email",
"database_name": "neondb",
"masking_function": "anon.fake_email()",
"schema_name": "public",
"table_name": "users"
}
]
}codestringrequiredmessagestringrequiredError message
request_idstringUnique identifier for the request, useful for debugging. You can set this value manually by including an `X-Request-ID` header in the request. If not provided, the value will be generated automatically.
{
"code": "",
"message": "string",
"request_id": "string"
}