Activity and workspaces

Drafts and revisions

Edit a workspace spec through its shared draft, review the changes, activate them as an immutable revision and roll back from History.

Every workspace has one shared draft. The dashboard and connected coding agents edit the same draft, so you can watch an agent’s proposal appear and fix it before anything goes live. Activating the draft saves it as an immutable revision and rebuilds every view from the observations already stored. Older revisions stay in History, and rolling back to one rebuilds the views again.

Reading or changing the draft, activating and rolling back need an organisation owner or admin, or an API key with workspaces:manage. Members can see the active spec and its revisions but not the draft.

Edit in the dashboard

  1. Open Workspace. The header shows Active with the active revision id.
  2. Choose Edit. The header switches to Editing a draft and a draft bar appears at the bottom of the page.
  3. Make changes in Data (the dictionary), Entities, Events, Views and Alerts, or under Advanced → JSON to edit the whole spec at once. Saving the JSON tab replaces the draft in one step.
  4. The draft bar shows how many changes are pending and who edited the draft last, including the coding agent’s name when the edit came over MCP. Validation issues are listed above the tabs: Blocks activation for errors, Warning for things that will render empty.
  5. Choose Review to open Review changes. It lists new and removed record types, removed attributes, each change in plain language, and Already in your traffic: undeclared keys your app has been sending that this draft would start keeping.
  6. Choose Activate. Views rebuild in the background and the header shows Rebuilding views until the new revision is active.

Discard throws the whole draft away, including edits from your coding agent. The active revision is not touched.

Edit through the API or MCP

An agent, or your own script, follows the same loop the dashboard uses:

  1. Read the draft with workspaces_draft (GET /workspaces/{workspaceId}/draft). The first read creates the draft from the active spec. The response has the draft, its version and its validation issues.
  2. Send typed edits with workspaces_applyDraftOps, passing the version you read.
  3. Check workspaces_draftChanges for the plain-language change list and remaining issues.
  4. Activate with workspaces_activateDraft once a person has approved. Pass version to activate only if nobody has edited the draft since.
# 1. Read the draft and note its version
curl "$AXONPUSH_BASE_URL/workspaces/$WORKSPACE_ID/draft" \
-H "X-API-Key: $AXONPUSH_MANAGE_KEY"

# 2. Apply ops against that version
curl -X POST "$AXONPUSH_BASE_URL/workspaces/$WORKSPACE_ID/draft/ops" \
-H "X-API-Key: $AXONPUSH_MANAGE_KEY" \
-H "Content-Type: application/json" \
-d '{
  "version": 4,
  "ops": [
    { "op": "attribute.add", "attribute": { "key": "channel", "label": "Channel", "type": "enum", "values": ["email", "chat"] } },
    { "op": "entity.field.add", "type": "ticket", "key": "channel" }
  ]
}'

# 3. Review
curl "$AXONPUSH_BASE_URL/workspaces/$WORKSPACE_ID/draft/changes" \
-H "X-API-Key: $AXONPUSH_MANAGE_KEY"

# 4. Activate (only if still at version 5)
curl -X POST "$AXONPUSH_BASE_URL/workspaces/$WORKSPACE_ID/draft/activate" \
-H "X-API-Key: $AXONPUSH_MANAGE_KEY" \
-H "Content-Type: application/json" \
-d '{ "version": 5 }'

The .NET SDK exposes the same calls as client.Workspaces.DraftAsync, ApplyDraftOpsAsync, DraftChangesAsync and ActivateDraftAsync.

Ops apply in order and all or nothing; a batch holds 1 to 100 ops. The response is the new draft with its issues and version + 1. If the draft changed since the version you sent, the server answers 409 with the current draft in the error body: re-read it and reapply your ops. A bad op answers 422 and nothing is applied.

To replace the whole draft instead, PUT /workspaces/{workspaceId}/draft with { "version": n, "spec": {...} } (workspaces_replaceDraft). Discard it with DELETE /workspaces/{workspaceId}/draft.

Draft ops

OpsEdits
workspace.updateName, description, heartbeat event
attribute.add, attribute.update, attribute.removeThe data dictionary. update cannot change the key; remove removes it everywhere it is used
entity.add, entity.update, entity.removeEntities. update changes label, description and terminal states; fields, profile and events change only when given
entity.field.add, entity.field.removeWhat an entity stores (type, key)
entity.profile.add, entity.profile.removeWhat identify may set (type, key)
event.add, event.update, event.removeAn entity’s event rules (type, match)
funnel.add, funnel.update, funnel.removeFunnels, by name
view.add, view.update, view.removeViews, by view id passed as name
alert.add, alert.update, alert.removeAlerts, by name

workspaces_describe returns this catalogue with an example of each op.

Check the draft against real traffic

workspaces_catalog (GET /workspaces/{workspaceId}/catalog?window=24h) lists the events your app has actually sent in the window (1h, 24h, 7d or 30d): counts, the entity types in their refs, the attribute keys seen, which entities consume each event, how many events nothing consumes (unmapped) and which keys are undeclared. It is the best place for an agent to check its draft against reality before asking you to activate.

To test a spec without saving anything:

Revisions, activation and rollback

A revision is an immutable copy of a spec with an id, its author and a timestamp. The workspace records activeRevision, requestedRevision and a generation counter (GET /workspaces/{workspaceId}). While requestedRevision differs from activeRevision, projections are rebuilding with the requested one.

Workspace → Advanced → History lists every revision with a short summary of what changed from the one before. To roll back, choose Roll back on an older revision and confirm. Views rebuild from stored evidence with that version, and your current draft is kept.

Through the API, rollback is POST /workspaces/{workspaceId}/activate with { "revision": "<id>", "generation": <current generation> }. A stale generation returns 409. You can also save a revision without activating it with POST /workspaces/{workspaceId}/revisions.

Activation never deletes stored observations. Changing the spec changes how they are projected: a newly declared attribute starts being kept from new observations, and every view is rebuilt from what is already stored.

Draft discards, draft activations, revision saves and activations are recorded in the organisation audit log.