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:
{
  "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

TypeDescription
stringText values
numberInteger or floating-point values
booleanTrue or false
dateISO 8601 date-time strings
arrayLists 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.