Notes consist of two things:
- A body, which is the text content of the note.
- Metadata, which is a structured key-value blob that you can use to store arbitrary data on the object.
- A reference to the object the note is attached to, which consists of a
model_typeand amodel_id. Model types are as follows:
model_type | Description | Related model |
|---|---|---|
automation | An automation workflow | Automation |
email | Email message | |
external_feed | External feed (e.g., RSS source) | ExternalFeed |
stripe_customer | Stripe customer record | StripeCustomer |
subscriber | A subscriber to your newsletter | Subscriber |
survey | A survey | Survey |
tag | Subscriber tag | SubscriberTag |
By creating a note programmatically, you can unlock a lot of interesting use cases and functionality. Here are some examples:
- Add a note to a given subscriber whenever they upgrade or churn from a paid plan.
- Add notes to emails when you mutate them with new data for provenance tracking.