Safe development copy
A team needs production-shaped records for local development without exposing sensitive values.
Neon · Const
Creates a Neon branch containing statically masked data through PostgreSQL Anonymizer. Optional masking rules and automatic anonymization can be supplied in the same request.
This API operation creates a branch whose copied data is anonymized with PostgreSQL Anonymizer static masking. You can provide initial masking rules and request that anonymization start immediately; the response contains the created branch and restricted actions for anonymized branches.
POST /projects/{project_id}/branch_anonymized| Name | Type | Description |
|---|---|---|
project_id | path string | The Neon project containing the new branch. |
branch | body object | Branch creation settings, including the branch name and optional parent branch. |
masking_rules | body array, optional | Initial masking rules for the new anonymized branch. |
start_anonymization | body boolean, optional | Whether to start anonymization automatically after creation. |
The created branch object, including restricted_actions that identify operations unavailable for anonymized branches.
curl -X POST "https://api.neon.tech/v2/projects/$NEON_PROJECT_ID/branch_anonymized" \
-H "Authorization: Bearer $NEON_API_KEY" \
-H "Content-Type: application/json" \
-d '{"branch":{"name":"dev-anonymized","parent_id":"br-prod"},"start_anonymization":true}'Creates an anonymized branch from a production branch and starts masking automatically.
A team needs production-shaped records for local development without exposing sensitive values.
A CI pipeline provisions temporary environments from production-derived data.
A request must define masking behavior and launch anonymization as one operation.
The endpoint is POST /projects/{project_id}/branch_anonymized. It creates a branch with anonymized data using PostgreSQL Anonymizer for static masking, optionally accepting masking_rules and start_anonymization.
Follow-up: What happens if fresh production data is required? Create a new anonymized branch from the parent; rerunning masking processes already anonymized data rather than recopying the parent.
masking_rules lets the request define initial masking rules for the new branch. start_anonymization can then automatically begin anonymization after branch creation.
Follow-up: Which masking mechanism underlies this operation? PostgreSQL Anonymizer applies static masking to the copied branch data.
An anonymized branch is intended for development work with masked production-shaped data. The returned branch object includes restricted_actions that identify operations not permitted for anonymized branches, including restore and read-write endpoint deletion.
Follow-up: How should a workflow obtain a new masked snapshot later? Create another anonymized branch from the desired parent instead of trying to reset the existing one.
Get anonymization statusGet masking rulesUpdate masking rulesStart anonymizationPostgreSQL Anonymizerrestricted_actions