{
  "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.21.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/webhooks": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a webhook subscription",
        "operationId": "createWebhookSubscription",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/createWebhookSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Payload of WebhookSubscriptionCreatedResponse",
            "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": {
                  "$ref": "#/components/schemas/webhookSubscriptionCreatedResponse"
                }
              }
            }
          },
          "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"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "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": []
          }
        ]
      },
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook subscriptions for your integration",
        "operationId": "listWebhookSubscriptions",
        "responses": {
          "200": {
            "description": "Payload of WebhookSubscriptionListResponse",
            "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": {
                  "$ref": "#/components/schemas/webhookSubscriptionListResponse"
                }
              }
            }
          },
          "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/webhooks/{subscriptionId}": {
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook subscription",
        "operationId": "deleteWebhookSubscription",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "Subscription id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No description",
            "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"
                }
              }
            }
          },
          "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": []
          }
        ]
      },
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Get a single webhook subscription",
        "operationId": "getWebhookSubscription",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "Subscription id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payload of WebhookSubscriptionResponse",
            "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": {
                  "$ref": "#/components/schemas/webhookSubscriptionResponse"
                }
              }
            }
          },
          "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": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook subscription",
        "operationId": "updateWebhookSubscription",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "Subscription id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updateWebhookSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Payload of WebhookSubscriptionResponse",
            "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": {
                  "$ref": "#/components/schemas/webhookSubscriptionResponse"
                }
              }
            }
          },
          "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"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "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"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "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/webhooks/{subscriptionId}/rotate-secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Rotate the signing secret for a webhook subscription",
        "operationId": "rotateWebhookSubscriptionSecret",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "Subscription id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payload of WebhookSubscriptionCreatedResponse",
            "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": {
                  "$ref": "#/components/schemas/webhookSubscriptionCreatedResponse"
                }
              }
            }
          },
          "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/webhooks/{subscriptionId}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Fire a synthetic test event for a webhook subscription",
        "operationId": "testWebhookSubscription",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "Subscription id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payload of WebhookTestResponse",
            "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": {
                        "deliveryId": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "responseCode": {
                          "type": "integer",
                          "format": "int32",
                          "nullable": true
                        },
                        "errorClass": {
                          "type": "string"
                        },
                        "attempts": {
                          "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"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "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/users/{userId}/devices/{fingerprint}/confirm": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Confirm a (userId, fingerprint) pair as a legitimate device",
        "operationId": "confirmDevice",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "description": "User id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fingerprint",
            "in": "path",
            "description": "Device fingerprint.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "notes": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payload of DeviceConfirmResponse",
            "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": {
                        "userId": {
                          "type": "string"
                        },
                        "deviceFingerprint": {
                          "type": "string"
                        },
                        "confirmedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "notes": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "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/settings/risk-thresholds": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Read the integration's risk-classification cutpoints",
        "operationId": "getRiskThresholds",
        "responses": {
          "200": {
            "description": "Payload of RiskThresholdsResponse",
            "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": {
                        "thresholds": {
                          "type": "object",
                          "properties": {
                            "mediumAt": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "botAt": {
                              "type": "integer",
                              "format": "int32"
                            }
                          }
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        },
                        "updatedBy": {
                          "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"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer_auth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "summary": "Replace the integration's risk-classification cutpoints",
        "operationId": "putRiskThresholds",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "thresholds": {
                    "type": "object",
                    "properties": {
                      "mediumAt": {
                        "type": "integer",
                        "format": "int32"
                      },
                      "botAt": {
                        "type": "integer",
                        "format": "int32"
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Payload of RiskThresholdsResponse",
            "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": {
                        "thresholds": {
                          "type": "object",
                          "properties": {
                            "mediumAt": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "botAt": {
                              "type": "integer",
                              "format": "int32"
                            }
                          }
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        },
                        "updatedBy": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "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}/label": {
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "Label a session as bot or human",
        "operationId": "labelSession",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "description": "Session id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "isBot": {
                    "type": "boolean"
                  },
                  "confidence": {
                    "type": "string"
                  },
                  "notes": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Payload of SessionLabelResponse",
            "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"
                        },
                        "isBot": {
                          "type": "boolean"
                        },
                        "confidence": {
                          "type": "string"
                        },
                        "labeledAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "labeledBy": {
                          "type": "string"
                        },
                        "notes": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "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/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"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "confirmDeviceRequest": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string"
          }
        }
      },
      "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"
              }
            }
          }
        }
      },
      "createWebhookSubscriptionRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "eventType": {
            "enum": [
              0,
              1,
              2,
              3,
              4,
              5,
              6
            ],
            "type": "integer",
            "format": "int32",
            "default": 0
          },
          "name": {
            "type": "string"
          },
          "threshold": {
            "$ref": "#/components/schemas/webhookThresholdPayload"
          },
          "enabled": {
            "type": "boolean",
            "nullable": true
          }
        }
      },
      "deviceConfirmBody": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "deviceFingerprint": {
            "type": "string"
          },
          "confirmedAt": {
            "type": "string",
            "format": "date-time"
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "deviceConfirmResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "userId": {
                "type": "string"
              },
              "deviceFingerprint": {
                "type": "string"
              },
              "confirmedAt": {
                "type": "string",
                "format": "date-time"
              },
              "notes": {
                "type": "string"
              }
            }
          }
        }
      },
      "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
              }
            }
          }
        }
      },
      "jsonElement": {
        "type": "object",
        "properties": {
          "valueKind": {
            "enum": [
              0,
              1,
              2,
              3,
              4,
              5,
              6,
              7
            ],
            "type": "integer",
            "format": "int32",
            "default": 0
          },
          "item": {
            "$ref": "#/components/schemas/jsonElement"
          }
        }
      },
      "labelSessionRequest": {
        "type": "object",
        "properties": {
          "isBot": {
            "type": "boolean"
          },
          "confidence": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "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"
          }
        }
      },
      "riskThresholdsBody": {
        "type": "object",
        "properties": {
          "thresholds": {
            "type": "object",
            "properties": {
              "mediumAt": {
                "type": "integer",
                "format": "int32"
              },
              "botAt": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updatedBy": {
            "type": "string"
          }
        }
      },
      "riskThresholdsPayload": {
        "type": "object",
        "properties": {
          "mediumAt": {
            "type": "integer",
            "format": "int32"
          },
          "botAt": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "riskThresholdsPayloadBody": {
        "type": "object",
        "properties": {
          "mediumAt": {
            "type": "integer",
            "format": "int32"
          },
          "botAt": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "riskThresholdsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "thresholds": {
                "type": "object",
                "properties": {
                  "mediumAt": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "botAt": {
                    "type": "integer",
                    "format": "int32"
                  }
                }
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "updatedBy": {
                "type": "string"
              }
            }
          }
        }
      },
      "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
                    }
                  }
                }
              }
            }
          }
        }
      },
      "sessionLabelBody": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "isBot": {
            "type": "boolean"
          },
          "confidence": {
            "type": "string"
          },
          "labeledAt": {
            "type": "string",
            "format": "date-time"
          },
          "labeledBy": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "sessionLabelResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string"
              },
              "isBot": {
                "type": "boolean"
              },
              "confidence": {
                "type": "string"
              },
              "labeledAt": {
                "type": "string",
                "format": "date-time"
              },
              "labeledBy": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            }
          }
        }
      },
      "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
              }
            }
          }
        }
      },
      "updateRiskThresholdsRequest": {
        "type": "object",
        "properties": {
          "thresholds": {
            "type": "object",
            "properties": {
              "mediumAt": {
                "type": "integer",
                "format": "int32"
              },
              "botAt": {
                "type": "integer",
                "format": "int32"
              }
            }
          }
        }
      },
      "updateWebhookSubscriptionRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "eventType": {
            "enum": [
              0,
              1,
              2,
              3,
              4,
              5,
              6
            ],
            "type": "integer",
            "format": "int32",
            "default": 0,
            "nullable": true
          },
          "name": {
            "type": "string"
          },
          "threshold": {
            "$ref": "#/components/schemas/webhookThresholdPayload"
          },
          "enabled": {
            "type": "boolean",
            "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"
              }
            }
          }
        }
      },
      "webhookSubscriptionBody": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "integrationId": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "eventType": {
            "enum": [
              0,
              1,
              2,
              3,
              4,
              5,
              6
            ],
            "type": "integer",
            "format": "int32",
            "default": 0
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "threshold": {
            "$ref": "#/components/schemas/webhookThresholdBody"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastDeliveryAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastDeliveryStatus": {
            "enum": [
              0,
              1,
              2,
              3,
              4,
              5
            ],
            "type": "integer",
            "format": "int32",
            "default": 0,
            "nullable": true
          },
          "disabledAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "disabledReason": {
            "type": "string"
          },
          "disabledFailureClass": {
            "type": "string"
          },
          "disabledDeliveryId": {
            "type": "string"
          }
        }
      },
      "webhookSubscriptionCreatedBody": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "integrationId": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "eventType": {
            "enum": [
              0,
              1,
              2,
              3,
              4,
              5,
              6
            ],
            "type": "integer",
            "format": "int32",
            "default": 0
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "threshold": {
            "$ref": "#/components/schemas/webhookThresholdBody"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastDeliveryAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastDeliveryStatus": {
            "enum": [
              0,
              1,
              2,
              3,
              4,
              5
            ],
            "type": "integer",
            "format": "int32",
            "default": 0,
            "nullable": true
          },
          "disabledAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "disabledReason": {
            "type": "string"
          },
          "disabledFailureClass": {
            "type": "string"
          },
          "disabledDeliveryId": {
            "type": "string"
          },
          "secret": {
            "type": "string"
          }
        }
      },
      "webhookSubscriptionCreatedResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/webhookSubscriptionCreatedBody"
          }
        }
      },
      "webhookSubscriptionListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/webhookSubscriptionBody"
            }
          },
          "tier": {
            "type": "object",
            "properties": {
              "planName": {
                "type": "string"
              },
              "maxSubscriptions": {
                "type": "integer",
                "format": "int32"
              },
              "currentCount": {
                "type": "integer",
                "format": "int32"
              }
            }
          }
        }
      },
      "webhookSubscriptionResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/webhookSubscriptionBody"
          }
        }
      },
      "webhookTestBody": {
        "type": "object",
        "properties": {
          "deliveryId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "responseCode": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "errorClass": {
            "type": "string"
          },
          "attempts": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "webhookTestResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "deliveryId": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "responseCode": {
                "type": "integer",
                "format": "int32",
                "nullable": true
              },
              "errorClass": {
                "type": "string"
              },
              "attempts": {
                "type": "integer",
                "format": "int32"
              }
            }
          }
        }
      },
      "webhookThresholdBody": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "$ref": "#/components/schemas/jsonElement"
          }
        }
      },
      "webhookThresholdPayload": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "$ref": "#/components/schemas/jsonElement"
          }
        }
      },
      "webhookTierInfo": {
        "type": "object",
        "properties": {
          "planName": {
            "type": "string"
          },
          "maxSubscriptions": {
            "type": "integer",
            "format": "int32"
          },
          "currentCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      }
    },
    "securitySchemes": {
      "bearer_auth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Not AI API key (aik_v1_*)"
      }
    }
  }
}