🏢 Accounts Data Model
Configure the mandatory Accounts model to track customer organizations.
This is a mandatory model
Configure the Accounts Model before any other data models. All other models link to accounts.
Overview
In B2B SaaS, tracking account-level progress is often more important than tracking individual users. The Accounts Model represents customer organizations and serves as the foundation for all other data models in Meza AI.
Each account contains users, activities, subscriptions, and support interactions. Meza AI aggregates all this data at the account level to calculate health scores, journey stages, and signals.
Key Fields
| Field | Type | Description | Required |
|---|---|---|---|
account_id | String | Unique identifier for the account | Yes |
name | String | Customer organization name | Yes |
domain | String | Primary domain (e.g., example.com) | No |
created_at | Timestamp | When the account was created | Yes |
Configuration Steps
Navigate to Data Models
Go to Configuration → Data Models in the left sidebar.
Click Configure
Find the Accounts Model card and click Configure. Select your database connection.
Write or Generate Query
Write a SQL query to retrieve account data, or click AI Suggest to auto-generate.
Click Validate to test your query.
Map Fields
Map your query columns to Account ID, Name, Domain, and Created At fields.
Add Custom Properties (Optional)
Add custom fields like Industry, Plan Type, or Region for filtering and segmentation.
Save Model
Click Run Quick Test to validate, then Save Model to complete setup.
Example SQL Query
Here's a typical query for the Accounts Model:
SELECT id AS account_id, company_name AS name, domain, created_at, -- Optional custom properties industry, plan_type, employee_count FROM accounts WHERE deleted_at IS NULL AND status = 'active'
Custom Properties
Custom properties allow you to add additional fields for filtering and segmentation. Common custom properties include:
| Property | Description | Example Values |
|---|---|---|
| Industry | Customer industry vertical | SaaS, E-commerce, Healthcare |
| Plan Type | Subscription tier | Starter, Pro, Enterprise |
| Region | Geographic region | North America, EMEA, APAC |
| Employee Count | Company size | 1-50, 51-200, 201-1000 |
| Account Owner | Assigned CSM or AE | john@company.com |
| MRR | Monthly recurring revenue | 500, 2000, 10000 |
✅ Tip
Best Practices
- Use stable IDs — The account_id should never change for existing accounts
- Filter active accounts — Exclude deleted or churned accounts from the query
- Include creation date — The created_at field is essential for lifecycle tracking
- Add meaningful properties — Custom properties enable powerful segmentation
- Keep queries simple — Avoid complex JOINs that slow down sync
Sync Frequency
By default, Meza AI syncs the Accounts Model every hour. For most use cases, this provides a good balance between data freshness and query efficiency.
Contact support if you need more frequent syncs for high-volume use cases.
Troubleshooting
Query Validation Failed
- Check SQL syntax for your database type
- Verify the table and column names exist
- Ensure the database user has SELECT permissions
Missing Accounts
- Check if WHERE clause is filtering too aggressively
- Verify accounts exist in the source table
- Wait for the next sync cycle to complete