Data models
Define the contract that controls accepted fields, storage shape, generated examples, and analytics inputs.
A data model describes one kind of record. It tells ReportPlane which fields exist, what each field means, which values are valid, and which field represents time.
Examples include page_view, api_request, invoice, or security_event.
Why the model comes first
The same model is used by several parts of the product:
- ingest validation checks incoming values;
- destination provisioning creates a compatible storage shape;
- sample generation creates type-safe example records;
- generated OpenAPI describes the ingest contract;
- Analytics APIs select dimensions and metrics from known fields.
One definition prevents each part from inventing a slightly different schema.
Create a model
Open Data → Data Models → New data model.
- Enter a display name and stable key.
- Describe what one record represents.
- Add at least one field.
- Select a time field when the model includes a timestamp.
- Save the model, then connect it to a destination.
Use lowercase, predictable field names such as account_id or occurred_at. Avoid changing a field's meaning while keeping the same name.
Field properties
| Property | Meaning |
|---|---|
| Name | The key expected in the incoming payload |
| Type | How ReportPlane validates and stores the value |
| Source | Whether the value comes from the payload, system, or a derived rule |
| Required | Whether ingest must receive a non-missing value |
| Description | Human context used in the console and generated contracts |
Edit behavior
You can add fields and update supported model properties. Destination adapters can automatically add compatible columns when their configuration allows it.
Changing an existing field's type is riskier than adding a new field because stored data already uses the previous type. Plan and test schema evolution in a non-production project first.
Required validation is applied when an event is accepted. A record already accepted into the spool is not later rejected only because the model's required flags changed while it was waiting for delivery.
Relationships and usage
The model detail page shows related destinations, ingest access, query access, Analytics APIs, and statistics. These relationships explain why a model may not be safe to archive or change.