Report a custom event
Changed onReports something that happened in your site or app, such as a signed lease, so tasks, email sequences and webhooks can act on it. Crevio announces it once as custom.<name> (lease.signed becomes custom.lease.signed) and stores nothing but the audit log entry.
Listen for it with a task (trigger_type: "event", event_conditions: {event_type: "custom.lease.signed"}, optionally narrowed by site and by values in data), an email sequence (trigger: {event: "custom.lease.signed"}, which enrolls the event's contact), or a webhook endpoint (enable custom.lease.signed, or custom.* for every custom event).
Sites built on Crevio report events from their mutations with ctx.emit(name, { contact, data }); they are sent only after the mutation succeeds. Send an Idempotency-Key when you retry, so a retry is not announced twice.
Request
- Base URLhttps://api.crevio.co/v1
- AuthAPI key in header Authorization
Headers
Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.
Request body
What happened, in lowercase words joined by dots, such as lease.signed or booking_request.approved. A leading custom. is accepted and dropped.
The contact (con_...) it happened to. Email sequences enroll this contact; without one they ignore the event.
The site that reported it, by id (site_...) or worker name. Sites built on Crevio send their own. An id that is not one of your sites leaves site null. Tasks can listen to one site's events.
Details of what happened, up to 8 KB as JSON. Passed through as data to tasks and webhooks; tasks can match on its top-level values.
Example request
{
"name": "lease.signed"
}Response
The event was announced
Unique id of this report (cev_...). Webhook deliveries and task runs carry it as data.object.id.
The event type everything listens for: custom. followed by name, such as custom.lease.signed.
The name you sent, without the custom. prefix.
The contact (con_...) it happened to, or null.
The site (site_...) that reported it, or null.
The details you sent.
Changes
- info
endpoint added
- info