{
  "openapi": "3.0.1",
  "info": {
    "title": "Not AI Public REST API",
    "description": "Read-only, customer-facing REST API for the Not AI AI-agent detection platform. Authenticate every request with the aik_v1_ API key minted in the Not AI dashboard, via 'Authorization: Bearer aik_v1_...' or the 'x-api-key' header. All routes are versioned under /v1 and return stable, self-describing JSON.",
    "contact": {
      "name": "Not AI",
      "url": "https://isnotai.com"
    },
    "version": "1.0.17.0"
  },
  "servers": [
    {
      "url": "https://api.isnotai.com",
      "description": "Production (US)"
    },
    {
      "url": "https://api-eu.isnotai.com",
      "description": "Production (EU)"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Health probe",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "Payload of HealthResponse",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Aggregated analytics for the integration",
        "operationId": "getAnalytics",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Time window: 24h, 7d (default), 30d, 90d.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupBy",
            "in": "query",
            "description": "Time-series bucket size: hour, day (default), week.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payload of AnalyticsResponse",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "period": {
                          "type": "string"
                        },
                        "groupBy": {
                          "type": "string"
                        },
                        "startDate": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "endDate": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "generatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "summary": {
                          "type": "object",
                          "properties": {
                            "totalSessions": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "totalEvents": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "uniqueBots": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "uniqueUsers": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "averageBotScore": {
                              "type": "number",
                              "format": "double"
                            },
                            "averageEventsPerSession": {
                              "type": "number",
                              "format": "double"
                            }
                          }
                        },
                        "timeSeries": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "timestamp": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "sessionCount": {
                                "type": "integer",
                                "format": "int32"
                              },
                              "eventCount": {
                                "type": "integer",
                                "format": "int32"
                              },
                              "botCount": {
                                "type": "integer",
                                "format": "int32"
                              },
                              "userMatchedCount": {
                                "type": "integer",
                                "format": "int32"
                              }
                            }
                          }
                        },
                        "botDetection": {
                          "type": "object",
                          "properties": {
                            "highConfidenceBots": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "mediumConfidenceBots": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "lowConfidenceBots": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "likelyHumans": {
                              "type": "integer",
                              "format": "int32"
                            }
                          }
                        },
                        "userMatching": {
                          "type": "object",
                          "properties": {
                            "totalMatched": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "totalUnmatched": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "matchRate": {
                              "type": "number",
                              "format": "double"
                            },
                            "averageCorrelationConfidence": {
                              "type": "number",
                              "format": "double"
                            }
                          }
                        },
                        "topOrigins": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "origin": {
                                "type": "string"
                              },
                              "sessionCount": {
                                "type": "integer",
                                "format": "int32"
                              },
                              "botPercentage": {
                                "type": "number",
                                "format": "double"
                              }
                            }
                          }
                        },
                        "deviceBreakdown": {
                          "type": "object",
                          "properties": {
                            "mobile": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "tablet": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "desktop": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "browserCounts": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "integer",
                                "format": "int32"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Payload of ErrorEnvelope",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Payload of ErrorEnvelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/v1/sessions/{sessionId}": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Get a single tracking session by id",
        "operationId": "getSession",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "description": "Session id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payload of SessionResponse",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        },
                        "status": {
                          "type": "string"
                        },
                        "botScore": {
                          "type": "number",
                          "format": "double",
                          "nullable": true
                        },
                        "detectionFlags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "pageUrl": {
                          "type": "string"
                        },
                        "userAgentSummary": {
                          "type": "string"
                        },
                        "userId": {
                          "type": "string"
                        },
                        "userName": {
                          "type": "string"
                        },
                        "userUrl": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Payload of ErrorEnvelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Payload of ErrorEnvelope",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/v1/sessions/{sessionId}/details": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Get detailed session data (timeline + event counts + page history)",
        "operationId": "getSessionDetails",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "description": "Session id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payload of SessionDetailsResponse",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "sessionId": {
                          "type": "string"
                        },
                        "startTime": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "endTime": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "durationSeconds": {
                          "type": "number",
                          "format": "double"
                        },
                        "eventCounts": {
                          "type": "object",
                          "properties": {
                            "total": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "mouse": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "scroll": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "keyboard": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "touch": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "form": {
                              "type": "integer",
                              "format": "int32"
                            }
                          }
                        },
                        "timeline": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "timestamp": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "eventCount": {
                                "type": "integer",
                                "format": "int32"
                              },
                              "dominantEventType": {
                                "type": "string"
                              },
                              "activityLevel": {
                                "type": "number",
                                "format": "double"
                              }
                            }
                          }
                        },
                        "pageHistory": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string"
                              },
                              "timestamp": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "type": {
                                "type": "string"
                              },
                              "durationMs": {
                                "type": "integer",
                                "format": "int32",
                                "nullable": true
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Payload of ErrorEnvelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Payload of ErrorEnvelope",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Payload of ErrorEnvelope",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/v1/stats": {
      "get": {
        "tags": [
          "Stats"
        ],
        "summary": "Get high-level integration stats",
        "operationId": "getStats",
        "responses": {
          "200": {
            "description": "Payload of StatsResponse",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "totalSessions": {
                          "type": "integer",
                          "format": "int32"
                        },
                        "activeSessions": {
                          "type": "integer",
                          "format": "int32"
                        },
                        "botsDetected": {
                          "type": "integer",
                          "format": "int32"
                        },
                        "sessionsToday": {
                          "type": "integer",
                          "format": "int32"
                        },
                        "userMatchedSessions": {
                          "type": "integer",
                          "format": "int32"
                        },
                        "averageBotScore": {
                          "type": "number",
                          "format": "double"
                        },
                        "lastSessionTime": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Payload of ErrorEnvelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/v1/usage": {
      "get": {
        "tags": [
          "Usage"
        ],
        "summary": "Get API consumption metrics for the integration over a date range",
        "operationId": "getUsage",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "description": "Inclusive lower bound, ISO-8601 date. Defaults to 30 days before endDate.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "Inclusive upper bound, ISO-8601 date. Defaults to today (UTC).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "metric",
            "in": "query",
            "description": "Optional metric filter. One of: ApiCalls, Events, Sessions, StorageBytes, BotAnalyses (case-insensitive).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payload of UsageResponse",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "startDate": {
                      "type": "string"
                    },
                    "endDate": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "period": {
                            "type": "string"
                          },
                          "metricType": {
                            "type": "string"
                          },
                          "value": {
                            "type": "integer",
                            "format": "int64"
                          }
                        }
                      }
                    },
                    "totals": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "integer",
                        "format": "int64"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Payload of ErrorEnvelope",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Payload of ErrorEnvelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/v1/users/{userId}/sessions": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get sessions for an LMS user (paginated)",
        "operationId": "getUserSessions",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "description": "LMS user id (provider-neutral; same value surfaced on PublicSession.userId).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Page size. The maximum is scoped to the integration's plan tier (Free 50, Pro and Enterprise 100). Requests above the tier maximum clamp to the maximum and the effective value is returned in pagination.limit. Minimum 1. Default 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque continuation cursor returned by a previous call.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payload of UserSessionsResponse",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "status": {
                            "type": "string"
                          },
                          "botScore": {
                            "type": "number",
                            "format": "double",
                            "nullable": true
                          },
                          "detectionFlags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "pageUrl": {
                            "type": "string"
                          },
                          "userAgentSummary": {
                            "type": "string"
                          },
                          "userId": {
                            "type": "string"
                          },
                          "userName": {
                            "type": "string"
                          },
                          "userUrl": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "nextCursor": {
                          "type": "string"
                        },
                        "hasMore": {
                          "type": "boolean"
                        },
                        "limit": {
                          "type": "integer",
                          "format": "int32"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Payload of ErrorEnvelope",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Payload of ErrorEnvelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/v1/courses": {
      "get": {
        "tags": [
          "Courses"
        ],
        "summary": "List LMS courses extracted from session URLs",
        "operationId": "listCourses",
        "responses": {
          "200": {
            "description": "Payload of CourseListResponse",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "courseId": {
                            "type": "string"
                          },
                          "courseName": {
                            "type": "string"
                          },
                          "sessionCount": {
                            "type": "integer",
                            "format": "int32"
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "nextCursor": {
                          "type": "string"
                        },
                        "hasMore": {
                          "type": "boolean"
                        },
                        "limit": {
                          "type": "integer",
                          "format": "int32"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Payload of ErrorEnvelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/v1/sessions/{sessionId}/events": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "List event-level metadata for a session",
        "operationId": "listEvents",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "description": "Session id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Page size. The maximum is scoped to the integration's plan tier (Free 50, Pro and Enterprise 100). Requests above the tier maximum clamp to the maximum and the effective value is returned in pagination.limit. Minimum 1. Default 100, itself clamped by the tier maximum.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor returned by the previous page's `pagination.nextCursor`. Omit to start from the beginning.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Optional event-type filter. Accepts message-type byte as decimal/hex (e.g. 1, 0x01) or short name (e.g. init, mouse_move, keypress).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startTime",
            "in": "query",
            "description": "Lower bound on timestamp (Unix milliseconds, inclusive).",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "endTime",
            "in": "query",
            "description": "Upper bound on timestamp (Unix milliseconds, inclusive).",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payload of EventListResponse",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "eventId": {
                            "type": "string"
                          },
                          "messageId": {
                            "type": "integer",
                            "format": "int32"
                          },
                          "eventTypeName": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "integer",
                            "format": "int64"
                          },
                          "payloadSize": {
                            "type": "integer",
                            "format": "int32"
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "nextCursor": {
                          "type": "string"
                        },
                        "hasMore": {
                          "type": "boolean"
                        },
                        "limit": {
                          "type": "integer",
                          "format": "int32"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Payload of ErrorEnvelope",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Payload of ErrorEnvelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Payload of ErrorEnvelope",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/v1/sessions": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "List tracking sessions for the caller's integration",
        "operationId": "listSessions",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "description": "Page size. The maximum is scoped to the integration's plan tier (Free 50, Pro and Enterprise 100). Requests above the tier maximum clamp to the maximum and the effective value is returned in pagination.limit. Minimum 1. Default 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque continuation cursor returned by a previous call.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by session status (e.g. 'active', 'closed').",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "botOnly",
            "in": "query",
            "description": "If true, restrict to sessions with botScore >= 0.7.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "description": "Only sessions created at or after this ISO-8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "description": "Only sessions created at or before this ISO-8601 timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payload of SessionListResponse",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "status": {
                            "type": "string"
                          },
                          "botScore": {
                            "type": "number",
                            "format": "double",
                            "nullable": true
                          },
                          "detectionFlags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "pageUrl": {
                            "type": "string"
                          },
                          "userAgentSummary": {
                            "type": "string"
                          },
                          "userId": {
                            "type": "string"
                          },
                          "userName": {
                            "type": "string"
                          },
                          "userUrl": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "nextCursor": {
                          "type": "string"
                        },
                        "hasMore": {
                          "type": "boolean"
                        },
                        "limit": {
                          "type": "integer",
                          "format": "int32"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Payload of ErrorEnvelope",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Payload of ErrorEnvelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/v1/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "List LMS users correlated with sessions",
        "operationId": "listUsers",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "description": "Page size. The maximum is scoped to the integration's plan tier (Free 50, Pro and Enterprise 100). Requests above the tier maximum clamp to the maximum and the effective value is returned in pagination.limit. Minimum 1. Default 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque continuation cursor returned by a previous call.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Case-insensitive substring match against userId or userName.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payload of UserListResponse",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "userId": {
                            "type": "string"
                          },
                          "userName": {
                            "type": "string"
                          },
                          "sessionCount": {
                            "type": "integer",
                            "format": "int32"
                          },
                          "botSessionCount": {
                            "type": "integer",
                            "format": "int32"
                          },
                          "mediumSessionCount": {
                            "type": "integer",
                            "format": "int32"
                          },
                          "averageBotScore": {
                            "type": "number",
                            "format": "double"
                          },
                          "maxBotScore": {
                            "type": "number",
                            "format": "double"
                          },
                          "deviceCount": {
                            "type": "integer",
                            "format": "int32"
                          },
                          "firstSeen": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "lastSeen": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "riskLevel": {
                            "type": "string"
                          },
                          "sparkline": {
                            "type": "array",
                            "items": {
                              "type": "integer",
                              "format": "int32"
                            }
                          },
                          "userUrl": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "nextCursor": {
                          "type": "string"
                        },
                        "hasMore": {
                          "type": "boolean"
                        },
                        "limit": {
                          "type": "integer",
                          "format": "int32"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Payload of ErrorEnvelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    },
    "/v1/integration": {
      "get": {
        "tags": [
          "Self"
        ],
        "summary": "Get the integration this API key resolved to",
        "operationId": "getIntegration",
        "responses": {
          "200": {
            "description": "Payload of IntegrationSelfResponse",
            "headers": {
              "x-isnotai-tier": {
                "description": "Resolved plan tier of the integration this API key belongs to. Stamped by TierStampingMiddleware on every authenticated response (success or error), so Cloudflare Enterprise rate-limit rules can bucket the request into the correct per-tier counter. Absent only on the 401 envelope where authentication itself failed.",
                "required": true,
                "schema": {
                  "enum": [
                    "free",
                    "pro",
                    "enterprise"
                  ],
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "institutionName": {
                          "type": "string"
                        },
                        "planId": {
                          "type": "string"
                        },
                        "apiKeyMasked": {
                          "type": "string"
                        },
                        "apiKeyLastUsedAt": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Payload of ErrorEnvelope",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "analyticsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "period": {
                "type": "string"
              },
              "groupBy": {
                "type": "string"
              },
              "startDate": {
                "type": "string",
                "format": "date-time"
              },
              "endDate": {
                "type": "string",
                "format": "date-time"
              },
              "generatedAt": {
                "type": "string",
                "format": "date-time"
              },
              "summary": {
                "type": "object",
                "properties": {
                  "totalSessions": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "totalEvents": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "uniqueBots": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "uniqueUsers": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "averageBotScore": {
                    "type": "number",
                    "format": "double"
                  },
                  "averageEventsPerSession": {
                    "type": "number",
                    "format": "double"
                  }
                }
              },
              "timeSeries": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "sessionCount": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "eventCount": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "botCount": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "userMatchedCount": {
                      "type": "integer",
                      "format": "int32"
                    }
                  }
                }
              },
              "botDetection": {
                "type": "object",
                "properties": {
                  "highConfidenceBots": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "mediumConfidenceBots": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "lowConfidenceBots": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "likelyHumans": {
                    "type": "integer",
                    "format": "int32"
                  }
                }
              },
              "userMatching": {
                "type": "object",
                "properties": {
                  "totalMatched": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "totalUnmatched": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "matchRate": {
                    "type": "number",
                    "format": "double"
                  },
                  "averageCorrelationConfidence": {
                    "type": "number",
                    "format": "double"
                  }
                }
              },
              "topOrigins": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "origin": {
                      "type": "string"
                    },
                    "sessionCount": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "botPercentage": {
                      "type": "number",
                      "format": "double"
                    }
                  }
                }
              },
              "deviceBreakdown": {
                "type": "object",
                "properties": {
                  "mobile": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "tablet": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "desktop": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "browserCounts": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer",
                      "format": "int32"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "courseListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "courseId": {
                  "type": "string"
                },
                "courseName": {
                  "type": "string"
                },
                "sessionCount": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "nextCursor": {
                "type": "string"
              },
              "hasMore": {
                "type": "boolean"
              },
              "limit": {
                "type": "integer",
                "format": "int32"
              }
            }
          }
        }
      },
      "errorBody": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "additionalProperties": {
              "type": "object"
            }
          }
        }
      },
      "errorEnvelope": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "additionalProperties": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "eventListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "eventId": {
                  "type": "string"
                },
                "messageId": {
                  "type": "integer",
                  "format": "int32"
                },
                "eventTypeName": {
                  "type": "string"
                },
                "timestamp": {
                  "type": "integer",
                  "format": "int64"
                },
                "payloadSize": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "nextCursor": {
                "type": "string"
              },
              "hasMore": {
                "type": "boolean"
              },
              "limit": {
                "type": "integer",
                "format": "int32"
              }
            }
          }
        }
      },
      "healthResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "integrationSelfBody": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "institutionName": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "apiKeyMasked": {
            "type": "string"
          },
          "apiKeyLastUsedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "integrationSelfResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "institutionName": {
                "type": "string"
              },
              "planId": {
                "type": "string"
              },
              "apiKeyMasked": {
                "type": "string"
              },
              "apiKeyLastUsedAt": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              }
            }
          }
        }
      },
      "pagination": {
        "type": "object",
        "properties": {
          "nextCursor": {
            "type": "string"
          },
          "hasMore": {
            "type": "boolean"
          },
          "limit": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "publicAnalytics": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "groupBy": {
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "format": "date-time"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "summary": {
            "type": "object",
            "properties": {
              "totalSessions": {
                "type": "integer",
                "format": "int32"
              },
              "totalEvents": {
                "type": "integer",
                "format": "int32"
              },
              "uniqueBots": {
                "type": "integer",
                "format": "int32"
              },
              "uniqueUsers": {
                "type": "integer",
                "format": "int32"
              },
              "averageBotScore": {
                "type": "number",
                "format": "double"
              },
              "averageEventsPerSession": {
                "type": "number",
                "format": "double"
              }
            }
          },
          "timeSeries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "timestamp": {
                  "type": "string",
                  "format": "date-time"
                },
                "sessionCount": {
                  "type": "integer",
                  "format": "int32"
                },
                "eventCount": {
                  "type": "integer",
                  "format": "int32"
                },
                "botCount": {
                  "type": "integer",
                  "format": "int32"
                },
                "userMatchedCount": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            }
          },
          "botDetection": {
            "type": "object",
            "properties": {
              "highConfidenceBots": {
                "type": "integer",
                "format": "int32"
              },
              "mediumConfidenceBots": {
                "type": "integer",
                "format": "int32"
              },
              "lowConfidenceBots": {
                "type": "integer",
                "format": "int32"
              },
              "likelyHumans": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          "userMatching": {
            "type": "object",
            "properties": {
              "totalMatched": {
                "type": "integer",
                "format": "int32"
              },
              "totalUnmatched": {
                "type": "integer",
                "format": "int32"
              },
              "matchRate": {
                "type": "number",
                "format": "double"
              },
              "averageCorrelationConfidence": {
                "type": "number",
                "format": "double"
              }
            }
          },
          "topOrigins": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "origin": {
                  "type": "string"
                },
                "sessionCount": {
                  "type": "integer",
                  "format": "int32"
                },
                "botPercentage": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          },
          "deviceBreakdown": {
            "type": "object",
            "properties": {
              "mobile": {
                "type": "integer",
                "format": "int32"
              },
              "tablet": {
                "type": "integer",
                "format": "int32"
              },
              "desktop": {
                "type": "integer",
                "format": "int32"
              },
              "browserCounts": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            }
          }
        }
      },
      "publicAnalyticsSummary": {
        "type": "object",
        "properties": {
          "totalSessions": {
            "type": "integer",
            "format": "int32"
          },
          "totalEvents": {
            "type": "integer",
            "format": "int32"
          },
          "uniqueBots": {
            "type": "integer",
            "format": "int32"
          },
          "uniqueUsers": {
            "type": "integer",
            "format": "int32"
          },
          "averageBotScore": {
            "type": "number",
            "format": "double"
          },
          "averageEventsPerSession": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "publicBotDetectionStats": {
        "type": "object",
        "properties": {
          "highConfidenceBots": {
            "type": "integer",
            "format": "int32"
          },
          "mediumConfidenceBots": {
            "type": "integer",
            "format": "int32"
          },
          "lowConfidenceBots": {
            "type": "integer",
            "format": "int32"
          },
          "likelyHumans": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "publicCourse": {
        "type": "object",
        "properties": {
          "courseId": {
            "type": "string"
          },
          "courseName": {
            "type": "string"
          },
          "sessionCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "publicDeviceBreakdown": {
        "type": "object",
        "properties": {
          "mobile": {
            "type": "integer",
            "format": "int32"
          },
          "tablet": {
            "type": "integer",
            "format": "int32"
          },
          "desktop": {
            "type": "integer",
            "format": "int32"
          },
          "browserCounts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int32"
            }
          }
        }
      },
      "publicEventCounts": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "mouse": {
            "type": "integer",
            "format": "int32"
          },
          "scroll": {
            "type": "integer",
            "format": "int32"
          },
          "keyboard": {
            "type": "integer",
            "format": "int32"
          },
          "touch": {
            "type": "integer",
            "format": "int32"
          },
          "form": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "publicEventSummary": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string"
          },
          "messageId": {
            "type": "integer",
            "format": "int32"
          },
          "eventTypeName": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          },
          "payloadSize": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "publicOriginStats": {
        "type": "object",
        "properties": {
          "origin": {
            "type": "string"
          },
          "sessionCount": {
            "type": "integer",
            "format": "int32"
          },
          "botPercentage": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "publicPageVisit": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "type": {
            "type": "string"
          },
          "durationMs": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        }
      },
      "publicSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "botScore": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "detectionFlags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pageUrl": {
            "type": "string"
          },
          "userAgentSummary": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "userName": {
            "type": "string"
          },
          "userUrl": {
            "type": "string"
          }
        }
      },
      "publicSessionDetail": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          },
          "durationSeconds": {
            "type": "number",
            "format": "double"
          },
          "eventCounts": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "format": "int32"
              },
              "mouse": {
                "type": "integer",
                "format": "int32"
              },
              "scroll": {
                "type": "integer",
                "format": "int32"
              },
              "keyboard": {
                "type": "integer",
                "format": "int32"
              },
              "touch": {
                "type": "integer",
                "format": "int32"
              },
              "form": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          "timeline": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "timestamp": {
                  "type": "string",
                  "format": "date-time"
                },
                "eventCount": {
                  "type": "integer",
                  "format": "int32"
                },
                "dominantEventType": {
                  "type": "string"
                },
                "activityLevel": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          },
          "pageHistory": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "timestamp": {
                  "type": "string",
                  "format": "date-time"
                },
                "type": {
                  "type": "string"
                },
                "durationMs": {
                  "type": "integer",
                  "format": "int32",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "publicStats": {
        "type": "object",
        "properties": {
          "totalSessions": {
            "type": "integer",
            "format": "int32"
          },
          "activeSessions": {
            "type": "integer",
            "format": "int32"
          },
          "botsDetected": {
            "type": "integer",
            "format": "int32"
          },
          "sessionsToday": {
            "type": "integer",
            "format": "int32"
          },
          "userMatchedSessions": {
            "type": "integer",
            "format": "int32"
          },
          "averageBotScore": {
            "type": "number",
            "format": "double"
          },
          "lastSessionTime": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "publicTimelineBucket": {
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "eventCount": {
            "type": "integer",
            "format": "int32"
          },
          "dominantEventType": {
            "type": "string"
          },
          "activityLevel": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "publicTimeSeriesPoint": {
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "sessionCount": {
            "type": "integer",
            "format": "int32"
          },
          "eventCount": {
            "type": "integer",
            "format": "int32"
          },
          "botCount": {
            "type": "integer",
            "format": "int32"
          },
          "userMatchedCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "publicUsageRow": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "metricType": {
            "type": "string"
          },
          "value": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "publicUser": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "userName": {
            "type": "string"
          },
          "sessionCount": {
            "type": "integer",
            "format": "int32"
          },
          "botSessionCount": {
            "type": "integer",
            "format": "int32"
          },
          "mediumSessionCount": {
            "type": "integer",
            "format": "int32"
          },
          "averageBotScore": {
            "type": "number",
            "format": "double"
          },
          "maxBotScore": {
            "type": "number",
            "format": "double"
          },
          "deviceCount": {
            "type": "integer",
            "format": "int32"
          },
          "firstSeen": {
            "type": "string",
            "format": "date-time"
          },
          "lastSeen": {
            "type": "string",
            "format": "date-time"
          },
          "riskLevel": {
            "type": "string"
          },
          "sparkline": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "userUrl": {
            "type": "string"
          }
        }
      },
      "publicUserMatchingStats": {
        "type": "object",
        "properties": {
          "totalMatched": {
            "type": "integer",
            "format": "int32"
          },
          "totalUnmatched": {
            "type": "integer",
            "format": "int32"
          },
          "matchRate": {
            "type": "number",
            "format": "double"
          },
          "averageCorrelationConfidence": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "sessionDetailsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string"
              },
              "startTime": {
                "type": "string",
                "format": "date-time"
              },
              "endTime": {
                "type": "string",
                "format": "date-time"
              },
              "durationSeconds": {
                "type": "number",
                "format": "double"
              },
              "eventCounts": {
                "type": "object",
                "properties": {
                  "total": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "mouse": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "scroll": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "keyboard": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "touch": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "form": {
                    "type": "integer",
                    "format": "int32"
                  }
                }
              },
              "timeline": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "eventCount": {
                      "type": "integer",
                      "format": "int32"
                    },
                    "dominantEventType": {
                      "type": "string"
                    },
                    "activityLevel": {
                      "type": "number",
                      "format": "double"
                    }
                  }
                }
              },
              "pageHistory": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "type": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "integer",
                      "format": "int32",
                      "nullable": true
                    }
                  }
                }
              }
            }
          }
        }
      },
      "sessionListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time",
                  "nullable": true
                },
                "status": {
                  "type": "string"
                },
                "botScore": {
                  "type": "number",
                  "format": "double",
                  "nullable": true
                },
                "detectionFlags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "pageUrl": {
                  "type": "string"
                },
                "userAgentSummary": {
                  "type": "string"
                },
                "userId": {
                  "type": "string"
                },
                "userName": {
                  "type": "string"
                },
                "userUrl": {
                  "type": "string"
                }
              }
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "nextCursor": {
                "type": "string"
              },
              "hasMore": {
                "type": "boolean"
              },
              "limit": {
                "type": "integer",
                "format": "int32"
              }
            }
          }
        }
      },
      "sessionResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "status": {
                "type": "string"
              },
              "botScore": {
                "type": "number",
                "format": "double",
                "nullable": true
              },
              "detectionFlags": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "pageUrl": {
                "type": "string"
              },
              "userAgentSummary": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "userName": {
                "type": "string"
              },
              "userUrl": {
                "type": "string"
              }
            }
          }
        }
      },
      "statsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "totalSessions": {
                "type": "integer",
                "format": "int32"
              },
              "activeSessions": {
                "type": "integer",
                "format": "int32"
              },
              "botsDetected": {
                "type": "integer",
                "format": "int32"
              },
              "sessionsToday": {
                "type": "integer",
                "format": "int32"
              },
              "userMatchedSessions": {
                "type": "integer",
                "format": "int32"
              },
              "averageBotScore": {
                "type": "number",
                "format": "double"
              },
              "lastSessionTime": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              }
            }
          }
        }
      },
      "usageResponse": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "period": {
                  "type": "string"
                },
                "metricType": {
                  "type": "string"
                },
                "value": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "totals": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            }
          }
        }
      },
      "userListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "userId": {
                  "type": "string"
                },
                "userName": {
                  "type": "string"
                },
                "sessionCount": {
                  "type": "integer",
                  "format": "int32"
                },
                "botSessionCount": {
                  "type": "integer",
                  "format": "int32"
                },
                "mediumSessionCount": {
                  "type": "integer",
                  "format": "int32"
                },
                "averageBotScore": {
                  "type": "number",
                  "format": "double"
                },
                "maxBotScore": {
                  "type": "number",
                  "format": "double"
                },
                "deviceCount": {
                  "type": "integer",
                  "format": "int32"
                },
                "firstSeen": {
                  "type": "string",
                  "format": "date-time"
                },
                "lastSeen": {
                  "type": "string",
                  "format": "date-time"
                },
                "riskLevel": {
                  "type": "string"
                },
                "sparkline": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "format": "int32"
                  }
                },
                "userUrl": {
                  "type": "string"
                }
              }
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "nextCursor": {
                "type": "string"
              },
              "hasMore": {
                "type": "boolean"
              },
              "limit": {
                "type": "integer",
                "format": "int32"
              }
            }
          }
        }
      },
      "userSessionsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time",
                  "nullable": true
                },
                "status": {
                  "type": "string"
                },
                "botScore": {
                  "type": "number",
                  "format": "double",
                  "nullable": true
                },
                "detectionFlags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "pageUrl": {
                  "type": "string"
                },
                "userAgentSummary": {
                  "type": "string"
                },
                "userId": {
                  "type": "string"
                },
                "userName": {
                  "type": "string"
                },
                "userUrl": {
                  "type": "string"
                }
              }
            }
          },
          "pagination": {
            "type": "object",
            "properties": {
              "nextCursor": {
                "type": "string"
              },
              "hasMore": {
                "type": "boolean"
              },
              "limit": {
                "type": "integer",
                "format": "int32"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearer_auth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Not AI API key (aik_v1_*)"
      }
    }
  }
}