{"openapi":"3.1.2","info":{"title":"SystemLineage Public API","version":"1.0.0","summary":"Read approved SystemLineage workspace data through a tenant-scoped API.","description":"The first API release is read-only and disabled until SystemLineage OAuth, database, rate-limit and cross-company isolation checks are witnessed. An access token never chooses its own company: the verified OAuth organization and server membership define the tenant.","contact":{"name":"SystemLineage","url":"https://localhost:3000/contact/?product=public-api"}},"jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","servers":[{"url":"https://localhost:3000/api/v1","description":"Current SystemLineage environment"}],"tags":[{"name":"Modules","description":"Read only the tools and records approved for this connection."}],"security":[{"oauthBearer":[]}],"paths":{"/modules/":{"get":{"tags":["Modules"],"summary":"List allowed SystemLineage tools","description":"Returns only modules present in the verified token allowlist, with current account access state.","operationId":"listAllowedModules","responses":{"200":{"description":"Allowed modules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModuleList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/modules/{moduleKey}/":{"get":{"tags":["Modules"],"summary":"Read one allowed tool workspace","description":"Requires modules.read, the exact module in the verified token allowlist, current account entitlement and tenant membership.","operationId":"getAllowedModuleWorkspace","parameters":[{"name":"moduleKey","in":"path","required":true,"description":"Plain internal key for one approved SystemLineage tool.","schema":{"type":"string","enum":["job_material_cost","quote_follow_up","purchase_orders","van_stock_counts","invoice_follow_up","maintenance_reminders","automatic_kpi_reporting","expiry_tracking"]}}],"responses":{"200":{"description":"Tenant-scoped module workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceEnvelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}}},"components":{"securitySchemes":{"oauthBearer":{"type":"http","scheme":"bearer","bearerFormat":"OAuth 2.1 access token","description":"Authorization Code with PKCE. Required read scope: user:org:read, modules.read, module:job_material_cost:read, module:quote_follow_up:read, module:purchase_orders:read, module:van_stock_counts:read, module:invoice_follow_up:read, module:maintenance_reminders:read, module:automatic_kpi_reporting:read, module:expiry_tracking:read. The production authorization server remains an activation gate until its metadata and audience binding are witnessed."}},"schemas":{"AccessState":{"type":"object","additionalProperties":false,"required":["accessMode","accessEndsAt"],"properties":{"accessMode":{"type":"string","enum":["active","grace","read_only","suspended","waitlist","not_subscribed"]},"accessEndsAt":{"type":["string","null"],"format":"date-time"}}},"ModuleDefinition":{"type":"object","additionalProperties":true,"required":["key","name"],"properties":{"key":{"type":"string","enum":["job_material_cost","quote_follow_up","purchase_orders","van_stock_counts","invoice_follow_up","maintenance_reminders","automatic_kpi_reporting","expiry_tracking"]},"name":{"type":"string","minLength":1,"maxLength":160}}},"ModuleAccess":{"type":"object","additionalProperties":true,"required":["key","name","access"],"properties":{"key":{"type":"string","enum":["job_material_cost","quote_follow_up","purchase_orders","van_stock_counts","invoice_follow_up","maintenance_reminders","automatic_kpi_reporting","expiry_tracking"]},"name":{"type":"string","minLength":1,"maxLength":160},"access":{"$ref":"#/components/schemas/AccessState"}}},"ModuleList":{"type":"object","additionalProperties":false,"required":["apiVersion","modules"],"properties":{"apiVersion":{"const":"v1"},"modules":{"type":"array","maxItems":8,"items":{"$ref":"#/components/schemas/ModuleAccess"}}}},"WorkspaceEnvelope":{"type":"object","additionalProperties":false,"required":["apiVersion","module","workspace","generatedAt"],"properties":{"apiVersion":{"const":"v1"},"module":{"$ref":"#/components/schemas/ModuleDefinition"},"workspace":{"type":"object","description":"The bounded read DTO for the selected module. Private document keys, secrets and unrelated modules are never included.","additionalProperties":true},"generatedAt":{"type":"string","format":"date-time"}}},"Problem":{"type":"object","additionalProperties":false,"required":["type","title","status","detail","requestId"],"properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"requestId":{"type":"string"}}}},"responses":{"Unauthorized":{"description":"OAuth access token required","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Forbidden":{"description":"Permission or module access denied","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"NotFound":{"description":"Module not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"RateLimited":{"description":"Request limit reached","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Unavailable":{"description":"Public integration runtime unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}