Activity Events
The activity_events table contains data about activities that have happened across the organization, as typically displayed in the Activity Stream section on the user interface.
This table can be used to determine which activity events occurred in which campaigns, which entity the activity occurred on, who performed the activity, and the like, as well as metadata about the activity such as when it was created.
Columns
| Column Name | Description | Type | Nullable |
|---|---|---|---|
| id | The numerical identifier of the object. | INT8 | No |
| name | The type of activity that occurred. For example, create_campaign_entity means an entity was created in the campaign and create_address_physical means a physical address was created on an entity. |
VARCHAR | Yes |
| event_type | The type of event that occurred. One of create, delete, update, or NULL. |
VARCHAR | Yes |
| datetime | This column is unused and always blank. | TIMESTAMP | Yes |
| campaign_id | The numerical identifier of the campaign this activity was performed in. Relates to the id column in the campaigns table. |
INT8 | Yes |
| item_type | The name of the class of object this activity manipulated. For example, CampaignEntity indicates the activity changed the relation between an entity and the campaign, and TaggableLogbook indicates the activity changed the relation between a field and an entity. |
VARCHAR | Yes |
| item_id | The numerical identifier of the related object for this activity. Can be used with item_type to look up the object itself in the appropriate table. |
INT8 | Yes |
| target_type | The name of the class of object this activity occurred on. For example, Entity indicates the activity occurred on an entity, and CalendarEventResponse indicates the activity occurred on the RSVP to an event by an entity. |
VARCHAR | Yes |
| target_id | The numerical identifier of the related object for this activity. Can be used with target_type to look up the object itself in the appropriate table. |
INT8 | Yes |
| user_id | The numerical identifier of the user that performed this activity. Relates to the id column in the users table. |
INT4 | Yes |
| payload | A JSON representation of the details about the activity. | JSONB | Yes |
| created_at | The UTC timestamp when this object was created. | TIMESTAMP | No |
| updated_at | The UTC timestamp when this object was last updated. | TIMESTAMP | No |