Skip to Content
API ReferenceHook Events

Hook Events

Foir emits an event whenever something happens that another system might need to know about — a record is published, a user signs up, a subscription lapses. Subscribe to an event with a hook, and Foir delivers it to an operation you own.

This page is the complete catalogue: every event Foir emits, what produces it, and exactly what arrives in the body. For how to wire a receiver and verify a delivery, see Webhooks; for the hook itself, see Lifecycle Hooks.

What arrives

Each event carries a flat set of keys describing one thing that happened. When the hook runs an operation, those keys arrive as input on the OperationPayload your endpoint receives — so RECORD_PUBLISHED’s recordId is payload.input.recordId, not payload.recordId. The rest of the envelope, and how to verify a delivery, is under Webhooks.

Five properties are worth knowing before you write a handler.

The payload is a fact, not a query result. It describes the state at the moment the event happened. It does not carry the resource’s current state, and for most events it does not carry the resource’s content at all — it carries enough to identify what changed so you can read it back under your own credentials.

Filters match these keys. A hook filter such as { "modelKey": "post" } is matched against the top-level keys listed for each event below. A key the payload does not carry is treated as no constraint, so filtering on a key that is not in the table below will not narrow anything.

Deliveries are not ordered. Two events about the same resource can arrive in either order, and a retry can re-deliver one you have already seen. Write the handler so the newest information wins and a repeat is a no-op: key on the identifier in the payload, re-read the resource when you need its current state, and treat the delivery as a signal rather than as the authoritative sequence. This is a property you can detect and compensate for, which is why it is stated here rather than papered over with a guarantee that would fail quietly under load.

state is a snapshot, and not every event has one. Beside its keys, an event can carry a state object: the resource as it stood when the event happened, never a credential. Where an event declares no snapshot, state is null. RECORD_* events never carry one: their state is null by design, because a record’s content is governed by who may read it, and a copy in the event would reach readers the record does not. Read the record back under your own credentials instead.

causationChain may be present. When the event was produced by work that a hook itself started, the payload carries the chain of operation keys that led to it. Foir refuses to re-run an operation already in the chain, and stops any chain at three hops, so a hook that fires itself cannot run away.

The full catalogue

EventSubscribe onWhat it means
RECORD_CREATEDa project hookA record was created.
RECORD_UPDATEDa project hookA record changed.
RECORD_DELETEDa project hookA record was deleted.
RECORD_PUBLISHEDa project hookA record version went live.
RECORD_UNPUBLISHEDa project hookA published record version was taken down.
USER_CREATEDa project hookA user was created.
USER_UPDATEDa project hookA user’s details changed.
USER_DELETEDa project hookA user was deleted.
USER_MERGEDa project hookTwo users were merged into one.
SESSION_REVOKEDa project hookA session was revoked.
OPERATION_COMPLETEDa project hookAn operation execution finished successfully.
OPERATION_FAILEDa project hookAn operation execution finished with an error.
OPERATION_CANCELLEDa project hookAn operation execution was cancelled before completing.
OPERATION_TIMED_OUTa project hookAn async operation did not call back in time and was reaped.
MEMBERSHIP_GRANTEDa workspace hookA team member was granted access to the workspace or to a project in it.
MEMBERSHIP_REVOKEDa workspace hookA team member’s access was withdrawn.
MEMBERSHIP_ROLE_CHANGEDa workspace hookA team member’s role changed. Not emitted today — see below.
TENANT_PLAN_CHANGEDa workspace hookThe workspace moved to a different billing plan.
TENANT_SUBSCRIPTION_STATUS_CHANGEDa workspace hookThe workspace’s subscription status changed — for example to past due, or back to active.
PROJECT_CREATEDa workspace hookA project was created in the workspace.
PROJECT_ARCHIVEDa workspace hookA project was deleted.
INVITATION_ACCEPTEDa workspace hookSomeone accepted an invitation and joined the place it asked them to.
IMPORT_COMPLETEDa project hookA batch import finished.
MIGRATION_APPLIEDa project hookA schema migration finished moving record data.
BULK_UPDATE_COMPLETEDa project hookA bulk update finished.
BULK_PUBLISH_COMPLETEDa project hookA bulk publish finished.
USER_PREFERENCE_CHANGEDa project hookA user’s notification preference changed.
ORGANIZATION_CREATEDa project hookAn organization was created.
ORGANIZATION_UPDATEDa project hookAn organization’s name, presentation or own settings changed.
ORGANIZATION_MOVEDa project hookAn organization moved to a different parent, taking everything beneath it along.
ORGANIZATION_SUSPENDEDa project hookAn organization was suspended.
ORGANIZATION_RESUMEDa project hookA suspended organization was made active again.
ORGANIZATION_DELETION_SCHEDULEDa project hookAn organization was put on a deletion clock.
ORGANIZATION_DELETION_CANCELLEDa project hookAn organization’s scheduled deletion was cancelled.
ORGANIZATION_DELETEDa project hookAn organization and everything it owned were destroyed.
ORGANIZATION_MEMBER_ADDEDa project hookA user became a member of an organization.
ORGANIZATION_MEMBER_REMOVEDa project hookA user’s membership of an organization was removed.
ORGANIZATION_MEMBER_ROLE_CHANGEDa project hookA member’s role in an organization changed.
PROJECT_REACTIVATEDa workspace hookA deleted project was reactivated.
JOIN_REQUESTEDa project hookA person asked to join an organization.
JOIN_REQUEST_APPROVEDa project hookA request to join an organization was approved.
JOIN_REQUEST_DECLINEDa project hookA request to join an organization was declined.

Project events

Subscribe to these with a project hook — in the console under Settings, with foir hooks create, or with defineHook in your config. A project hook fires only for events in its own project.

Record events

Content lifecycle — the highest-volume family on the platform.

A record payload is a pointer, not a copy. It carries the record’s id and model key and no field content, on every record event including RECORD_DELETED. Read the record back through the API to get its data — and read it under your own credentials, which is the reason for the design: the event log is readable by anyone who can read events for the project, while a record is governed by ownership, grants, borrows and per-field read rules. Copying field content into an event would move it out from under all of those, permanently, for the whole retention of the log. So the pointer is not a cost saving that a later release relaxes; it is the shape of the contract.

A consumer that arrives after a delete therefore resolves nothing, which is the correct answer: the record is gone.

RECORD_CREATED

A record was created.

Fires when: Creating a record through the API, the console, the CLI, or an import.

KeyTypePresentDescription
recordIdstringalwaysThe record’s id.
modelKeystringalwaysThe model the record belongs to. This is the key hook filters most often match on.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

RECORD_UPDATED

A record changed.

Fires when: Any write that changes a record — a field edit, an owner change, a variant write, a version restore, a schedule change, or a cascade from a deleted secret.

KeyTypePresentDescription
recordIdstringalwaysThe record’s id.
modelKeystringalwaysThe model the record belongs to. This is the key hook filters most often match on.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

This is the highest-volume event on the platform. Filter it by modelKey unless you genuinely want every model.

RECORD_DELETED

A record was deleted.

Fires when: Deleting a record.

KeyTypePresentDescription
recordIdstringalwaysThe record’s id.
modelKeystringalwaysThe model the record belongs to. This is the key hook filters most often match on.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

The record is already gone when this is delivered, so reading it back returns nothing. If you need the record’s final content, capture it on RECORD_UPDATED while it still exists.

RECORD_PUBLISHED

A record version went live.

Fires when: Publishing a version, immediately or by a schedule reaching its publish time.

KeyTypePresentDescription
recordIdstringalwaysThe record’s id.
modelKeystringalwaysThe model the record belongs to. This is the key hook filters most often match on.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

RECORD_UNPUBLISHED

A published record version was taken down.

Fires when: Unpublishing a version, immediately or by a schedule reaching its unpublish time.

KeyTypePresentDescription
recordIdstringalwaysThe record’s id.
modelKeystringalwaysThe model the record belongs to. This is the key hook filters most often match on.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

User events

The people your project signs in: created, changed, removed or merged.

No user event carries credential material: no password, no hash, no identity-provider anchor, no session token. email is delivered where the emitting path holds it.

USER_CREATED

A user was created.

Fires when: Creating a user, or a person signing themselves up through the public auth API.

KeyTypePresentDescription
userIdstringalwaysThe new user’s id.
emailstringalwaysThe user’s email address.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

USER_UPDATED

A user’s details changed.

Fires when: Updating a user through the API or the console.

KeyTypePresentDescription
userIdstringalwaysThe user’s id.
emailstringalwaysThe user’s email address AFTER the change.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

USER_DELETED

A user was deleted.

Fires when: Deleting a user. Fires only when an account was actually removed, so a repeated delete is silent.

KeyTypePresentDescription
userIdstringalwaysThe deleted user’s id.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

There is no email on this payload — the delete path does not re-read the row it is removing. Keep your own mapping from userId if you need to identify the user downstream.

USER_MERGED

Two users were merged into one.

Fires when: A real merge. A dry-run merge and a merge that moved nothing do not fire.

KeyTypePresentDescription
userIdstringalwaysThe surviving user’s id, the same value as survivorId, present so a handler written for the other user events keeps working.
survivorIdstringalwaysThe user that persists.
duplicateIdstringalwaysThe user that was absorbed. Re-point your own foreign keys from this id to survivorId.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

USER_PREFERENCE_CHANGED

A user’s notification preference changed.

Fires when: A user, or somebody acting for them, changing a preference through the API or console, a one-click RFC-8058 unsubscribe from an event-notification email, and a provider bounce or complaint suppressing the address. It fires for the people the project signs in; a console teammate’s own notification settings are not the project’s to hear about.

KeyTypePresentDescription
userIdstringalwaysThe user whose preference changed.
categorystringalwaysThe notification category. * is the global email opt-out, which suppresses every event-notification email rather than one category.
channelstringalwaysemail, push or in_app.
enabledbooleanalwaysThe state AFTER the change.
sourcestringalwaysWhy it is in that state: manual, unsubscribe, bounce or complaint.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

READ source BEFORE ACTING. A manual change is somebody choosing, and mirroring it outward is ordinary. An unsubscribe is a deliberate opt-out, and restoring one — in foir or in a system you sync to — is a compliance problem rather than a fix. A bounce or complaint is the provider suppressing an address, which is hygiene and carries no intent at all. Treating the three alike is how an opt-out gets undone by an integration that meant well.

projectId is always present: a preference this event reports always names its project.

Session events

A signed-in session’s lifecycle. Use it to drop a revoked session from your own cache or to force a re-authentication in a connected system.

SESSION_REVOKED

A session was revoked.

Fires when: Somebody revoking a session, the user signing out, or the app the session belongs to being disabled. An already-revoked or unknown session does not fire.

KeyTypePresentDescription
sessionIdstringalwaysThe revoked session’s id.
userIdstringalwaysThe user the session belonged to.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

No token material is delivered, by design — a session row carries a live credential and the event carries only its identity.

Operation events

An operation execution reached a terminal state. These are how you chain follow-up work off an operation without polling.

Every operation event carries the same three keys — executionId, operationKey, status — plus at most one of result or error. Loop protection applies: an operation re-fired by its own terminal event is refused once its key is already in the causation chain, and no chain may exceed three hops.

OPERATION_COMPLETED

An operation execution finished successfully.

Fires when: An operation returning success, whether inline or through an async callback.

KeyTypePresentDescription
executionIdstringalwaysThe operation execution’s id. Key your handler on it to make retries idempotent.
operationKeystringalwaysThe key of the operation that ran.
statusstringalwaysThe terminal status the execution reached.
resultobjectsometimesThe operation’s own return value. Absent when the operation returned nothing.

OPERATION_FAILED

An operation execution finished with an error.

Fires when: An operation returning a failure, or exhausting its retries.

KeyTypePresentDescription
executionIdstringalwaysThe operation execution’s id. Key your handler on it to make retries idempotent.
operationKeystringalwaysThe key of the operation that ran.
statusstringalwaysThe terminal status the execution reached.
errorobjectsometimesThe error, as {code, message, retryable}. Absent when the failure carried no structured error.

OPERATION_CANCELLED

An operation execution was cancelled before completing.

Fires when: Someone cancelling an execution from the console or the API, or the extension cancelling itself.

KeyTypePresentDescription
executionIdstringalwaysThe operation execution’s id. Key your handler on it to make retries idempotent.
operationKeystringalwaysThe key of the operation that ran.
statusstringalwaysThe terminal status the execution reached.

A cancel carries neither result nor error — the execution produced neither.

OPERATION_TIMED_OUT

An async operation did not call back in time and was reaped.

Fires when: The watchdog reaping a callback-mode execution that passed its callback TTL.

KeyTypePresentDescription
executionIdstringalwaysThe operation execution’s id. Key your handler on it to make retries idempotent.
operationKeystringalwaysThe key of the operation that ran.
statusstringalwaysThe terminal status the execution reached.
errorobjectsometimesThe watchdog’s timeout error — not output from the operation, which never reported.

Import events

What a maintenance-mode batch sends instead of one delivery per record.

A bulk write withholds the per-record RECORD_* events on purpose: fifty thousand deliveries is not a notification, it is an outage on your endpoint. The summary is the replacement message, not a quieter version of the same thing — without it you would be silently stale, with no way to know you need to re-read.

See also BULK_UPDATE_COMPLETED and MIGRATION_APPLIED, which follow the same rule.

IMPORT_COMPLETED

A batch import finished.

Fires when: A BatchRecordOperations call sent with maintenance set.

KeyTypePresentDescription
modelKeystringalwaysThe model the records belong to.
recordCountnumberalwaysHow many records the operation touched.
recordIdsstring[]sometimesThe ids that moved. Present only when recordCount is at or below 1000; above that, re-read the model instead.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

This is the whole notification for that batch — the per-record RECORD_CREATED / RECORD_UPDATED / RECORD_DELETED events are deliberately withheld, because one delivery per record is an outage on your endpoint rather than a notification. Without maintenance the batch behaves exactly as it always has.

Migration events

A schema migration finished moving record data.

Same contract as IMPORT_COMPLETED: one message for the whole operation, in place of the per-record events the migration deliberately withholds.

MIGRATION_APPLIED

A schema migration finished moving record data.

Fires when: A migration finishing in the background — one whose corpus was too large to complete inside the push.

KeyTypePresentDescription
modelKeystringalwaysThe model the records belong to.
recordCountnumberalwaysHow many records the operation touched.
recordIdsstring[]sometimesThe ids that moved. Present only when recordCount is at or below 1000; above that, re-read the model instead.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

Only the asynchronous half sends this. A migration small enough to finish inside the push has already completed by the time that call returns, so its outcome is in the push’s own output rather than an event arriving later.

Bulk update events

A predicate-scoped bulk update finished.

Same contract as IMPORT_COMPLETED: one message for the whole operation, in place of the per-record RECORD_UPDATED deliveries the write would otherwise produce.

BULK_UPDATE_COMPLETED

A bulk update finished.

Fires when: A BulkUpdateRecords call sent with maintenance set.

KeyTypePresentDescription
modelKeystringalwaysThe model the records belong to.
recordCountnumberalwaysHow many records the operation touched.
recordIdsstring[]sometimesThe ids that moved. Present only when recordCount is at or below 1000; above that, re-read the model instead.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

As with IMPORT_COMPLETED, the per-record RECORD_UPDATED deliveries this write would otherwise produce are withheld in favour of this one message.

BULK_PUBLISH_COMPLETED

A bulk publish finished.

Fires when: A PublishVersion of many versions (version_ids) sent with maintenance set.

KeyTypePresentDescription
modelKeystringalwaysThe model the records belong to.
recordCountnumberalwaysHow many records the operation touched.
recordIdsstring[]sometimesThe ids that moved. Present only when recordCount is at or below 1000; above that, re-read the model instead.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

Distinct from IMPORT_COMPLETED on purpose: an import says rows arrived, this says rows went live. If you warm a cache, purge a CDN or notify an audience on publication, this is the one to listen for. The per-record RECORD_PUBLISHED deliveries the batch would otherwise produce are withheld in favour of this single message. Scheduled publishing is unaffected and still sends one RECORD_PUBLISHED per record — a schedule firing is normal operation, not maintenance.

Organization events

The organizations inside a project, which are the tenants of a product built on Foir. These let you mirror your own tenancy without polling: an organization is created, renamed, moved in the tree, suspended, put on a deletion clock and finally deleted, and its members come and go.

Each event belongs to the organization it describes. A project hook created by a credential confined to one organization receives that organization’s events and never a sibling’s. A project hook with no organization receives every organization’s. A hook confined to a parent does not receive its children’s events, the same as for every other event, so subscribe from the project to follow a whole tree.

Only real transitions fire. A save that changes nothing, a move to the parent the organization already has, and a status write to the status it already holds send nothing.

Suspension and deletion reach the tree differently. Suspending an organization stops its whole subtree without writing to it, so ORGANIZATION_SUSPENDED fires once, for the organization that was suspended, and you should treat everything beneath it as suspended too. A deletion destroys the subtree, so the deletion events fire once for every organization involved.

Each event is recorded with its change. The event is written in the same transaction as the change it describes, whichever way the change was made, so a change never stands without its event and an event never describes a change that did not happen. Delivery can still repeat an event, so reconcile against the organizations API rather than counting deliveries.

Quota caps are not published here. A cap is configuration the platform enforces on your behalf, and a change to one is recorded on the audit log instead.

ORGANIZATION_CREATED

An organization was created.

Fires when: Creating an organization through the API or the console, at the root of the project or under a parent, or a user registering one through self-service sign-up where the project offers it.

KeyTypePresentDescription
orgIdstringalwaysThe organization the event is about.
parentIdstringalwaysThe organization’s parent. Empty when it is a root of the project.
namestringalwaysThe organization’s name.
statusstringalwaysThe organization’s status, which is active for a new one.
founderIdstringsometimesThe user who registered the organization through self-service sign-up. Present only for that path.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

A new organization has no subscriptions of its own yet, so this reaches project-wide hooks. A self-service registration makes the founder the first member, which arrives as ORGANIZATION_MEMBER_ADDED.

ORGANIZATION_UPDATED

An organization’s name, presentation or own settings changed.

Fires when: Renaming an organization, changing its presentation (display name, logo, colour, sender name, reply-to address, support address, app URL, terms or privacy address), or changing its own settings (where its users stand, who may join it and the role joining gives, its sign-in methods, whether it requires a second factor, and whether wrong passwords lock an account), including clearing an override so the field inherits again. A save that changes nothing does not fire.

KeyTypePresentDescription
orgIdstringalwaysThe organization the event is about.
parentIdstringalwaysThe organization’s parent. Empty when it is a root of the project.
namestringalwaysThe organization’s name after the change.
changedstring[]alwaysWhich fields changed, from name, displayName, logoUrl, primaryColor, fromName, replyTo, supportEmail, appBaseUrl, termsUrl, privacyUrl, users, joining, joiningRoleId, signInMethods, requiresSecondFactor and locksAccountsAfterFailedSignIns.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

The presentation values after the change are in state. A field absent there has no override, so the organization inherits it from the nearest organization above that sets it, then from the project. A change here also changes what every organization below inherits for the fields they leave empty, and this event fires only for the organization that changed.

ORGANIZATION_MOVED

An organization moved to a different parent, taking everything beneath it along.

Fires when: Re-parenting an organization, including promoting it to a root of the project. A move to the parent it already has does not fire.

KeyTypePresentDescription
orgIdstringalwaysThe organization that moved.
parentIdstringalwaysIts new parent. Empty when it is now a root.
previousParentIdstringalwaysIts parent before the move. Empty when it was a root.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

Only the organization that was moved fires. Everything beneath it moved too, but each descendant kept its own parent, so if you record full ancestry, recompute it for the whole subtree.

ORGANIZATION_SUSPENDED

An organization was suspended.

Fires when: Changing an active organization’s status to suspended.

KeyTypePresentDescription
orgIdstringalwaysThe organization the event is about.
parentIdstringalwaysThe organization’s parent. Empty when it is a root of the project.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

Its users can no longer sign in, and none of its data is touched. Suspension covers the whole subtree without being written to it, so this fires once, for the organization that was suspended. Treat every organization beneath it as suspended too.

ORGANIZATION_RESUMED

A suspended organization was made active again.

Fires when: Changing a suspended organization’s status back to active. Cancelling a scheduled deletion sends ORGANIZATION_DELETION_CANCELLED instead.

KeyTypePresentDescription
orgIdstringalwaysThe organization the event is about.
parentIdstringalwaysThe organization’s parent. Empty when it is a root of the project.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

An organization is usable only while every organization above it is active, which is why resuming one whose ancestor is still suspended is refused rather than accepted and ineffective.

ORGANIZATION_DELETION_SCHEDULED

An organization was put on a deletion clock.

Fires when: Scheduling an organization for deletion. It fires for that organization and for every organization beneath it, all with the same deadline. Scheduling one that is already scheduled restarts the clock and fires again.

KeyTypePresentDescription
orgIdstringalwaysThe organization the event is about.
parentIdstringalwaysThe organization’s parent. Empty when it is a root of the project.
deletionScheduledAtstringalwaysWhen the retention window closes and the data may be destroyed, as an RFC 3339 timestamp.
rootOrgIdstringalwaysThe organization the deletion was scheduled on. The same as orgId for that one, and its ancestor for every organization beneath it.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

Nothing is removed yet. The schedule can be cancelled until the window closes, and ORGANIZATION_DELETED follows only if it is not.

ORGANIZATION_DELETION_CANCELLED

An organization’s scheduled deletion was cancelled.

Fires when: Changing a scheduled organization’s status to active or suspended. It fires for that organization and for every organization beneath it that the schedule covered.

KeyTypePresentDescription
orgIdstringalwaysThe organization the event is about.
parentIdstringalwaysThe organization’s parent. Empty when it is a root of the project.
statusstringalwaysThe status the organization returned to, active or suspended.
rootOrgIdstringalwaysThe organization the cancellation was made on. The same as orgId for that one, and its ancestor for every organization beneath it.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

An organization beneath the one that was cancelled returns to the status it held before the schedule, so one that was suspended in its own right comes back suspended rather than active.

ORGANIZATION_DELETED

An organization and everything it owned were destroyed.

Fires when: The retention window of a scheduled deletion closing. A subtree is destroyed from the leaves up, so a child is always destroyed before its parent.

KeyTypePresentDescription
orgIdstringalwaysThe organization the event is about.
parentIdstringalwaysThe organization’s parent. Empty when it is a root of the project.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

This is the last event about the organization, and parentId is its parent at the moment it was destroyed. Its own subscriptions are destroyed with it, so this reaches project-wide hooks, and reading the organization back returns nothing.

ORGANIZATION_MEMBER_ADDED

A user became a member of an organization.

Fires when: Adding a member through the API or the console, an organization’s own manager staffing it, or a founder registering an organization, which makes them its first member.

KeyTypePresentDescription
orgIdstringalwaysThe organization the membership belongs to.
userIdstringalwaysThe member.
roleIdstringsometimesThe role the membership carries. Absent when it carries none, which grants nothing until a role is given.
roleKeystringsometimesThe key of that role. Absent whenever roleId is.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

Adding someone who is already a member with a different role sends ORGANIZATION_MEMBER_ROLE_CHANGED instead, and adding them with the role they hold sends nothing. Changes to one organization’s membership are applied one at a time, so two adds of the same user made together produce exactly one ORGANIZATION_MEMBER_ADDED: the second sees the membership the first created.

ORGANIZATION_MEMBER_REMOVED

A user’s membership of an organization was removed.

Fires when: Removing a member through the API or the console, or an organization’s own manager removing one of its staff. Removing someone who is not a member does not fire.

KeyTypePresentDescription
orgIdstringalwaysThe organization the membership belongs to.
userIdstringalwaysThe member.
roleIdstringsometimesThe role the membership carried when it was removed. Absent when it carried none.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

The user still exists. Removing a membership withdraws what it granted and touches none of the organization’s data.

ORGANIZATION_MEMBER_ROLE_CHANGED

A member’s role in an organization changed.

Fires when: Adding an existing member again with a different role, or with none.

KeyTypePresentDescription
orgIdstringalwaysThe organization the membership belongs to.
userIdstringalwaysThe member.
roleIdstringsometimesThe role after the change. Absent when the role was cleared.
roleKeystringsometimesThe key of that role. Absent whenever roleId is.
previousRoleIdstringsometimesThe role before the change. Absent when there was none.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

Join request events

Requests to join an organization that takes them. Somebody who can already sign in at an organization’s page, and is not a member, asks to join by signing in there; its staff then approve or decline.

Each event stands at the organization and names the person. An organization’s hook hears the requests to join it, and a project hook hears every organization’s. An approval also sends ORGANIZATION_MEMBER_ADDED, so a subscriber that only mirrors membership needs nothing here.

JOIN_REQUESTED

A person asked to join an organization.

Fires when: Somebody of the pool that serves an organization taking requests, who is not a member of it, signs in at its page. Signing in again while the request waits does not fire again.

KeyTypePresentDescription
requestIdstringalwaysThe request.
orgIdstringalwaysThe organization asked to join.
userIdstringalwaysThe person asking.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

The event stands at the organization and names the person, so it is read by whoever reaches them there. Staff holding members:write approve or decline the request.

JOIN_REQUEST_APPROVED

A request to join an organization was approved.

Fires when: Staff approving the request through the API or the console. The person is then a member, with the role the approval named or else the organization’s joining role, and ORGANIZATION_MEMBER_ADDED fires too.

KeyTypePresentDescription
requestIdstringalwaysThe request.
orgIdstringalwaysThe organization asked to join.
userIdstringalwaysThe person asking.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

The person is emailed that they may now sign in.

JOIN_REQUEST_DECLINED

A request to join an organization was declined.

Fires when: Staff declining the request through the API or the console.

KeyTypePresentDescription
requestIdstringalwaysThe request.
orgIdstringalwaysThe organization asked to join.
userIdstringalwaysThe person asking.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the event belongs to.

The person is emailed the outcome and may ask again by signing in at the organization’s page.

Workspace events

Subscribe to these with a workspace hook, on the workspace itself rather than on a project. One workspace hook covers every project in the workspace, including projects created after the hook was.

The two planes are kept apart on purpose: a project hook cannot subscribe to a workspace event and a workspace hook cannot subscribe to a project event. A subscription created on the wrong plane would be accepted and would then never fire, so it is refused instead.

Membership events

Who has access to the workspace, and with what role.

Membership is granted through two surfaces (a role assignment and an access grant) and they do not send an identical key set. The Present column below says which keys you can rely on.

MEMBERSHIP_GRANTED

A team member was granted access to the workspace or to a project in it.

Fires when: Granting workspace access, or giving a team member a role. A role at the platform root, outside any workspace, does not fire.

KeyTypePresentDescription
userIdstringalwaysThe team member who received the access.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringsometimesThe project the event belongs to.
roleIdstringalwaysThe granted role’s id.
roleKeystringalwaysThe granted role’s key.
actorIdstringalwaysWho performed the action.

projectId is empty for workspace-wide access and set for access scoped to one project.

MEMBERSHIP_REVOKED

A team member’s access was withdrawn.

Fires when: Revoking a workspace access grant, taking a role from a team member, a team member being removed from the workspace or a project or leaving it, and a team member’s account being deleted, once for each role that went. Taking a role from a person the project signs in is the project’s own authorization, not workspace membership, and does not fire.

KeyTypePresentDescription
userIdstringalwaysThe team member whose access was withdrawn.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringsometimesThe project the event belongs to.
roleIdstringalwaysThe revoked role’s id.
roleKeystringalwaysThe revoked role’s key.
actorIdstringalwaysWho performed the action.
reasonstringsometimesWhy the role went, where it went with more than itself: membership_ended when the person was removed or left, account_deleted when their account was deleted. Absent when the role alone was taken.

Both revoke surfaces send roleId and roleKey, so a filter on either matches every revoke, mirroring MEMBERSHIP_GRANTED.

MEMBERSHIP_ROLE_CHANGED

A team member’s role changed.

This event is never emitted. No platform path emits MEMBERSHIP_ROLE_CHANGED. A role change is applied as a revoke followed by a grant, so it reaches you as MEMBERSHIP_REVOKED and then MEMBERSHIP_GRANTED for the same userId. Creating a subscription to this event is rejected — subscribe to the two membership events instead.

Billing events

The workspace’s plan and subscription state.

Both fire only on a real transition: a renewal or a card change does not fire TENANT_PLAN_CHANGED. TENANT_PLAN_CHANGED commits with the subscription change that raises it. TENANT_SUBSCRIPTION_STATUS_CHANGED is emitted after the billing change has committed, so treat it as at-most-once and reconcile against the billing API rather than counting deliveries.

TENANT_PLAN_CHANGED

The workspace moved to a different billing plan.

Fires when: A subscription change that resolves to a different plan. A renewal, a card change or any other update that leaves the plan alone does not fire.

KeyTypePresentDescription
tenantIdstringalwaysThe workspace the event belongs to.
planIdstringalwaysThe new plan’s id.
planKindstringalwaysThe new plan’s kind.
previousPlanstringalwaysThe plan id in effect before the change. Empty when the workspace had no resolved plan.
statusstringalwaysThe subscription status after the change.

TENANT_SUBSCRIPTION_STATUS_CHANGED

The workspace’s subscription status changed — for example to past due, or back to active.

Fires when: A real status transition. A repeated notification of the status the workspace already has does not fire.

KeyTypePresentDescription
tenantIdstringalwaysThe workspace the event belongs to.
statusstringalwaysThe new subscription status.

This payload carries no plan information. If you need the plan as well, read it back from the billing API, or subscribe to TENANT_PLAN_CHANGED too.

Project lifecycle events

Projects appearing and disappearing inside the workspace. These are the only two workspace events whose payload carries a project — which is why they are the only two that can run an operation rather than merely notify. Every other workspace event describes the workspace itself, so it can only notify.

PROJECT_CREATED

A project was created in the workspace.

Fires when: Creating a project.

KeyTypePresentDescription
projectIdstringalwaysThe new project’s id.
tenantIdstringalwaysThe workspace the event belongs to.
namestringalwaysThe project’s name.
actorIdstringalwaysWho performed the action.

A project may still be finishing setup when this fires. A hook that runs an operation the new project cannot resolve yet is retried for a short window before it is treated as a failure, so a setup operation does not need to guard against the race itself.

PROJECT_ARCHIVED

A project was deleted.

Fires when: Deleting a project, or approving a request to delete one. Deleting the workspace’s default project is refused and does not fire. Deleting a project that is already deleted changes nothing and does not fire.

KeyTypePresentDescription
projectIdstringalwaysThe deleted project’s id.
tenantIdstringalwaysThe workspace the event belongs to.
actorIdstringalwaysWho performed the action.

The event keeps the name it was given when a deleted project was called archived. A deleted project stops answering at once and is kept for its retention window, in which it can be reactivated: that fires PROJECT_REACTIVATED. When the window closes its data is destroyed, and nothing fires for that.

Unlike PROJECT_CREATED this payload carries no name. A deletion commits with its event, whether it was made directly or by approving a request.

PROJECT_REACTIVATED

A deleted project was reactivated.

Fires when: Reactivating a deleted project before its retention window closes. Reactivating a project that is not deleted is refused and does not fire.

KeyTypePresentDescription
projectIdstringalwaysThe reactivated project’s id.
tenantIdstringalwaysThe workspace the event belongs to.
actorIdstringalwaysWho performed the action.

It undoes what PROJECT_ARCHIVED said: the project answers again, with everything it held when it was deleted. A consumer that stopped working for the project when it was deleted starts again here.

It commits with the reactivation, so a reactivation that happened has its event. The two can alternate for one project any number of times.

Invitation events

The accept is the event; the invite itself is not published, because an invitation row carries a bearer token that would be a live credential on a durable log.

INVITATION_ACCEPTED

Someone accepted an invitation and joined the place it asked them to.

Fires when: An invited person completing the accept, for an invitation to the workspace or to one of its projects or organizations. Sending or revoking an invitation does not fire.

KeyTypePresentDescription
invitationIdstringalwaysThe accepted invitation’s id.
tenantIdstringalwaysThe workspace the event belongs to.
projectIdstringalwaysThe project the invitation was to. Empty for one to the workspace.
orgIdstringalwaysThe organization the invitation was to. Empty for one to the project or the workspace.
emailstringalwaysThe address the invitation was sent to.
userIdstringalwaysThe person the accept made, or who held the address already and joined.
roleIdstringsometimesThe role the invitation conferred. Always present for one to the workspace, and present for one to a project or an organization where the invitation named a role.
roleKeystringsometimesThe key of that role.
invitedBystringalwaysWho sent the invitation: a person’s id, or the key’s.
projectIdsstring[]alwaysThe projects an invitation to the workspace gave its role at. Empty for the whole workspace, and for an invitation to a project.

The invitation token is never delivered. It is a bearer credential, and anyone holding it could accept the invitation.

See also

  • Webhooks — wiring a receiver, verifying a delivery, retries and redelivery
  • Lifecycle Hooks — creating hooks, filters, sync vs async
  • Defining Hooks — defineHook in your config file
Last updated on