Custom Schemas
Custom schemas allow you to define the structure of your data using JSON Schema. Each schema has a category that determines how it’s used in the platform.Work with the Reach Team for ImplementationWe recommend working directly with our team during implementation. Custom schemas and references can be complex, and our team can provide guidance and hands-on support.We have an internal UI that can help streamline this process and handle much of the technical work for you. We’re working to provide you with a self-service portal to manage custom schemas independently in the future.Please contact Reach to schedule a collaborative session for implementing custom schemas.
Schema Categories
Each schema must have a category that determines its purpose:contacts_schema
: Customer/contact informationtransactions_schema
: Transaction and billing datacustom_schema
: General data modelslocations_schema
: Location/address data
Schema Requirements
Schema names must be URL-safe:- Only letters, numbers, hyphens (-), and underscores (_)
- No spaces or special characters
- Must be unique (case-insensitive)
PII Annotations
Usex-pii-type
to mark fields containing personally identifiable information:
EMAIL
: Email addressesPHONE
: Phone numbersFIRST_NAME
,LAST_NAME
,NAME
: Name fieldsEXTERNAL_ID
: External identifiers
Schema Examples
contacts_schema
For customer/contact information:transactions_schema
For transaction/billing data:locations_schema
For location/address data:custom_schema
For general data models:Partner Schema Mappings
After creating custom schemas, you need to configure Partner Schema Mappings to tell Reach which fields in your schemas correspond to important data we need to extract and use throughout the platform. Schema mappings define how Reach interprets your custom schema data for:- Contact management and communication preferences
- Transaction processing and revenue tracking
- Location data for multi-location businesses
Available Schema Types
contacts_schema Mapping
Maps customer/contact information from your schema to Reach’s contact system: Required Fields:schemaId
: The ID of your contacts schemaemail
: Field name containing email addressesphone
: Field name containing phone numbersuserId
: Field name for the unique user identifier
firstName
: Field name for first namelastName
: Field name for last namefullName
: Field name for full name (alternative to firstName/lastName)location
: Field name linking to location dataemailOptOut
: Field name for email subscription statusemailOptOutTimestamp
: Field name for email opt-out timestampsmsOptOut
: Field name for SMS subscription statussmsOptOutTimestamp
: Field name for SMS opt-out timestampurlPattern
: URL pattern for deep-linking to customer details (e.g.,/customers/{userId}
)status
: Object defining active/inactive status mappingfield
: Field name containing statusactiveValue
: Value indicating active statusdeactivatedValue
: Value indicating inactive status
createdDate
: Field name for account creation date
transactions_schema Mapping
Maps transaction/billing data for revenue tracking and customer journey analysis: Required Fields:schemaId
: The ID of your transactions schemaeventType
: Type of transaction event (e.g., “purchase”, “subscription”, “refund”)id_field
: Field name for unique transaction identifieruserId
: Field name linking to the customeramount
: Object defining monetary value mappingfield
: Field name containing the amountcurrency
: Static currency code (e.g., “USD”)
dates
: Object mapping various date fieldscurrencyField
: Field name containing dynamic currency (optional, defaults to USD when not mapped)createdDate
: Transaction creation datepaidDate
: Payment completion datedueDate
: Payment due datestartDate
: Service start dateendDate
: Service end date
metadata
: Array of field names to include as metadataurlPattern
: URL pattern for deep-linking to transaction detailsfilter
: JSONLogic rule for conditional event creation
locations_schema Mapping
Maps location/address data for multi-location businesses: Required Fields:schemaId
: The ID of your locations schemaid_field
: Field name for unique location identifier
name
: Location name/titleaddress_line_1
: Primary address lineaddress_line_2
: Secondary address lineaddress_line_3
: Additional address linelocality
: City/localitydistrict
: State/province/districtpostal_code
: ZIP/postal codecountry_code
: Country code (ISO format)phone
: Location phone numberemail
: Location email addresswebsite
: Location website URLurlPattern
: URL pattern for deep-linking to location details
Schema Mapping Configuration
Schema mappings are configured through the Partner API and define acombined_schema
structure:
Field Mapping Examples
URL Patterns
URL patterns support field substitution using{fieldName}
syntax:
- Simple field:
/customers/{customerId}
- Nested field:
/orders/{orderId}?customer={customer.email}
- Multiple fields:
/locations/{locationId}/details?region={region}&type={businessType}
Status Mapping
Define how your status values map to Reach’s active/inactive system:Date Field Mapping
Map various date fields to track customer lifecycle:Schema References
To reference another schema, use$ref
with the reach:schemas/
URI scheme:
- Use
$ref
properties to reference other schemas - Referenced schemas must already exist
Creating Resources
Use the/api/resources/:schemaName
endpoint: