M
Meza AI

🏢 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

FieldTypeDescriptionRequired
account_idStringUnique identifier for the accountYes
nameStringCustomer organization nameYes
domainStringPrimary domain (e.g., example.com)No
created_atTimestampWhen the account was createdYes

Configuration Steps

1

Navigate to Data Models

Go to ConfigurationData Models in the left sidebar.

2

Click Configure

Find the Accounts Model card and click Configure. Select your database connection.

3

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.

4

Map Fields

Map your query columns to Account ID, Name, Domain, and Created At fields.

5

Add Custom Properties (Optional)

Add custom fields like Industry, Plan Type, or Region for filtering and segmentation.

6

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:

PropertyDescriptionExample Values
IndustryCustomer industry verticalSaaS, E-commerce, Healthcare
Plan TypeSubscription tierStarter, Pro, Enterprise
RegionGeographic regionNorth America, EMEA, APAC
Employee CountCompany size1-50, 51-200, 201-1000
Account OwnerAssigned CSM or AEjohn@company.com
MRRMonthly recurring revenue500, 2000, 10000

✅ Tip

Add custom properties that your team will use for filtering accounts. You can always add more properties later without reconfiguring the entire model.

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

What's Next?