{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/credoai/main/json-schema/credoai-audit-logs-response-schema.json",
  "title": "Audit Logs Response",
  "description": "Response containing a collection of audit logs",
  "x-generated": "2026-10-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/credoai-openapi.json#/components/schemas/Audit Logs Response",
  "properties": {
    "data": {
      "items": {
        "description": "An audit log entry in the system",
        "properties": {
          "attributes": {
            "properties": {
              "action": {
                "description": "Action information",
                "type": [
                  "object",
                  "null"
                ]
              },
              "action_id": {
                "description": "Action ID",
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "inserted_at": {
                "description": "Creation timestamp",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "Human-readable audit log message",
                "type": [
                  "string",
                  "null"
                ]
              },
              "metadata": {
                "description": "Additional metadata specific to the event",
                "type": [
                  "object",
                  "null"
                ]
              },
              "name": {
                "description": "Audit log event name",
                "type": "string"
              },
              "resource_id": {
                "description": "ID of the primary resource affected",
                "type": [
                  "string",
                  "null"
                ]
              },
              "resource_name": {
                "description": "Name of the primary resource affected",
                "type": [
                  "string",
                  "null"
                ]
              },
              "resource_type": {
                "description": "Type of the primary resource affected",
                "type": [
                  "string",
                  "null"
                ]
              },
              "source": {
                "description": "Originating client source (e.g. 'platform', 'sdk:pycredoai@0.3.1', 'mcp:provide_ai_suggestion', 'api', 'trigger', 'unknown')",
                "type": "string"
              },
              "sub_object_id": {
                "description": "ID of the sub-object affected",
                "type": [
                  "string",
                  "null"
                ]
              },
              "sub_object_name": {
                "description": "Name of the sub-object affected",
                "type": [
                  "string",
                  "null"
                ]
              },
              "sub_object_type": {
                "description": "Type of the sub-object affected",
                "type": [
                  "string",
                  "null"
                ]
              },
              "team_id": {
                "description": "Team ID",
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "use_case_id": {
                "description": "Use case ID",
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "user": {
                "description": "User information (id, email, name, role, etc.)",
                "type": [
                  "object",
                  "null"
                ]
              },
              "user_id": {
                "description": "User ID who performed the action",
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "name",
              "inserted_at"
            ],
            "type": "object"
          },
          "id": {
            "description": "Audit log ID",
            "format": "uuid",
            "type": "string"
          },
          "type": {
            "description": "Resource type",
            "enum": [
              "audit_logs"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "attributes"
        ],
        "title": "AuditLog",
        "type": "object"
      },
      "type": "array"
    },
    "meta": {
      "description": "Pagination metadata",
      "properties": {
        "page": {
          "description": "Current page number",
          "type": "integer"
        },
        "per_page": {
          "description": "Items per page",
          "type": "integer"
        },
        "total_count": {
          "description": "Total number of items",
          "type": "integer"
        },
        "total_pages": {
          "description": "Total number of pages",
          "type": "integer"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "data"
  ],
  "type": "object"
}