{ "openapi": "3.0.0", "info": { "title": "Audit Log", "version": "1.0.0", "description": "Service for managing and retrieving auditing logs in the scope of an organization\n" }, "servers": [ { "url": "https://audit-logs.sls.epilot.io" } ], "security": [ { "EpilotAuth": [] }, { "EpilotOrg": [] } ], "paths": { "/v1/logs": { "post": { "operationId": "getLogs", "x-epilot-permissions": [ { "anyOf": [ { "action": "audit_log:view" }, { "action": "blueprint:view" }, { "action": "email_setting:view" } ] } ], "summary": "getLogs", "description": "Retrieve Audit Log events. Optionally, you can filter them by organization.", "tags": [ "Events" ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchOptions" } } } }, "responses": { "200": { "description": "Success - audit logs where loaded successfully. Empty array if org has no executions.", "content": { "application/json": { "schema": { "type": "object", "properties": { "logs": { "type": "array", "items": { "$ref": "#/components/schemas/Event" } }, "total": { "type": "integer", "description": "Total number of logs", "example": 1 } } } } } } } } }, "/v1/logs/{logId}": { "get": { "operationId": "getLogById", "x-epilot-permissions": [ { "action": "audit_log:view" } ], "summary": "getLogById", "description": "Retrieve Audit Log events", "tags": [ "Audit Log" ], "parameters": [ { "in": "path", "name": "logId", "schema": { "type": "string" }, "required": true, "description": "ID of the log event" }, { "in": "query", "name": "visibility", "required": false, "schema": { "type": "string", "enum": [ "customer", "internal", "all" ], "default": "customer" }, "description": "`internal` / `all` also return actions performed by epilot staff through the\nadmin portal. Only available to internal callers; other callers receive 403.\n", "example": "2843c005-c5b0-4df2-94ee-1ca2ddd998ac" } ], "responses": { "200": { "description": "Audit log was loaded successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "log": { "$ref": "#/components/schemas/Event" } } } } } } } } } }, "components": { "schemas": { "CallerType": { "type": "string", "enum": [ "user", "api", "automation", "agent" ] }, "SearchOptions": { "type": "object", "properties": { "limit": { "type": "integer", "description": "Maximum number of results to return", "example": 50 }, "page": { "type": "integer", "description": "Page number to return", "example": 0 }, "timestamp": { "type": "object", "description": "Inclusive time range to filter events by. Each bound accepts either an\nISO 8601 date-time (e.g. `2021-06-01T12:00:00Z`) or a Unix epoch\ntimestamp in seconds (e.g. `1622548800`). Either bound may be omitted.\n", "properties": { "from": { "type": "string", "description": "Inclusive lower bound (ISO 8601 or epoch seconds)", "example": "2021-06-01T12:00:00Z" }, "to": { "type": "string", "description": "Inclusive upper bound (ISO 8601 or epoch seconds)", "example": "2021-06-30T23:59:59Z" } } }, "service_name": { "type": "string", "description": "Name of the service that triggered the event", "example": "workflows" }, "event_name": { "type": "string", "description": "Action that was performed (event name)", "example": "deleteWorkflow" }, "outcome": { "type": "string", "description": "Outcome of the event i.e. success or failed events", "enum": [ "success", "failure" ] }, "method": { "type": "string", "description": "HTTP method", "example": "POST" }, "caller_type": { "description": "Filter by who triggered the event: one type, or a list matching any of them (e.g. `[user, agent]` for\neverything people and their AI agents did). `agent` is an AI agent using an epilot Agent Auth token.\n", "oneOf": [ { "$ref": "#/components/schemas/CallerType" }, { "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/CallerType" } } ] }, "visibility": { "type": "string", "description": "Which events to return. `customer` (default) returns the organization's own\nactivity. `internal` returns actions performed by epilot staff through the\nadmin portal, `all` returns both. `internal` and `all` are only available to\ninternal callers (internal-auth tokens); other callers receive 403.\n", "enum": [ "customer", "internal", "all" ], "default": "customer" }, "resource_id": { "type": "string", "description": "Filter events that target a specific resource (e.g. a blueprint id)", "example": "550e8400-e29b-41d4-a716-446655440000" }, "resource_type": { "type": "string", "description": "Filter events by the type of resource they target (e.g. \"blueprint\", \"blueprint_resource\")", "example": "blueprint" }, "action": { "type": "string", "description": "Filter events by a semantic action name (e.g. \"blueprint.created\", \"blueprint.resource_added\")", "example": "blueprint.resource_added" }, "user": { "type": "object", "properties": { "email": { "type": "string", "description": "Email of the user who initiated the event", "example": "max.mustermann@mail.com" }, "user_id": { "type": "string", "description": "ID of the user who initiated the event", "example": 123456 } } } } }, "HttpContext": { "type": "object", "properties": { "method": { "type": "string", "description": "HTTP method", "example": "GET" }, "ip": { "type": "string", "description": "IP address of the caller", "example": null }, "headers": { "type": "object", "description": "HTTP headers", "example": { "Authorization": "Bearer token" } }, "query": { "type": "object", "description": "Query parameters", "example": { "limit": 50, "page": 0 } }, "pathParams": { "type": "object", "description": "Path parameters", "example": { "eventId": "2843c005-c5b0-4df2-94ee-1ca2ddd998ac" } }, "path": { "type": "string", "description": "Path of the request", "example": "/v1/logs" }, "domainName": { "type": "string", "description": "Domain name of the request", "example": "audit-logs.sls.epilot.io" } } }, "Caller": { "type": "object", "properties": { "user_email": { "type": "string", "description": "Email of the user", "example": "max.mustermann@mail.com" }, "user_id": { "type": "string", "description": "ID of the user", "example": 123456 }, "trigger_type": { "type": "string", "description": "Who triggered the event. `agent` is an AI agent using an epilot Agent Auth token on behalf of a user.", "enum": [ "user", "api", "automation", "agent" ] }, "token_id": { "type": "string", "description": "ID of the token used for the call (API tokens and Agent Auth tokens)", "example": "agent_V1StGXR8Z5jdHi6B" }, "token_type": { "type": "string", "description": "Type of the token used for the call", "example": "api" }, "token_name": { "type": "string", "description": "Name of the token used for the call", "example": "Agent: Claude ยท Contract review" }, "agent": { "$ref": "#/components/schemas/AgentCaller" } } }, "AgentCaller": { "type": "object", "description": "AI agent that made the call. Only present when trigger_type is `agent`.", "properties": { "agent_id": { "type": "string", "description": "ID of the agent" }, "host_id": { "type": "string", "description": "ID of the host the agent runs on" }, "agent_name": { "type": "string", "description": "Display name of the agent", "example": "Claude" }, "host_name": { "type": "string", "description": "Display name of the host the agent runs on" }, "client": { "type": "string", "description": "Client the agent connected with" }, "purpose": { "type": "string", "description": "Purpose the agent token was approved for", "example": "Contract review" }, "user_id": { "type": "string", "description": "ID of the epilot user who approved the agent; the agent acts on their behalf" }, "run_id": { "type": "string", "description": "Run of the agent the call belongs to, for correlating all calls of one run" }, "channel": { "type": "string", "description": "Where the agent ran, e.g. chat, background, flows", "example": "chat" } } }, "Event": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "ID of the log event", "example": "2843c005-c5b0-4df2-94ee-1ca2ddd998ac" }, "org_id": { "type": "string", "description": "ID of the organization", "example": 123456 }, "service_name": { "type": "string", "description": "Name of the service", "example": "workflows" }, "event_name": { "type": "string", "description": "Action that was performed", "example": "deleteWorkflow" }, "status_code": { "type": "integer", "description": "HTTP status code", "example": 200 }, "timestamp": { "type": "string", "description": "Timestamp of the event", "example": "2021-06-01T12:00:00Z" }, "caller": { "$ref": "#/components/schemas/Caller" }, "http": { "$ref": "#/components/schemas/HttpContext" }, "detail": { "type": "string", "description": "Contains the stringified request body", "example": "{\"workflow_id\": \"123456\"}" }, "activity": { "type": "string", "description": "Description of the event", "example": "Workflow with ID 123456 was deleted" }, "source_url": { "type": "string", "description": "URL of the ressource that was modified" }, "resource_id": { "type": "string", "description": "ID of the resource this event targets (e.g. blueprint id, workflow id)", "example": "550e8400-e29b-41d4-a716-446655440000" }, "resource_type": { "type": "string", "description": "Type of resource this event targets", "example": "blueprint" }, "action": { "type": "string", "description": "Semantic action name for this event", "example": "blueprint.resource_added" }, "visibility": { "type": "string", "description": "`customer` for the organization's own activity, `internal` for actions\nperformed by epilot staff through the admin portal (hidden from the\ncustomer-facing audit log).\n", "enum": [ "customer", "internal" ], "example": "customer" } } } } } }