{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cqnce-app/json-schema/cqnce-app-api-log-schema.json",
  "title": "ApiLog",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cqnce-app-openapi.yml#/components/schemas/ApiLog",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "method": {
      "type": "string"
    },
    "path": {
      "type": "string"
    },
    "statusCode": {
      "type": "integer"
    },
    "durationMs": {
      "type": "integer"
    },
    "source": {
      "type": "string",
      "enum": [
        "APP",
        "ADMIN",
        "AGENT",
        "PUBLIC",
        "CALLBACK"
      ]
    },
    "tenantId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "projectId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "userId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "agentId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "agent": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "surname": {
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "type": "string"
        }
      }
    },
    "authRequestId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "The auth request that triggered this log entry (set for CALLBACK source logs)"
    },
    "ip": {
      "type": [
        "string",
        "null"
      ]
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    }
  }
}