Events
A subscription receives only the events it lists in subscribed_events. Its body for each event is in Payloads.
Events
| Event | Record type (data.type) |
Sent when |
|---|---|---|
project.created |
Project |
A project or opportunity is created |
project.updated |
Project |
A project or opportunity changes |
project.completed |
Project |
A delivery project moves from a status that is not complete to a complete status |
opportunity.won |
Project |
An opportunity moves to a won status (its deal_won_date is set) |
opportunity.lost |
Project |
An opportunity moves to a lost status (its deal_lost_date is set) |
invoice.created |
Invoice |
An invoice is created |
invoice.updated |
Invoice |
An invoice changes |
cost.created |
Cost |
A cost is created |
cost.updated |
Cost |
A cost changes |
company.merged |
Company |
Duplicate companies are merged into one |
trigger.fired |
The trigger’s record | An event trigger whose action is Send Webhook fires. See trigger.fired |
There is no event for deleting a record. Archiving a project, invoice or cost sends its .updated event, but the payload has no field that says it was archived.
Project events
- Opportunities are stored as projects, so
project.createdandproject.updatedfire for both. Useproject_typein the payload to tell them apart. project.completedfires only for delivery projects, once for each move into a complete status. A move between two complete statuses does not fire it. Moving back to a status that is not complete clearscompleted_dateand sends onlyproject.updated.opportunity.wonandopportunity.lostfire the first time the date is set. Moving a won opportunity back to a standard status clears the date. Winning it again firesopportunity.wonagain.- Converting an opportunity sends
project.createdfor the new project, andproject.updatedandopportunity.wonfor the opportunity, in no guaranteed order. The new project’sopportunity_idlinks them. - Changes made while a project is being created are part of
project.created. - Duplicating a project sends no project events.
- A budget spreadsheet import sends one
project.updatedwhen it finishes. - Data imports that Drum runs for an account, such as the import when an account is set up, send no events.
Update events are combined
Drum combines the .updated events for one record over 5 seconds. The first change is sent at once. If the record changes again within 5 seconds, Drum sends one more event about 5 seconds later, with the record as it is then.
You do not get one event for every save, but you always get the final state. Events can arrive out of order, so keep the event with the latest data.attributes.updated_at for each record. Timestamps have six decimal places, so two saves in the same second can still be ordered.
.created events, project.completed, opportunity.won, opportunity.lost, company.merged and trigger.fired are never combined.
company.merged
Sent once after a merge, for the company that was kept. The body lists the archived companies and counts of the records moved. Projects and contracts moved by a merge may also send their own update events. Invoices and supplier records moved by a merge do not.
trigger.fired
An event trigger with the Send Webhook action sends trigger.fired to every active subscription that lists it. The body adds trigger_source, trigger_model and trigger_event, and data is the record that fired the trigger.
| Triggered From | trigger_source |
trigger_model and data.type |
trigger_event values |
|---|---|---|---|
| Cost | cost |
cost, Cost |
status_approved |
| Expense Claim | expense_claim |
expense_claim, ExpenseClaim |
status_pending, status_approved, status_rejected |
| Invoice | invoice |
invoice, Invoice |
status_awaiting_approval, status_approved, third_party_paid, third_party_partial, sent |
| Progress Claim | progress_claim |
progress_claim, ProgressClaim |
status_submitted, status_approved, status_rejected |
| Project | project |
project, Project |
created, budget_percentage_spent, project_status_changed |
| Opportunity | opportunity |
project, Project |
created, deal_won, deal_lost, project_status_changed |
| Project Role | project_account_user |
project_account_user, ProjectAccountUser |
assigned_to_role |
| Purchase Order | purchase_order |
purchase_order, PurchaseOrder |
status_final, status_approved |
| Quote | quote |
quote, Quote |
status_awaiting_approval, status_approved, status_accepted, status_declined |
| Task | task |
task, Task |
status_completed, status_blocked |
| Timesheet | timesheet |
timesheet, Timesheet |
status_finalised, status_approved |
The names in Triggered From follow the account’s own wording, so an account that calls projects “jobs” shows Job. The values in the body do not change.
What each event means in Drum:
trigger_event |
Meaning |
|---|---|
status_<name> |
The record’s status changed to that status. status_final on a purchase order is shown as Awaiting Approval, and status_finalised on a timesheet as submitted for approval |
third_party_paid, third_party_partial |
The accounting system marked the invoice paid, or partly paid |
sent |
The invoice was sent |
created |
The project or opportunity was created |
budget_percentage_spent |
The project’s spend reached the percentage set on the trigger |
project_status_changed |
The project or opportunity’s status changed |
deal_won, deal_lost |
The opportunity was won or lost |
assigned_to_role |
A member was given a project role, optionally only the roles set on the trigger |