{"openapi":"3.1.0","info":{"title":"LaserData Cloud Audit API","description":"Tenant audit log and per-user activity feed.\n\nPublic REST API for the LaserData Cloud audit service.\n\n## Authentication\n\nEvery endpoint accepts either of two auth methods:\n- **API key** (machine / CI / SDK): send in the `ld-api-key` header. Cannot be used on `GET /audit/users/activity` which is session-only.\n- **Session cookie** (browser / console): obtained from `POST /account/sign_in` on the control plane.\n\nAudit endpoints are read-only and replay-safe by definition.\n\n## Pagination\n\nList endpoints return a `Paged<T>` body (`page`, `total_pages`, `total_results`, `items`) and a `link` header (RFC 8288) with `rel=\"first\"`, `\"prev\"`, `\"next\"`, `\"last\"` when applicable.\n\n## Errors\n\nError responses follow RFC 7807 `application/problem+json` with `type`, `title`, `code`, `reason`, `instance`, `status`, `retryable`, and optional `field` / `field_issues`. `retryable` is `true` for 408, 425, 429, 500, 502, 503, 504.\n\n## Response headers\n\n- `ld-request`: request ID. Include it when reporting issues.\n- `link`: pagination relations.\n- `retry-after`: wait hint on 429 / 503.","termsOfService":"https://laserdata.com/terms","contact":{"name":"LaserData Support","url":"https://docs.laserdata.com","email":"support@laserdata.com"},"license":{"name":"Proprietary"},"version":"0.0.93","x-logo":{"altText":"LaserData","href":"https://laserdata.com","url":"https://assets.laserdata.com/laserdata_dark.png"}},"servers":[{"url":"https://api.laserdata.cloud","description":"Production"}],"paths":{"/audit/tenants/{tenant_id}":{"get":{"tags":["Audit"],"summary":"Query tenant audit log","description":"Returns the immutable, append-only audit log for a tenant. Every Console action and API call recorded against the tenant is captured. Supports pagination plus filtering by event type, date range, division, environment, deployment, user (subject), author (acting user), api_key, and correlation_id. Required permission: `audit:read`.","operationId":"get_tenant_audit","parameters":[{"name":"tenant_id","in":"path","description":"Tenant identifier","required":true,"schema":{"$ref":"#/components/schemas/TenantId"}},{"name":"page","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":1},"example":1},{"name":"results","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":1},"example":10},{"name":"from","in":"query","description":"Inclusive lower bound (RFC 3339 UTC).","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-05-20T10:00:00Z"},{"name":"to","in":"query","description":"Exclusive upper bound (RFC 3339 UTC).","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-05-20T10:00:00Z"},{"name":"division","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":0}},{"name":"environment","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":0}},{"name":"deployment","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":0}},{"name":"user","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":0}},{"name":"author","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":0}},{"name":"api_key","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":0}},{"name":"types","in":"query","required":false,"schema":{"type":["string","null"]}},{"name":"correlation_id","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Paged tenant audit events. Each entry carries event type, actor (author + api_key when applicable), resource scope (division/environment/deployment), event-specific data payload, correlation ID, and timestamp","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paged_TenantAuditInfo"}}}},"403":{"description":"Insufficient permissions (requires audit:read)"},"404":{"description":"Tenant not found"}}}},"/audit/types":{"get":{"tags":["Audit"],"summary":"List audit event types","description":"Returns the complete catalogue of audit event type identifiers that can appear in `/audit/tenants/{tenant_id}` results. Use to populate event-type filters in UIs or to enumerate the discriminators an agent should branch on when parsing the audit stream. Each entry is `{type: <slug>, name: <human label>}` (e.g. `deployment_created`, `member_invited`, `access_rule_added`).","operationId":"get_tenant_audit_types","responses":{"200":{"description":"All audit event types (snake_case slug + human-readable label)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuditTypeInfo"}}}}},"401":{"description":"No active session"}}}},"/audit/users/activity":{"get":{"tags":["Audit"],"summary":"List my activity","description":"Returns the calling user's recent activity across all tenants the user is a member of: signed-in actions, API key calls they own, sessions, role changes. Use to populate a personal audit timeline in the Console. Session-only: API keys are tenant-scoped and cannot list user activity.","operationId":"get_user_activity","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":1},"example":1},{"name":"results","in":"query","required":false,"schema":{"type":["integer","null"],"format":"int64","minimum":1},"example":10},{"name":"from","in":"query","description":"Inclusive lower bound (RFC 3339 UTC).","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-05-20T10:00:00Z"},{"name":"to","in":"query","description":"Exclusive upper bound (RFC 3339 UTC).","required":false,"schema":{"type":["string","null"],"format":"date-time"},"example":"2026-05-20T10:00:00Z"},{"name":"types","in":"query","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"description":"Paged user activity events with event type, target resource, and timestamp","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paged_UserActivityInfo"}}}},"401":{"description":"No active session"}},"security":[{"session_cookie":[]}]}}},"components":{"schemas":{"ApiKeyId":{"type":"integer","format":"int64","example":7261845127892140000,"minimum":0},"AuditResource":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","format":"int64","minimum":0},"name":{"type":["string","null"]}}},"AuditTypeInfo":{"type":"object","required":["type","name"],"properties":{"name":{"type":"string"},"type":{"type":"string"}},"example":{"name":"Deployment created","type":"deployment_created"}},"DeploymentId":{"type":"integer","format":"int64","example":7261845127892140000,"minimum":0},"DivisionId":{"type":"integer","format":"int64","example":7261844974723780000,"minimum":0},"EnvironmentId":{"type":"integer","format":"int64","example":7261845066528310000,"minimum":0},"ErrorResponse":{"type":"object","required":["title","code","reason"],"properties":{"code":{"type":"string","description":"Stable machine-readable error code (snake_case)."},"field":{"type":["string","null"]},"field_issues":{"type":"array","items":{"$ref":"#/components/schemas/FieldIssue"}},"instance":{"type":["string","null"],"description":"RFC 7807 instance URI identifying the specific occurrence; mirrors the `ld-request` header value."},"reason":{"type":"string","description":"RFC 7807 detail string. Long-form human explanation of this occurrence."},"resolution":{"type":["string","null"],"description":"Concrete guidance an automated client or operator can use to recover."},"retryable":{"type":["boolean","null"],"description":"`true` for retryable conditions (408, 425, 429, 500, 502, 503, 504), `false` otherwise."},"status":{"type":["integer","null"],"format":"int32","description":"Mirror of HTTP status code. Agents can branch on the body without re-reading the response status.","minimum":0},"title":{"type":"string","description":"RFC 7807 short, human-readable title for the error class."},"type":{"type":"string","description":"RFC 7807 type URI identifying the error class. `about:blank` when no type is registered."}}},"FieldIssue":{"type":"object","required":["code","reason"],"properties":{"code":{"type":"string"},"path":{"type":["string","null"]},"reason":{"type":"string"}}},"Paged_TenantAuditInfo":{"type":"object","required":["total_pages","total_results","page","items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["type","name","timestamp"],"properties":{"api_key":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"author":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"correlation_id":{"type":["string","null"]},"data":{},"deployment":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"division":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"environment":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"name":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string"},"user":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]}},"example":{"api_key":{"id":8472634927,"name":"ci-deploy"},"author":{"id":7283491,"name":"Alice Smith"},"correlation_id":"550e8400e29b41d4a716446655440000","data":{"cloud":"aws","region":"us-east-1","tier":"standard"},"deployment":{"id":1290387450,"name":"primary-stream"},"division":{"id":5547234,"name":"engineering"},"environment":{"id":9082734,"name":"production"},"name":"Deployment created","timestamp":"2026-05-23T10:23:14.123456Z","type":"deployment_created","user":null}}},"page":{"type":"integer","format":"int64","example":1,"minimum":1},"total_pages":{"type":"integer","format":"int64","example":4,"minimum":0},"total_results":{"type":"integer","format":"int64","example":137,"minimum":0}}},"Paged_UserActivityInfo":{"type":"object","required":["total_pages","total_results","page","items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["type","name","timestamp"],"properties":{"data":{},"deployment":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"division":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"environment":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"name":{"type":"string"},"tenant":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string"}},"example":{"data":null,"deployment":null,"division":null,"environment":null,"name":"Member joined","tenant":{"id":5547234,"name":"Acme Inc."},"timestamp":"2026-05-23T09:00:00Z","type":"member_joined"}}},"page":{"type":"integer","format":"int64","example":1,"minimum":1},"total_pages":{"type":"integer","format":"int64","example":4,"minimum":0},"total_results":{"type":"integer","format":"int64","example":137,"minimum":0}}},"TenantAuditInfo":{"type":"object","required":["type","name","timestamp"],"properties":{"api_key":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"author":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"correlation_id":{"type":["string","null"]},"data":{},"deployment":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"division":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"environment":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"name":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string"},"user":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]}},"example":{"api_key":{"id":8472634927,"name":"ci-deploy"},"author":{"id":7283491,"name":"Alice Smith"},"correlation_id":"550e8400e29b41d4a716446655440000","data":{"cloud":"aws","region":"us-east-1","tier":"standard"},"deployment":{"id":1290387450,"name":"primary-stream"},"division":{"id":5547234,"name":"engineering"},"environment":{"id":9082734,"name":"production"},"name":"Deployment created","timestamp":"2026-05-23T10:23:14.123456Z","type":"deployment_created","user":null}},"TenantId":{"type":"integer","format":"int64","example":7261845022003200001,"minimum":0},"UserActivityInfo":{"type":"object","required":["type","name","timestamp"],"properties":{"data":{},"deployment":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"division":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"environment":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"name":{"type":"string"},"tenant":{"oneOf":[{"$ref":"#/components/schemas/AuditResource"},{"type":"null"}]},"timestamp":{"type":"string","format":"date-time"},"type":{"type":"string"}},"example":{"data":null,"deployment":null,"division":null,"environment":null,"name":"Member joined","tenant":{"id":5547234,"name":"Acme Inc."},"timestamp":"2026-05-23T09:00:00Z","type":"member_joined"}},"UserId":{"type":"integer","format":"int64","example":7261844898910240000,"minimum":0}},"securitySchemes":{"ld_api_key":{"type":"apiKey","in":"header","name":"ld-api-key","description":"Tenant API key sent in the ld-api-key request header. Scoped to tenant-level audit reads. Cannot be used on user-scope endpoints (`/audit/users/activity`)."},"session_cookie":{"type":"apiKey","in":"cookie","name":"session","description":"Browser session cookie issued by POST /account/sign_in on core. Required for user-scope endpoints."}}},"security":[{"ld_api_key":[]},{"session_cookie":[]}],"tags":[{"name":"Audit","description":"Tenant audit log + user activity"}],"externalDocs":{"url":"https://docs.laserdata.com","description":"LaserData Cloud documentation"}}