Appearance
Attribute Schema
The attribute schema defines the valid attribute keys and their types for a memberbase. It acts as a contract — only attributes matching the schema can be set on members.
Why Use a Schema
- Validation: Reject invalid attribute keys or mismatched types at write time
- Consistency: Ensure all members use the same attribute vocabulary
- Documentation: Serve as a single source of truth for what attributes exist
Defining a Schema
Use the set endpoint to define or update the schema. Each attribute key has a name and a type:
json
{
"attributes": [
{ "key": "tier", "type": "string" },
{ "key": "lifetime_spend", "type": "number" },
{ "key": "signup_date", "type": "date" },
{ "key": "interests", "type": "array" },
{ "key": "opted_in", "type": "boolean" }
]
}Supported Types
| Type | Description |
|---|---|
string | Text values |
number | Integer or floating-point values |
boolean | True or false |
date | ISO 8601 date-time strings |
array | Lists of strings |
Updating the Schema
You can add new attribute keys at any time. Existing members are not affected — they simply won't have the new attributes until explicitly set.
Removing a key from the schema does not delete existing attribute values from members, but prevents new values from being written for that key.