{"openapi":"3.0.3","info":{"title":"Perfectscale API - OpenAPI 3.0","version":"v1"},"servers":[{"url":"https://api.app.perfectscale.io/public/v1"}],"security":[{"auth":[]}],"components":{"securitySchemes":{"auth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"AutomationLogEntry":{"type":"object","properties":{"started_at":{"type":"string","format":"date-time","description":"Timestamp when the action started."},"cluster_name":{"type":"string","description":"Name of the cluster."},"cluster_uid":{"type":"string","description":"ID of the cluster."},"workload_id":{"type":"string","description":"ID of the workload."},"workload_name":{"type":"string","description":"Name of the workload."},"workload_type":{"type":"string","description":"Type of deployment."},"namespace":{"type":"string","description":"Namespace of the workload."},"labels":{"type":"object","additionalProperties":{"type":"string"},"description":"Labels associated with the workload."},"container":{"$ref":"#/components/schemas/AutomatedLogsContainer"},"executed":{"$ref":"#/components/schemas/ExecutionType"},"workload_indicators":{"type":"array","description":"Workload-level indicators addressed by the automation change.","items":{"$ref":"#/components/schemas/Indicator"}}},"required":["started_at","cluster_name","cluster_uid","workload_id","workload_name","workload_type","namespace","labels","container","executed"]},"AutomatedLogsContainer":{"type":"object","description":"Properties of the container.","properties":{"name":{"type":"string","description":"Name of the container."},"cpu":{"$ref":"#/components/schemas/AutomatedLogsContainerCpu"},"memory":{"$ref":"#/components/schemas/AutomatedLogsContainerMemory"},"indicators":{"type":"array","description":"Container-level indicators addressed by the automation change.","items":{"$ref":"#/components/schemas/Indicator"}}},"required":["name","cpu","memory"]},"AutomatedLogsContainerCpu":{"type":"object","description":"CPU related properties.","properties":{"cpuCoresRequest":{"type":"integer","format":"int64","description":"Request of cpu before apply of automation."},"recommendCpuCoresRequest":{"type":"integer","format":"int64","description":"Request of cpu after apply of automation."},"cpuCoresLimits":{"type":"integer","format":"int64","description":"Limit of cpu before apply of automation."},"recommendCpuCoresLimits":{"type":"integer","format":"int64","description":"Limit of cpu after apply of automation."},"cpuRequestImpact":{"type":"integer","format":"int64","description":"Impact of automation on cpu request value."},"cpuLimitImpact":{"type":"integer","format":"int64","description":"Impact of automation on cpu limit value."},"cpuRequestChangePercent":{"type":"number","format":"double","description":"Single instance cpu request change in %."},"cpuLimitChangePercent":{"type":"number","format":"double","description":"Single instance cpu limit change in %."},"cpuRequestChangeAbsolute":{"type":"integer","format":"int64","description":"Single instance cpu request absolute value change."},"cpuLimitChangeAbsolute":{"type":"integer","format":"int64","description":"Single instance cpu limit absolute value change."}},"required":["cpuCoresRequest","recommendCpuCoresRequest","cpuCoresLimits","recommendCpuCoresLimits","cpuRequestImpact","cpuLimitImpact","cpuRequestChangePercent","cpuLimitChangePercent","cpuRequestChangeAbsolute","cpuLimitChangeAbsolute"]},"AutomatedLogsContainerMemory":{"type":"object","description":"Memory related properties.","properties":{"memMiBRequest":{"type":"integer","format":"int64","description":"Request of memory before apply of automation."},"recommendMemMiBRequest":{"type":"integer","format":"int64","description":"Request of memory after apply of automation."},"memMiBLimits":{"type":"integer","format":"int64","description":"Limit of memory before apply of automation."},"recommendMemMiBLimits":{"type":"integer","format":"int64","description":"Limit of memory after apply of automation."},"memMiBRequestImpact":{"type":"integer","format":"int64","description":"Impact of automation on memory request value."},"memMiBLimitImpact":{"type":"integer","format":"int64","description":"Impact of automation on memory limit value."},"memRequestChangePercent":{"type":"number","format":"double","description":"Single instance memory request change in %."},"memLimitChangePercent":{"type":"number","format":"double","description":"Single instance memory limit change in %."},"memMiBRequestChangeAbsolute":{"type":"integer","format":"int64","description":"Single instance memory request absolute value change."},"memMiBLimitChangeAbsolute":{"type":"integer","format":"int64","description":"Single instance memory limit absolute value change."}},"required":["memMiBRequest","recommendMemMiBRequest","memMiBLimits","recommendMemMiBLimits","memMiBRequestImpact","memMiBLimitImpact","memRequestChangePercent","memLimitChangePercent","memMiBRequestChangeAbsolute","memMiBLimitChangeAbsolute"]},"Indicator":{"type":"object","description":"A risk/waste signal addressed by an automation change.","properties":{"name":{"type":"string","description":"Indicator name."},"type":{"type":"string","description":"Indicator type (e.g. risk, waste, none)."},"severity":{"type":"integer","description":"Severity level (0 = none, higher = more severe)."}},"required":["name","type","severity"]},"ExecutionType":{"type":"string","enum":["regular-eviction","inplace-resize","cleanup"]},"Pagination":{"type":"object","properties":{"has_next":{"type":"boolean","deprecated":true,"description":"Deprecated: derive from 'next' (true when 'next' is non-null)."},"next":{"type":"string","nullable":true,"description":"An opaque token to be used in the 'page_token' parameter to fetch the next page."},"has_prev":{"type":"boolean","deprecated":true,"description":"Deprecated: derive from 'prev' (true when 'prev' is non-null)."},"prev":{"type":"string","nullable":true,"description":"An opaque token to be used in the 'page_token' parameter to fetch the previous page."},"page_size":{"type":"integer","description":"The maximum number of items to return. Defaults to 1000. Must be between 1 and 5000."}},"required":["has_next","next","has_prev","prev","page_size"]}}},"paths":{"/automation/audit_logs":{"post":{"operationId":"AutomationAuditLogs","summary":"Get Automation Audit Logs with Cursor Pagination","description":"Retrieves a list of automation audit log entries within a specified time range, using cursor-based pagination.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time","description":"The start of the time range in ISO 8601 format with UTC timezone (e.g., \"2025-09-17T00:00:00Z\").\nIf omitted, defaults to 00:00:00 UTC of the day that is 30 days ago from today.\n\nConstraints:\n- Must be in UTC timezone (ends with 'Z' or has '+00:00' offset)\n- Cannot be in the future\n- Cannot be before 00:00:00 UTC of 30 days ago from today\n- Must be before 'to' date when both are provided\n- Must be different from 'to' date\n\nExample: If today is 2025-10-17, the earliest allowed value is \"2025-09-17T00:00:00Z\"\n"},"to":{"type":"string","format":"date-time","description":"The end of the time range in ISO 8601 format with UTC timezone (e.g., \"2025-10-17T23:59:59Z\").\nIf omitted, defaults to the current time in UTC.\n\nConstraints:\n- Must be in UTC timezone (ends with 'Z' or has '+00:00' offset)\n- Cannot be in the future\n- Must be after 'from' date when both are provided\n- Must be different from 'from' date\n"},"page_size":{"type":"integer","default":1000,"minimum":1,"maximum":5000,"description":"The maximum number of items to return. Defaults to 1000. Must be between 1 and 5000."},"page_token":{"type":"string","description":"An opaque token from the 'next' or 'prev' field in the response's pagination object, used to fetch the next/previous page. The token encodes both the boundary position and the page direction. Preferred over the deprecated 'after'/'before' fields."},"after":{"type":"string","deprecated":true,"description":"Deprecated: use 'page_token' instead. An opaque token from the 'next' field in the response's pagination object, used to fetch the next page."},"before":{"type":"string","deprecated":true,"description":"Deprecated: use 'page_token' instead. An opaque token from the 'prev' field in the response's pagination object, used to fetch the previous page."},"cluster_uids":{"type":"array","items":{"type":"string"},"description":"Filter by cluster UIDs. Accepts multiple cluster UIDs to filter the audit logs."},"namespaces":{"type":"array","items":{"type":"string"},"description":"Filter by Kubernetes namespaces. Accepts multiple namespaces to filter the audit logs."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AutomationLogEntry"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"}}}},"required":["data","meta"]}}}}}}}}}