{"openapi":"3.1.0","info":{"title":"Lazynext API","version":"1.4.1.1","description":"Public REST API for Lazynext. Bearer-token auth, per-key scopes (read | write), workspace-scoped. See https://lazynext.com/docs/api for the prose reference.","license":{"name":"Proprietary","url":"https://lazynext.com/terms"}},"servers":[{"url":"https://lazynext.com/api/v1","description":"Production"}],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"lzx_<43 base64url chars>","description":"Authorization: Bearer lzx_…"},"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Same key as bearer; alternate header."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code"},"message":{"type":"string","description":"Human-readable explanation"},"requiredScope":{"type":"string","description":"Set on INSUFFICIENT_SCOPE responses"}}},"Decision":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspace_id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["proposed","accepted","rejected","archived"]},"quality_score":{"type":"number"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Node":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspace_id":{"type":"string","format":"uuid"},"workflow_id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["task","doc","table","thread","decision","automation","pulse"]},"title":{"type":"string"},"data":{"type":"object"},"position_x":{"type":"integer"},"position_y":{"type":"integer"},"status":{"type":"string","enum":["backlog","todo","in_progress","in_review","done","cancelled"]},"assigned_to":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}}}},"paths":{"/decisions":{"get":{"summary":"List decisions in a workspace","tags":["Decisions"],"parameters":[{"name":"workspaceId","in":"query","required":true,"description":"UUID of the workspace. Bearer keys are workspace-scoped — the key must belong to this workspace.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"List of decisions","content":{"application/json":{"schema":{"type":"object","properties":{"decisions":{"type":"array","items":{"$ref":"#/components/schemas/Decision"}}}}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Bearer key does not belong to workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (api bucket: 100/min)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a decision","description":"Requires `write` scope on the API key.","tags":["Decisions"],"parameters":[{"name":"workspaceId","in":"query","required":true,"description":"UUID of the workspace. Bearer keys are workspace-scoped — the key must belong to this workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["proposed","accepted","rejected"]}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Decision"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"INSUFFICIENT_SCOPE — key lacks `write`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (mutation bucket: 30/min)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/decisions/{id}":{"get":{"summary":"Get a decision by id","tags":["Decisions"],"parameters":[{"name":"id","in":"path","required":true,"description":"Resource UUID","schema":{"type":"string","format":"uuid"}},{"name":"workspaceId","in":"query","required":true,"description":"UUID of the workspace. Bearer keys are workspace-scoped — the key must belong to this workspace.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The decision","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Decision"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a decision","description":"Requires `write` scope.","tags":["Decisions"],"parameters":[{"name":"id","in":"path","required":true,"description":"Resource UUID","schema":{"type":"string","format":"uuid"}},{"name":"workspaceId","in":"query","required":true,"description":"UUID of the workspace. Bearer keys are workspace-scoped — the key must belong to this workspace.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["proposed","accepted","rejected","archived"]}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Decision"}}}},"403":{"description":"INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"mutation bucket: 30/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a decision","description":"Requires `write` scope.","tags":["Decisions"],"parameters":[{"name":"id","in":"path","required":true,"description":"Resource UUID","schema":{"type":"string","format":"uuid"}},{"name":"workspaceId","in":"query","required":true,"description":"UUID of the workspace. Bearer keys are workspace-scoped — the key must belong to this workspace.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Deleted"},"403":{"description":"INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"mutation bucket: 30/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/decisions/export-csv":{"get":{"summary":"Export decisions as CSV","tags":["Decisions","Export"],"parameters":[{"name":"workspaceId","in":"query","required":true,"description":"UUID of the workspace. Bearer keys are workspace-scoped — the key must belong to this workspace.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"CSV file","content":{"text/csv":{"schema":{"type":"string"}}}},"429":{"description":"export bucket: 10/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/export":{"get":{"summary":"Export full workspace as JSON","tags":["Export"],"parameters":[{"name":"workspaceId","in":"query","required":true,"description":"UUID of the workspace. Bearer keys are workspace-scoped — the key must belong to this workspace.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Workspace JSON snapshot"},"429":{"description":"export bucket: 10/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/audit-log":{"get":{"summary":"Read workspace audit log","tags":["Audit"],"parameters":[{"name":"workspaceId","in":"query","required":true,"description":"UUID of the workspace. Bearer keys are workspace-scoped — the key must belong to this workspace.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Audit log entries"},"429":{"description":"api bucket: 100/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/nodes":{"get":{"summary":"List nodes in a workflow","tags":["Nodes"],"parameters":[{"name":"workflowId","in":"query","required":true,"description":"UUID of the workflow. The workflow's workspace must match the bearer key's workspace.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"List of nodes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Node"}}}}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Bearer key does not belong to workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"api bucket: 100/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a node","description":"Requires `write` scope.","tags":["Nodes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["workflowId","workspaceId","type","title","positionX","positionY"],"properties":{"workflowId":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["task","doc","table","thread","decision","automation","pulse"]},"title":{"type":"string"},"positionX":{"type":"integer"},"positionY":{"type":"integer"},"status":{"type":"string","enum":["backlog","todo","in_progress","in_review","done","cancelled"]},"assignedTo":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Node"}}}},"403":{"description":"INSUFFICIENT_SCOPE — key lacks `write`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"mutation bucket: 30/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/nodes/{id}":{"get":{"summary":"Get a node","tags":["Nodes"],"parameters":[{"name":"id","in":"path","required":true,"description":"Resource UUID","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The node","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Node"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a node","description":"Requires `write` scope.","tags":["Nodes"],"parameters":[{"name":"id","in":"path","required":true,"description":"Resource UUID","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"positionX":{"type":"integer"},"positionY":{"type":"integer"},"status":{"type":"string","enum":["backlog","todo","in_progress","in_review","done","cancelled"]},"assignedTo":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Node"}}}},"403":{"description":"INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"mutation bucket: 30/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a node","description":"Requires `write` scope.","tags":["Nodes"],"parameters":[{"name":"id","in":"path","required":true,"description":"Resource UUID","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deleted"},"403":{"description":"INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"mutation bucket: 30/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/edges":{"get":{"summary":"List edges in a workflow","tags":["Edges"],"parameters":[{"name":"workflowId","in":"query","required":true,"description":"UUID of the workflow.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"List of edges"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Bearer key does not belong to workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"api bucket: 100/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create an edge","description":"Requires `write` scope.","tags":["Edges"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["workflowId","sourceId","targetId"],"properties":{"workflowId":{"type":"string","format":"uuid"},"sourceId":{"type":"string","format":"uuid"},"targetId":{"type":"string","format":"uuid"},"condition":{"type":"object"}}}}}},"responses":{"201":{"description":"Created"},"403":{"description":"INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"mutation bucket: 30/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete an edge","description":"Requires `write` scope.","tags":["Edges"],"parameters":[{"name":"id","in":"query","required":true,"description":"Edge UUID","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deleted"},"403":{"description":"INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"mutation bucket: 30/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/search":{"get":{"summary":"Search nodes, decisions, and workflows in a workspace","tags":["Search"],"parameters":[{"name":"workspaceId","in":"query","required":true,"description":"UUID of the workspace. Bearer keys are workspace-scoped — the key must belong to this workspace.","schema":{"type":"string","format":"uuid"}},{"name":"q","in":"query","required":true,"description":"Search term (case-insensitive substring match)","schema":{"type":"string"}}],"responses":{"200":{"description":"Grouped results: nodes, decisions, workflows"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Bearer key does not belong to workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"api bucket: 100/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/threads/{nodeId}":{"get":{"summary":"List messages in a node's thread","tags":["Threads"],"parameters":[{"name":"nodeId","in":"path","required":true,"description":"Node UUID","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Thread + messages, or empty if none"},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Bearer key does not belong to workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"api bucket: 100/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Add a message to a node's thread","description":"Requires `write` scope. Creates the thread if absent.","tags":["Threads"],"parameters":[{"name":"nodeId","in":"path","required":true,"description":"Node UUID","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"type":"string"},"contentType":{"type":"string","enum":["text","markdown"]}}}}}},"responses":{"201":{"description":"Created"},"403":{"description":"INSUFFICIENT_SCOPE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"mutation bucket: 30/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/whoami":{"get":{"summary":"Identity introspection","description":"Returns the resolved identity for the inbound credentials. No scope required — read-only keys can call this to verify themselves.","tags":["Auth"],"responses":{"200":{"description":"Resolved identity","content":{"application/json":{"schema":{"type":"object","properties":{"authType":{"type":"string","enum":["session","apiKey"]},"userId":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"keyId":{"type":"string","format":"uuid"},"keyPrefix":{"type":"string"},"keyName":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["read","write"]}}}}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"api bucket: 100/min","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}