Workspace

workspace.updated

Workspace name, slug, icon, or one of its two security switches was updated.

When it fires

Sent after UpdateWorkspaceService successfully writes changes, and after either workspace security switch flips: requiring two factor authentication of every member, or turning verification codes on or off. The changes array lists which fields were touched, so a receiver that only cares about the security switches can filter on requireTwoFactor and requireStepUp.

Payload

ts
{
    type: 'workspace.updated',
    data: {
        workspace: {
            id: string
            name: string
            slug: string
            icon?: string | null
            requireTwoFactor?: boolean
            requireStepUp?: boolean
        }
        changes: Array<'name' | 'slug' | 'icon' | 'nameUpdatedAt' | 'iconUpdatedAt' | 'requireTwoFactor' | 'requireStepUp'>
    }
}

The security switches each send only their own flag alongside id, name and slug, with changes holding that one field. A requireStepUp: false event is the one to alert on: from that moment, sensitive actions in the workspace run without a verification code.

Example

json
{
    "type": "workspace.updated",
    "data": {
        "workspace": {
            "id": "0192a1b2-c3d4-7000-8000-000000000001",
            "name": "Acme Inc",
            "slug": "acme",
            "icon": "0192a1b2-c3d4-7000-8000-000000000099"
        },
        "changes": ["name", "icon", "nameUpdatedAt", "iconUpdatedAt"]
    }
}