POST /workspaces/{workspaceId}/draft/ops
Ops apply in order and all-or-nothing. The result is validated and returned with its issues and version+1. Ops: workspace.update; attribute.add|update|remove (the data dictionary); entity.add|update|remove; entity.field.add|remove and entity.profile.add|remove (key = attribute); event.add|update|remove (type = entity, match = rule); funnel.*, alert.* (name) and view.* (name = view id). Call workspaces.describe for the full format and examples. On 409, re-read the draft from the error body and reapply.
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://example.com/workspaces/string/draft/ops" \ -H "Content-Type: application/json" \ -d '{ "ops": [ { "op": "workspace.update" } ], "version": 1 }'{ "$schema": "https://example.com/schemas/ActivityDraftView.json", "draft": { "baseRevision": "string", "spec": { "$schema": "https://example.com/schemas/ActivityWorkspaceSpec.json", "alerts": [ { "afterSeconds": 60, "cooldownSeconds": 0, "entity": "string", "filter": { "key": "string", "role": "string", "values": [ "string" ] }, "minCount": 0, "name": "string", "silent": true, "state": "string", "windowSeconds": 0 } ], "attributes": [ { "cancelled": [ "string" ], "description": "string", "entity": "string", "expected": [ "string" ], "failure": [ "string" ], "key": "string", "label": "string", "maxLength": 0, "multiple": true, "pending": [ "string" ], "personal": true, "role": "outcome", "scope": true, "type": "text", "values": [ "string" ] } ], "description": "string", "entities": [ { "description": "string", "events": [ { "erase": true, "label": "string", "match": "string", "only": [ "string" ], "passive": true, "set": { "property1": "string", "property2": "string" } } ], "fields": [ "string" ], "label": "string", "profile": [ "string" ], "rollup": [ "string" ], "staleAfterSeconds": 0, "staleStates": [ "string" ], "terminal": [ "string" ], "type": "string" } ], "funnels": [ { "activation": { "from": "string", "to": "string", "withinSeconds": 60 }, "entity": "string", "errorKey": "string", "failure": "string", "linkedTo": "string", "name": "string", "splitBy": "string", "stages": [ "string" ] } ], "heartbeat": "string", "name": "string", "schemaVersion": 0, "template": { "id": "string", "version": 1 }, "views": [ { "entities": [ "string" ], "entity": "string", "exclude": [ { "key": "string", "role": "string", "values": [ "string" ] } ], "filter": { "key": "string", "role": "string", "values": [ "string" ] }, "from": { "event": "string" }, "funnel": "string", "id": "string", "key": "string", "limit": 0, "minCohort": 0, "open": true, "role": "string", "splitBy": [ "string" ], "state": [ "string" ], "title": "string", "to": { "event": "string" }, "type": "kpi", "window": "15m" } ] }, "updatedAt": "2019-08-24T14:15:22Z", "updatedBy": "string", "updatedClient": "string", "updatedSource": "dashboard", "version": 0, "workspaceId": "string" }, "issues": [ { "message": "string", "path": "string", "severity": "error" } ]}1 <= items <= 100The draft version you read; a mismatch returns 409 with the current draft
int641 <= valuePOST /workspaces/{workspaceId}/draft/activate is then cleared POST
Fails with 422 listing the issues when the draft has validation errors. Projections rebuild in the background; the workspace's requestedRevision shows progress until it becomes the activeRevision.
GET /workspaces/{workspaceId}/catalog and undeclared) and which entities consume each event' GET
Use it to find events no entity consumes yet and attributes your app sends that the dictionary does not declare.