Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dataharbor.co/llms.txt

Use this file to discover all available pages before exploring further.

Control Block Reference

Detailed reference for all Control Block types and their options.
In the current runtime, controls live inside a v0.3 Virtual API Configuration under objects.<objectName>.controls. This page documents the control entries themselves.

Common Execution Rules

RuleBehavior
OrderingControls execute top-to-bottom
Path syntaxUse dot notation, with array segments like "[contacts].email". Slash notation is not supported.
Filter targetsredact, tokenize, anonymize, mask, hash, and allow require scalar targets (string, number, or bool)
Root arraysIf the matched payload is an array, controls apply to each object element automatically. Non-object elements are skipped.
Array failure behaviorArray execution is not transactional across elements. If an earlier element succeeds and a later element fails a required check, the request fails and earlier element changes are not rolled back.
Required semanticsrequired: true is full-path strict. Missing any intermediate parent or final target fails the request.

Common Options

OptionApplies toRequiredDescription
fieldsAll controlsYesField paths to operate on
requiredAll controlsNoWhen true, missing referenced fields fail instead of being skipped. That includes missing intermediate parent paths, not just the final field. For coalesce, all fields missing or empty also fails.
intocombine, coalesceYesTarget field for the transformed value
separatorcombineNoSeparator inserted between combined string values. Default: ""
remove_sourcecombine, coalesceNoRemove the source fields after the transform completes. Default: false

Data Control

redact

Remove sensitive data entirely.
OptionTypeRequiredDescription
typestringYesMust be redact
fieldsarrayYesField paths to redact
Behavior:
  • Strings → ""
  • Numbers → 0
  • Booleans → false
  • Objects and arrays are invalid targets
  • The key remains in the output. If you want to remove the field entirely, use delete instead.
- type: redact
  fields:
    - ssn
    - credit_card
    - user.password

tokenize

Replace with deterministic tokens.
OptionTypeRequiredDescription
typestringYesMust be tokenize
fieldsarrayYesField paths to tokenize
Behavior:
  • Same input → same token within the same Virtual API and matched object definition
  • Different object definitions or different Virtual APIs → different tokens
  • Token format: tok_[hash]
  • Booleans are not supported
- type: tokenize
  fields:
    - email
    - phone
    - customer_id

anonymize

Replace with random values preserving structure.
OptionTypeRequiredDescription
typestringYesMust be anonymize
fieldsarrayYesField paths to anonymize
Behavior:
  • Each request produces different values
  • Format is preserved (email looks like email)
  • Not reversible, not correlatable
- type: anonymize
  fields:
    - email
    - name
    - street_address

mask

Partially redact values while preserving structure.
OptionTypeRequiredDescription
typestringYesMust be mask
fieldsarrayYesField paths to mask
Behavior:
  • Strings → first and last characters visible, middle masked (e.g., "John Smith""Jo** ***th")
  • Numbers → leading digits zeroed, last 2 visible (e.g., 55512345670000000067)
  • Booleans → false
- type: mask
  fields:
    - ssn
    - phone
    - name

hash

Replace with one-way SHA-256 digest. Deterministic within the same Virtual API and matched object definition — same input always produces the same hash in the same scope.
OptionTypeRequiredDescription
typestringYesMust be hash
fieldsarrayYesField paths to hash
Behavior:
  • Strings → 64-character hex digest
  • Numbers → deterministic number derived from hash bytes
  • Booleans → deterministic boolean
- type: hash
  fields:
    - email
    - customer_id

allow

Pass values through unchanged. Fields not referenced by any control are allowed by default — allow is provided for users who prefer to be explicit about which fields are permitted.
OptionTypeRequiredDescription
typestringYesMust be allow
fieldsarrayYesField paths to allow
- type: allow
  fields:
    - public_id
    - display_name

Data Transform

combine

Merge fields into a new field.
OptionTypeRequiredDescription
typestringYesMust be combine
fieldsarrayYesFields to combine (order matters; at least 2)
intostringYesName of new field
separatorstringNoSeparator between values. Default: ""
All source fields must be strings. When you use nested paths, every entry in fields plus into must share the same parent path. If into already exists, the transform fails instead of overwriting it.
- type: combine
  fields:
    - first_name
    - last_name
  into: full_name
  separator: " "
  remove_source: true

coalesce

Select first non-empty value.
OptionTypeRequiredDescription
typestringYesMust be coalesce
fieldsarrayYesFields to check (order = priority; at least 2)
intostringYesName of new field
coalesce treats missing values, null, and empty strings as empty. Whitespace-only strings, numeric 0, boolean false, objects, and arrays are all treated as present values. When you use nested paths, every entry in fields plus into must share the same parent path. If into already exists, the transform fails instead of overwriting it.
- type: coalesce
  fields:
    - mobile_phone
    - work_phone
    - home_phone
  into: primary_phone

delete

Remove fields entirely from the outbound payload.
OptionTypeRequiredDescription
typestringYesMust be delete
fieldsarrayYesFields to remove
delete does not support into. When you use nested paths, all entries in fields must share the same parent path. This keeps cleanup operations predictable for nested objects and arrays.
- type: delete
  fields:
    - first_name
    - last_name
    - internal_note

Access Control

Access controls are defined in the access block, not as Control Blocks.

expires

OptionTypeDescription
expiresstringISO 8601 date (2025-12-31) or relative (90d)
access:
  expires: 2025-12-31

geo_allow / geo_deny

OptionTypeDescription
geo_allowarrayISO 3166-1 alpha-2 country codes to allow
geo_denyarrayISO 3166-1 alpha-2 country codes to deny
access:
  geo_allow:
    - US
    - CA
    - EU  # Special value: all EU countries

ip_allow

OptionTypeDescription
ip_allowarrayCIDR ranges to allow
access:
  ip_allow:
    - 10.0.0.0/8
    - 192.168.1.0/24

rate_limit

OptionTypeDescription
rate_limit.requestsnumberMax requests per period
rate_limit.periodstringTime period (1m, 1h, 1d)
access:
  rate_limit:
    requests: 10000
    period: 1d

Field path syntax

Simple fields

fields:
  - email
  - phone

Nested fields

fields:
  - user.email
  - billing.address.street

Array items

fields:
  - "[contacts].email"        # All items in array
  - "[orders].[items].sku"    # Nested arrays