POST/projects/{project_id}/branch_anonymized

Create an anonymized branch

Creates a branch with anonymized data using PostgreSQL Anonymizer for static masking. Supply branch_create to configure the branch and optionally provide masking_rules or set start_anonymization to true to apply masking rules and start anonymization during creation. This endpoint is in beta; the response includes the created branch, operations, and any endpoints specified in the request.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 4 body fields
project_idstringrequired
The Neon project identifier; must contain 1 to 60 lowercase letters, digits, or hyphens.

Branch creation configuration with optional masking rules, metadata, and automatic anonymization.

annotation_valueobjectoptional
A free-form map of string key-value pairs for attaching metadata to a resource (for example, a git commit reference). Maximum 50 entries.
branch_createobjectoptional
Configuration for the new branch, including branch and endpoint settings.
masking_rulesarray<object>optional
List of masking rules to apply to the branch.
start_anonymizationbooleanoptional
If true, automatically start anonymization after the branch is created. Defaults to false.
Default:false

2 status codes
201Returns the created branch, operations, and endpoints if any were specified in the request.
branchobjectrequired
Branch returned by the request.
endpointsarray<object>required
Compute endpoints in the project. Each includes `id`, `branch_id`, `host`, and `type`.
operationsarray<object>required
rolesarray<object>required
Roles belonging to the branch. Each role includes fields such as `branch_id`, `name`, `protected`, `created_at`, and `updated_at`.
databasesarray<object>required
Databases on the branch. Each includes `id`, `name`, `owner_name`, and `created_at`.
connection_urisarray<object>optional
Connection URIs for the compute endpoint, including credentials.
defaultReturned when a general error occurs. The response includes a machine-readable `code`, a human-readable `message`, and an optional `request_id`.
request_idstringoptional
Unique 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.
codestringrequired
Machine-readable code classifying the error type. See `message` for a human-readable explanation.
Default:
messagestringrequired
Error message

Error handling

The project_id path parameter must contain 1 to 60 lowercase letters, digits, or hyphens. Each item in masking_rules must include database_name, schema_name, table_name, and column_name; annotation_value accepts at most 50 entries.