{
  "openapi": "3.1.0",
  "info": {
    "title": "Osintly API",
    "version": "1.0.0",
    "description": "OpenAPI specification for the Osintly API service.",
    "contact": {
      "name": "Osintly",
      "url": "https://docs.osint.ly/api-reference/quick-start"
    }
  },
  "servers": [
    {
      "url": "https://api.osint.ly",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "System",
      "description": "Health and service checks"
    },
    {
      "name": "Auth",
      "description": "Authorization validation"
    },
    {
      "name": "Search",
      "description": "Create, monitor and retrieve search results"
    },
    {
      "name": "Usage",
      "description": "Rate limit and usage information"
    },
    {
      "name": "Radar",
      "description": "Breach intelligence endpoints (free with API key)"
    },
    {
      "name": "Webhooks",
      "description": "Webhook callback payloads configured from search creation"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": ["System"],
        "summary": "Health check",
        "description": "Return a lightweight service health response to confirm that the API is reachable and responding.",
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "Service health",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                },
                "examples": {
                  "healthy": {
                    "value": {
                      "status": "healthy",
                      "timestamp": "2026-03-03T12:00:00.000Z",
                      "service": "api"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "tags": ["Auth"],
        "summary": "Validate bearer token",
        "description": "Validate the current bearer token and confirm that the API key can access protected endpoints.",
        "operationId": "validateAuthorization",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authorization valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthValidationResponse"
                },
                "examples": {
                  "ok": {
                    "value": {
                      "message": "Authorization Valid",
                      "help": "https://docs.osint.ly/api-reference/quick-start"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          }
        }
      }
    },
    "/modules": {
      "get": {
        "tags": ["Search"],
        "summary": "List modules",
        "description": "Return listed OSINT modules with their IDs, catalog metadata, pagination, featured modules, and aggregations. Requires a bearer API key.",
        "operationId": "listModules",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1
            },
            "description": "Page number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 250
            },
            "description": "Number of modules to return per page"
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ModulesSortBy"
            },
            "description": "Sort order for the module list"
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["preview"]
            },
            "description": "Use `preview` to return the compact module payload used by catalog UIs"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            },
            "description": "Search term matched against module name, type, description, and tags"
          },
          {
            "name": "searchType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 80,
              "default": "All",
              "example": "Pseudonym"
            },
            "description": "Filter by module search type, or `All` for all types"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 80,
              "default": "All",
              "example": "Social Media"
            },
            "description": "Filter by catalog category, or `All` for all categories"
          },
          {
            "name": "featuredOnly",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, return only featured modules"
          }
        ],
        "responses": {
          "200": {
            "description": "Module catalog page",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "example": "public, s-maxage=60, stale-while-revalidate=300"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModulesCatalogResponse"
                },
                "examples": {
                  "preview": {
                    "value": {
                      "aggregations": {
                        "categories": {
                          "Social Media": 42,
                          "Data Enrichment": 18
                        },
                        "featuredCount": 12,
                        "searchTypes": {
                          "Pseudonym": 60,
                          "Email Address": 8
                        },
                        "totalCount": 68
                      },
                      "featuredModules": [
                        {
                          "description": "GitHub is a web-based platform for software development and version control using Git.",
                          "featured": true,
                          "id": "ba35f66f-1a28-412a-a334-2ddf51fb2d56",
                          "installs": 15,
                          "logo": "https://logos.osint.ly/github.com",
                          "name": "Github",
                          "slug": "github",
                          "type": "Pseudonym"
                        }
                      ],
                      "items": [
                        {
                          "description": "GitHub is a web-based platform for software development and version control using Git.",
                          "featured": true,
                          "id": "ba35f66f-1a28-412a-a334-2ddf51fb2d56",
                          "installs": 15,
                          "logo": "https://logos.osint.ly/github.com",
                          "name": "Github",
                          "slug": "github",
                          "type": "Pseudonym"
                        }
                      ],
                      "modules": [
                        {
                          "description": "GitHub is a web-based platform for software development and version control using Git.",
                          "featured": true,
                          "id": "ba35f66f-1a28-412a-a334-2ddf51fb2d56",
                          "installs": 15,
                          "logo": "https://logos.osint.ly/github.com",
                          "name": "Github",
                          "slug": "github",
                          "type": "Pseudonym"
                        }
                      ],
                      "pagination": {
                        "hasNext": true,
                        "hasPrevious": false,
                        "limit": 12,
                        "page": 1,
                        "total": 68,
                        "totalPages": 6
                      },
                      "total": 68
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    },
    "/usage": {
      "get": {
        "tags": ["Usage"],
        "summary": "Get usage and limits",
        "description": "Return current API usage, allowance state, and request limits for the authenticated API key.",
        "operationId": "getUsage",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Usage limits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageSuccessResponse"
                },
                "examples": {
                  "limits": {
                    "value": {
                      "success": true,
                      "message": "Usage limits fetched",
                      "data": {
                        "allowed": true,
                        "limits": {
                          "global": {
                            "used": 12,
                            "max": 500
                          },
                          "daily": {
                            "used": 2,
                            "max": 50
                          }
                        }
                      },
                      "code": 200
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "description": "Usage retrieval error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/radar/breaches": {
      "get": {
        "tags": ["Radar"],
        "summary": "List Radar breaches",
        "description": "Return breach entries with filtering, sorting, and pagination. Radar is available on the Free plan and requires a bearer API key.",
        "operationId": "listRadarBreaches",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 12
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Search by breach name, title, or domain"
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["all", "critical", "high", "medium"],
              "default": "all"
            }
          },
          {
            "name": "exposure",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["all", "100k+", "1m+", "10m+", "100m+"],
              "default": "all"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "example": "2024-01-01"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "example": "2024-12-31"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "recently-added",
                "breach-newest",
                "breach-oldest",
                "largest-exposure"
              ],
              "default": "recently-added"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Radar breach list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RadarBreachesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/PlanFeatureRequiredError"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/radar/breaches/{name}": {
      "get": {
        "tags": ["Radar"],
        "summary": "Get Radar details",
        "description": "Return one breach record by its exact breach name. Radar is available on the Free plan and requires a bearer API key.",
        "operationId": "getRadarBreachByName",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/RadarBreachName"
          }
        ],
        "responses": {
          "200": {
            "description": "Radar breach details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RadarBreachResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "403": {
            "$ref": "#/components/responses/PlanFeatureRequiredError"
          },
          "404": {
            "description": "Breach not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchApiErrorResponse"
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Breach not found"
                      },
                      "meta": {
                        "timestamp": "2026-06-13T12:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/search": {
      "post": {
        "tags": ["Search"],
        "summary": "Create a new search",
        "description": "Queue a new OSINT search with optional module selection, leak sources, account features, delivery settings, cache mode, and BYOK provider configuration. Domain Name and IP Address remain accepted for now, but will soon stop being supported in the Search API.",
        "x-mint": {
          "content": "<Warning>\n**For domain and IP investigation, use [Domain Intelligence](/tools-reference/domain-intelligence) and [IP Intelligence](/tools-reference/ip-intelligence).** These types remain accepted by the Search API for now, but **support there will end soon**. No cutoff date has been announced.\n</Warning>"
        },
        "operationId": "createSearch",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchCreateRequest"
              },
              "examples": {
                "full_search": {
                  "summary": "Full search",
                  "value": {
                    "query": {
                      "type": "Email Address",
                      "value": "target@example.com"
                    },
                    "modules": {
                      "mode": "all"
                    },
                    "features": {
                      "breached_accounts": true,
                      "registered_accounts": "include"
                    },
                    "cache": {
                      "mode": "prefer"
                    },
                    "delivery": {
                      "webhook": {
                        "url": "https://client.example/webhooks/osintly",
                        "secret": "replace-with-your-webhook-secret"
                      }
                    }
                  }
                },
                "with_leak_sources": {
                  "summary": "Full search with leak sources (add-ons required)",
                  "value": {
                    "query": {
                      "type": "Email Address",
                      "value": "target@example.com"
                    },
                    "modules": {
                      "mode": "all"
                    },
                    "leaks": {
                      "mode": "selected",
                      "custom_mapping": true,
                      "sources": [
                        "Hudson Rock",
                        "Leak Check",
                        "Snusbase",
                        "Breach Base",
                        "Leak Osint"
                      ]
                    },
                    "features": {
                      "breached_accounts": true,
                      "registered_accounts": "include"
                    },
                    "cache": {
                      "mode": "prefer"
                    },
                    "delivery": {
                      "webhook": {
                        "url": "https://client.example/webhooks/osintly",
                        "secret": "replace-with-your-webhook-secret"
                      }
                    }
                  }
                },
                "selected_modules": {
                  "summary": "Selected modules only",
                  "value": {
                    "query": {
                      "type": "Email Address",
                      "value": "target@example.com"
                    },
                    "modules": {
                      "mode": "selected",
                      "ids": [
                        "4a8cbb96-70df-4bd6-8f4a-9c0bf5ffde1f",
                        "95c36c17-f76e-4911-bd4e-8ea57515b2fb"
                      ]
                    },
                    "features": {
                      "breached_accounts": true,
                      "registered_accounts": "exclude"
                    },
                    "cache": {
                      "mode": "bypass"
                    }
                  }
                },
                "registered_accounts_only": {
                  "summary": "Registered accounts only",
                  "value": {
                    "query": {
                      "type": "Email Address",
                      "value": "target@example.com"
                    },
                    "features": {
                      "registered_accounts": "only"
                    }
                  }
                },
                "byok": {
                  "summary": "Full search with BYOK providers",
                  "value": {
                    "query": {
                      "type": "Email Address",
                      "value": "target@example.com"
                    },
                    "modules": {
                      "mode": "all"
                    },
                    "features": {
                      "breached_accounts": true,
                      "registered_accounts": "include"
                    },
                    "cache": {
                      "mode": "prefer"
                    },
                    "byok": {
                      "mode": "default",
                      "osint_industries": {
                        "api_key": "YOUR_OSINT_INDUSTRIES_API_KEY",
                        "timeout": 60,
                        "exact_match": true,
                        "premium": false,
                        "premium_modules_only": false
                      },
                      "sherlockeye": {
                        "api_key": "YOUR_SHERLOCKEYE_API_KEY"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Search queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchCreateResponse"
                },
                "examples": {
                  "queued": {
                    "value": {
                      "data": {
                        "search": {
                          "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
                          "status": "pending",
                          "query": {
                            "type": "Email Address",
                            "value": "target@example.com"
                          },
                          "created_at": "2026-05-27T12:00:00.000Z"
                        },
                        "execution": {
                          "run_id": "run_1234567890",
                          "cache_mode": "prefer"
                        },
                        "links": {
                          "self": "https://api.osint.ly/search/d290f1ee-6c54-4b01-90e6-d701748f0851",
                          "stream": "https://api.osint.ly/search/d290f1ee-6c54-4b01-90e6-d701748f0851/stream",
                          "results": "https://api.osint.ly/search/d290f1ee-6c54-4b01-90e6-d701748f0851/results",
                          "leaks": "https://api.osint.ly/search/d290f1ee-6c54-4b01-90e6-d701748f0851/results/leaks"
                        }
                      },
                      "meta": {
                        "environment": "production",
                        "timestamp": "2026-05-27T12:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "429": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "503": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    },
    "/search/temporary": {
      "post": {
        "tags": ["Search"],
        "summary": "Run a temporary search",
        "description": "Run a search and stream its results directly in the response. Osintly does not create a search record, store results, use or write result caches, or keep a replay of the stream. Accepts the same body as POST /search, except delivery webhooks and BYOK providers.",
        "x-mint": {
          "content": "<Note>\nResults exist only in this response. Read [Temporary Searches](/api-reference/temporary-searches) for the stream format, limits, and what Osintly does not keep.\n</Note>"
        },
        "operationId": "createTemporarySearch",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchCreateRequest"
              },
              "examples": {
                "full_search": {
                  "summary": "Full temporary search",
                  "value": {
                    "query": {
                      "type": "Email Address",
                      "value": "target@example.com"
                    },
                    "modules": {
                      "mode": "all"
                    },
                    "features": {
                      "breached_accounts": true,
                      "registered_accounts": "include"
                    },
                    "cache": {
                      "mode": "prefer"
                    }
                  }
                },
                "with_leak_sources": {
                  "summary": "Full temporary search with leak sources (add-ons required)",
                  "value": {
                    "query": {
                      "type": "Email Address",
                      "value": "target@example.com"
                    },
                    "modules": {
                      "mode": "all"
                    },
                    "leaks": {
                      "mode": "selected",
                      "custom_mapping": true,
                      "sources": [
                        "Hudson Rock",
                        "Leak Check",
                        "Snusbase",
                        "Breach Base",
                        "Leak Osint"
                      ]
                    },
                    "features": {
                      "breached_accounts": true,
                      "registered_accounts": "include"
                    },
                    "cache": {
                      "mode": "prefer"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Server-Sent Events stream of the temporary search. Not resumable.",
            "headers": {
              "X-Osintly-Temporary": {
                "description": "Always 1 for a temporary search stream.",
                "schema": {
                  "type": "string",
                  "enum": ["1"]
                }
              },
              "X-Search-Id": {
                "description": "Identifier of this run. It cannot be used with other search endpoints.",
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            },
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "stream": {
                    "value": "event: search.progress\ndata: {\"search_id\":\"6f1c2a9e-0b7d-4c3e-9a51-2d8e4f7b1c90\",\"status\":\"running\",\"timestamp\":\"2026-10-11T12:00:00.000Z\"}\n\nevent: module.result\ndata: {\"search_id\":\"6f1c2a9e-0b7d-4c3e-9a51-2d8e4f7b1c90\",\"module\":{\"id\":\"4a8cbb96-70df-4bd6-8f4a-9c0bf5ffde1f\",\"name\":\"GitHub\"},\"card\":{\"github_001\":{\"username\":\"target\"}},\"timestamp\":\"2026-10-11T12:00:02.000Z\"}\n\nevent: search.finished\ndata: {\"search_id\":\"6f1c2a9e-0b7d-4c3e-9a51-2d8e4f7b1c90\",\"status\":\"completed\",\"totals\":{\"module_results\":1},\"execution_time_ms\":8120,\"timestamp\":\"2026-10-11T12:00:08.000Z\"}\n\n"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "429": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "503": {
            "description": "Registered-account checks for an email search are currently unavailable in temporary mode."
          }
        }
      }
    },
    "/search/temporary/{id}/leaks": {
      "get": {
        "tags": ["Search"],
        "summary": "Get temporary search leaks overview",
        "description": "List the leak sources of a temporary search with status, counts, pagination hints, and fetch URLs. {id} is the X-Search-Id header of the temporary search stream, and the call must use the API key that started the search. Leak records stay available for one hour after the search ends. With X-Osintly-Progressive-Leaks: 1, processing sources may expose readable early pages; counts and pagination are provisional until the source finishes.",
        "operationId": "getTemporarySearchLeaksOverview",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SearchId"
          },
          {
            "$ref": "#/components/parameters/ProgressiveLeaks"
          }
        ],
        "responses": {
          "200": {
            "description": "Leaks sources overview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchLeaksOverviewResponse"
                },
                "examples": {
                  "overview": {
                    "value": {
                      "data": {
                        "sources": [
                          {
                            "name": "Snusbase",
                            "key": "snusbase",
                            "status": "success",
                            "count": 214,
                            "fetch_url": "https://api.osint.ly/search/temporary/d290f1ee-6c54-4b01-90e6-d701748f0851/leaks/snusbase",
                            "pagination": {
                              "page_size": 100,
                              "total_pages": 3
                            },
                            "logo": null,
                            "description": null
                          }
                        ]
                      },
                      "meta": {
                        "environment": "production",
                        "timestamp": "2026-05-27T12:00:30.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    },
    "/search/temporary/{id}/leaks/{source}": {
      "get": {
        "tags": ["Search"],
        "summary": "Get temporary search leak source results",
        "description": "Return normalized results for one leak source of a temporary search, page by page. {id} is the X-Search-Id header of the temporary search stream, and the call must use the API key that started the search. Leak records stay available for one hour after the search ends. With X-Osintly-Progressive-Leaks: 1, published pages can be fetched while the source is processing; unpublished pages return 404.",
        "operationId": "getTemporarySearchLeakSource",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SearchId"
          },
          {
            "$ref": "#/components/parameters/LeakSource"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/ProgressiveLeaks"
          }
        ],
        "responses": {
          "200": {
            "description": "Leak source items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchLeakSourceResponse"
                },
                "examples": {
                  "page_1": {
                    "value": {
                      "data": {
                        "source": {
                          "name": "Snusbase",
                          "key": "snusbase",
                          "status": "success",
                          "logo": null,
                          "description": null
                        },
                        "pagination": {
                          "page": 1,
                          "page_size": 100,
                          "total_pages": 3,
                          "has_next_page": true
                        },
                        "template": {
                          "informations": [],
                          "stats": [],
                          "additional": []
                        },
                        "results": [
                          {
                            "key": "snusbase-collection-1",
                            "items": [
                              {
                                "label": "Email",
                                "value": "target@example.com",
                                "copy": true,
                                "isdate": false,
                                "islink": false
                              }
                            ]
                          }
                        ],
                        "count": 214
                      },
                      "meta": {
                        "environment": "production",
                        "timestamp": "2026-05-27T12:00:32.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    },
    "/search/module/once": {
      "post": {
        "tags": ["Search"],
        "summary": "Run one module immediately",
        "description": "Execute a single module against one query target and return immediate cards in the same response. This endpoint runs only the provided module and does not require stream consumption. Domain Name and IP Address are accepted for now but will soon stop being supported in the Search API; migrate to the corresponding intelligence tools.",
        "operationId": "runModuleOnce",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModuleRunOnceRequest"
              },
              "examples": {
                "single_module": {
                  "summary": "Run X (Twitter) module for one pseudonym",
                  "value": {
                    "query": {
                      "type": "Pseudonym",
                      "value": "EstePrimeWorld"
                    },
                    "module_id": "2e48da48-0f14-457c-92d4-c44cd68b3fdc",
                    "cache": {
                      "mode": "prefer"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Module executed and immediate cards returned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModuleRunOnceResponse"
                },
                "examples": {
                  "success": {
                    "value": {
                      "data": {
                        "search": {
                          "id": "aff38600-cf11-45cc-a489-8706dcaaab88",
                          "status": "finished",
                          "created_at": "2026-06-14T19:20:14.209Z",
                          "completed_at": "2026-06-14T19:20:16.419Z"
                        },
                        "module": {
                          "id": "2e48da48-0f14-457c-92d4-c44cd68b3fdc",
                          "name": "X (Twitter)"
                        },
                        "cards": [
                          {
                            "x_twitter_001": {
                              "items": [
                                {
                                  "label": "Username",
                                  "value": "EstePrimeWorld",
                                  "copy": true,
                                  "isdate": false,
                                  "islink": false
                                }
                              ]
                            }
                          }
                        ]
                      },
                      "meta": {
                        "environment": "production",
                        "timestamp": "2026-06-14T19:20:16.419Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "429": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "503": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    },
    "/search/delete": {
      "post": {
        "tags": ["Search"],
        "summary": "Delete multiple searches",
        "description": "Request asynchronous deletion of one or more completed searches. The request accepts between 1 and 100 search IDs. The batch is all-or-nothing: every provided search ID must belong to the authenticated caller and every search must already be in a terminal state (`finished` or `failed`), otherwise nothing is deleted.",
        "operationId": "deleteSearches",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchDeleteRequest"
              },
              "examples": {
                "bulk_delete": {
                  "value": {
                    "ids": [
                      "d290f1ee-6c54-4b01-90e6-d701748f0851",
                      "7a1f1a8f-9c3a-47b0-8f2d-4efb9a84a5b0"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Deletion accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchDeleteResponse"
                },
                "examples": {
                  "accepted": {
                    "value": {
                      "data": {
                        "accepted": true,
                        "deletion": {
                          "requested_count": 2,
                          "queued_ids": [
                            "d290f1ee-6c54-4b01-90e6-d701748f0851",
                            "7a1f1a8f-9c3a-47b0-8f2d-4efb9a84a5b0"
                          ]
                        }
                      },
                      "meta": {
                        "environment": "production",
                        "timestamp": "2026-05-29T12:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "409": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "503": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    },
    "/search/{id}": {
      "get": {
        "tags": ["Search"],
        "summary": "Get search state",
        "description": "Return the current lifecycle state of a search, including summary counters, webhook delivery status, and follow-up links.",
        "operationId": "getSearchState",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SearchId"
          }
        ],
        "responses": {
          "200": {
            "description": "Search state and summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchStateResponse"
                },
                "examples": {
                  "processing": {
                    "value": {
                      "data": {
                        "search": {
                          "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
                          "status": "processing",
                          "query": {
                            "type": "Email Address",
                            "value": "target@example.com"
                          },
                          "created_at": "2026-05-27T12:00:00.000Z",
                          "started_at": "2026-05-27T12:00:02.000Z",
                          "completed_at": null
                        },
                        "summary": {
                          "module_results": 0,
                          "breached_accounts": 0,
                          "registered_accounts": 0,
                          "leak_sources": 0
                        },
                        "delivery": {
                          "webhook": {
                            "status": "pending",
                            "attempts": 0,
                            "sent_at": null,
                            "last_attempt_at": null
                          }
                        },
                        "links": {
                          "stream": "https://api.osint.ly/search/d290f1ee-6c54-4b01-90e6-d701748f0851/stream",
                          "results": "https://api.osint.ly/search/d290f1ee-6c54-4b01-90e6-d701748f0851/results",
                          "byok": "https://api.osint.ly/search/d290f1ee-6c54-4b01-90e6-d701748f0851/byok",
                          "leaks": "https://api.osint.ly/search/d290f1ee-6c54-4b01-90e6-d701748f0851/results/leaks"
                        }
                      },
                      "meta": {
                        "environment": "production",
                        "timestamp": "2026-05-27T12:00:05.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    },
    "/search/{id}/results": {
      "get": {
        "tags": ["Search"],
        "summary": "Get search results",
        "description": "Return normalized search results for standard modules and BYOK providers, along with breached and registered account outputs when available.",
        "operationId": "getSearchResults",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SearchId"
          }
        ],
        "responses": {
          "200": {
            "description": "Modules, breached accounts and registered accounts results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResultsResponse"
                },
                "examples": {
                  "results": {
                    "value": {
                      "data": {
                        "modules": [
                          {
                            "module": {
                              "id": null,
                              "name": "GitHub"
                            },
                            "cards": [
                              {
                                "github": {
                                  "items": [
                                    {
                                      "label": "Username",
                                      "value": "target",
                                      "copy": true,
                                      "isdate": false,
                                      "islink": false
                                    }
                                  ]
                                }
                              }
                            ]
                          }
                        ],
                        "byok": [
                          {
                            "provider": "osint_industries",
                            "cards": [
                              {
                                "byok_osint_industries": {
                                  "items": [
                                    {
                                      "label": "Domain",
                                      "value": "example.com",
                                      "copy": true,
                                      "isdate": false,
                                      "islink": false
                                    }
                                  ],
                                  "stats": [],
                                  "additional": [],
                                  "informations": {
                                    "title": "Example"
                                  }
                                }
                              }
                            ]
                          }
                        ],
                        "breached_accounts": [],
                        "registered_accounts": [
                          {
                            "check_id": "7c1f5f0e-6c54-4b01-90e6-d701748f0851",
                            "name": "Spotify",
                            "domain": "spotify.com",
                            "section": "Music & Audio",
                            "logo": "https://logos.osint.ly/spotify.com",
                            "description": "Music streaming service.",
                            "found": true,
                            "deletion": {
                              "url": "https://support.spotify.com/account_data/close-account/",
                              "difficulty": "medium",
                              "notes": "Use the \"Close your account\" flow in Account settings and confirm by email.",
                              "email": null
                            }
                          }
                        ]
                      },
                      "meta": {
                        "environment": "production",
                        "timestamp": "2026-05-27T12:00:20.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    },
    "/search/{id}/byok": {
      "get": {
        "tags": ["Search"],
        "summary": "Get BYOK provider results",
        "description": "Return BYOK provider execution status, result counters, errors, and stored provider payloads for a search.",
        "operationId": "getSearchByok",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SearchId"
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "description": "Filter the response to a single BYOK provider. When omitted, all available BYOK providers for the search are returned.",
            "schema": {
              "type": "string",
              "enum": ["osint_industries", "sherlockeye"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "BYOK provider status, metadata, and stored payloads",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchByokResponse"
                },
                "examples": {
                  "byok": {
                    "value": {
                      "data": {
                        "mode": "default",
                        "providers": {
                          "osint_industries": {
                            "status": "success",
                            "result_count": 12,
                            "started_at": "2026-05-27T12:00:03.000Z",
                            "finished_at": "2026-05-27T12:00:18.000Z",
                            "mapping_version": 1,
                            "error": null,
                            "raw": {
                              "provider": "osint_industries",
                              "search_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
                              "result_count": 12,
                              "status": "success",
                              "mapping_version": 1,
                              "started_at": "2026-05-27T12:00:03.000Z",
                              "finished_at": "2026-05-27T12:00:18.000Z",
                              "raw": []
                            }
                          }
                        }
                      },
                      "meta": {
                        "environment": "production",
                        "timestamp": "2026-05-27T12:00:20.000Z"
                      }
                    }
                  },
                  "sherlockeye_only": {
                    "summary": "Filter to Sherlockeye only",
                    "value": {
                      "data": {
                        "mode": "default",
                        "providers": {
                          "sherlockeye": {
                            "status": "success",
                            "result_count": 4,
                            "started_at": "2026-05-27T12:00:03.000Z",
                            "finished_at": "2026-05-27T12:00:14.000Z",
                            "mapping_version": 1,
                            "error": null,
                            "raw": {
                              "provider": "sherlockeye",
                              "search_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
                              "result_count": 4,
                              "status": "success",
                              "mapping_version": 1,
                              "started_at": "2026-05-27T12:00:03.000Z",
                              "finished_at": "2026-05-27T12:00:14.000Z",
                              "raw": []
                            }
                          }
                        }
                      },
                      "meta": {
                        "environment": "production",
                        "timestamp": "2026-05-27T12:00:20.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    },
    "/search/{id}/results/leaks": {
      "get": {
        "tags": ["Search"],
        "summary": "Get leaks overview",
        "description": "List persisted leak sources with status, counts, pagination hints, and fetch URLs. With X-Osintly-Progressive-Leaks: 1, processing sources may expose readable early pages; counts and pagination are provisional until the source finishes. Without the header, only finalized sources are fetchable.",
        "operationId": "getSearchLeaksOverview",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SearchId"
          },
          {
            "$ref": "#/components/parameters/ProgressiveLeaks"
          }
        ],
        "responses": {
          "200": {
            "description": "Leaks sources overview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchLeaksOverviewResponse"
                },
                "examples": {
                  "overview": {
                    "value": {
                      "data": {
                        "sources": [
                          {
                            "name": "Snusbase",
                            "key": "snusbase",
                            "status": "success",
                            "count": 214,
                            "fetch_url": "https://api.osint.ly/search/d290f1ee-6c54-4b01-90e6-d701748f0851/results/leaks/snusbase",
                            "pagination": {
                              "page_size": 100,
                              "total_pages": 3
                            },
                            "logo": null,
                            "description": null
                          }
                        ]
                      },
                      "meta": {
                        "environment": "production",
                        "timestamp": "2026-05-27T12:00:30.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    },
    "/search/{id}/results/leaks/{source}": {
      "get": {
        "tags": ["Search"],
        "summary": "Get leak source results",
        "description": "Return normalized results for one persisted leak source. With X-Osintly-Progressive-Leaks: 1, published pages can be fetched while source.status is processing. Partial pagination describes the currently published subset; refresh the overview when the source finishes. Unpublished pages return 404.",
        "operationId": "getSearchLeakSource",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SearchId"
          },
          {
            "$ref": "#/components/parameters/LeakSource"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/ProgressiveLeaks"
          }
        ],
        "responses": {
          "200": {
            "description": "Leak source items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchLeakSourceResponse"
                },
                "examples": {
                  "page_1": {
                    "value": {
                      "data": {
                        "source": {
                          "name": "Snusbase",
                          "key": "snusbase",
                          "status": "success",
                          "logo": null,
                          "description": null
                        },
                        "pagination": {
                          "page": 1,
                          "page_size": 100,
                          "total_pages": 3,
                          "has_next_page": true
                        },
                        "template": {
                          "informations": [],
                          "stats": [],
                          "additional": []
                        },
                        "results": [
                          {
                            "key": "snusbase-collection-1",
                            "items": [
                              {
                                "label": "Email",
                                "value": "target@example.com",
                                "copy": true,
                                "isdate": false,
                                "islink": false
                              }
                            ]
                          }
                        ],
                        "count": 214
                      },
                      "meta": {
                        "environment": "production",
                        "timestamp": "2026-05-27T12:00:32.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "404": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    },
    "/search/{id}/stream": {
      "get": {
        "tags": ["Search"],
        "summary": "Stream search results",
        "description": "Open a Server-Sent Events stream for progress, modules, BYOK, leak/account events, and final completion. X-Osintly-Progressive-Leaks: 1 additionally enables leak.page.ready notifications for readable early leak pages. Repeat the header on overview/page requests and reconnects. Keep listening until search.finished; leak.page.ready and leaks.finished do not complete the search.",
        "operationId": "streamSearch",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/SearchId"
          },
          {
            "$ref": "#/components/parameters/ProgressiveLeaks"
          },
          {
            "$ref": "#/components/parameters/LastEventId"
          }
        ],
        "responses": {
          "200": {
            "description": "Server-Sent Events stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "examples": {
                  "stream": {
                    "value": "event: connected\ndata: {\"search_id\":\"d290f1ee-6c54-4b01-90e6-d701748f0851\",\"timestamp\":\"2026-05-27T12:00:00.000Z\"}\n\nevent: module.result\ndata: {\"search_id\":\"d290f1ee-6c54-4b01-90e6-d701748f0851\",\"module\":{\"id\":\"4a8cbb96-70df-4bd6-8f4a-9c0bf5ffde1f\",\"name\":\"GitHub\"},\"card\":{\"github_001\":{\"username\":\"target\"}},\"timestamp\":\"2026-05-27T12:00:02.000Z\"}\n\nevent: search.finished\ndata: {\"search_id\":\"d290f1ee-6c54-4b01-90e6-d701748f0851\",\"status\":\"completed\",\"totals\":{\"module_results\":1},\"timestamp\":\"2026-05-27T12:00:08.000Z\"}\n\n"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/SearchApiError"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedError"
          },
          "500": {
            "$ref": "#/components/responses/SearchApiError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key"
      }
    },
    "parameters": {
      "ProgressiveLeaks": {
        "name": "X-Osintly-Progressive-Leaks",
        "in": "header",
        "required": false,
        "description": "Set to the exact string 1 on each stream, leak-overview, and leak-page request to opt in to readable early leak pages. Omit to retain finalized-source behavior. Processing counts and pagination are provisional; final responses and authorization are unchanged.",
        "schema": {
          "type": "string",
          "enum": ["1"]
        }
      },
      "LastEventId": {
        "name": "Last-Event-ID",
        "in": "header",
        "required": false,
        "description": "Last received SSE id used to resume after a disconnect. Repeat the progressive opt-in header when reconnecting and handle replayed notifications idempotently.",
        "schema": {
          "type": "string"
        }
      },
      "SearchId": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "description": "Search UUID"
      },
      "LeakSource": {
        "name": "source",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "example": "snusbase"
        },
        "description": "Leak source key"
      },
      "Page": {
        "name": "page",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1
        },
        "description": "Page number for paginated leak sources"
      },
      "RadarBreachName": {
        "name": "name",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1
        },
        "description": "Exact breach name (URL-encoded)"
      }
    },
    "responses": {
      "ValidationError": {
        "description": "Request validation error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ValidationErrorResponse"
            }
          }
        }
      },
      "UnauthorizedError": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BasicErrorResponse"
            },
            "examples": {
              "unauthorized": {
                "value": {
                  "success": false,
                  "message": "Unauthorized"
                }
              }
            }
          }
        }
      },
      "PlanFeatureRequiredError": {
        "description": "Plan feature required",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SearchApiErrorResponse"
            },
            "examples": {
              "radar_feature_missing": {
                "value": {
                  "error": {
                    "code": "PLAN_FEATURE_REQUIRED",
                    "message": "Plan feature required",
                    "details": "Your plan does not include the radar feature"
                  },
                  "meta": {
                    "timestamp": "2026-06-23T12:00:00.000Z"
                  }
                }
              }
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/InternalErrorResponse"
            }
          }
        }
      },
      "SearchApiError": {
        "description": "Search API error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SearchApiErrorResponse"
            },
            "examples": {
              "validation_error": {
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "Invalid request parameters",
                    "details": [
                      {
                        "path": "query.value",
                        "message": "query.value must be a valid email"
                      }
                    ]
                  },
                  "meta": {
                    "timestamp": "2026-05-27T12:00:00.000Z"
                  }
                }
              },
              "rate_limited": {
                "value": {
                  "error": {
                    "code": "RATE_LIMIT_EXCEEDED",
                    "message": "Rate limit exceeded",
                    "details": "API usage limits have been reached"
                  },
                  "meta": {
                    "environment": "production",
                    "timestamp": "2026-05-27T12:00:00.000Z"
                  }
                }
              },
              "run_not_found": {
                "value": {
                  "error": {
                    "code": "RUN_NOT_FOUND",
                    "message": "Search run not available",
                    "details": "No active run is associated with this search"
                  },
                  "meta": {
                    "environment": "production",
                    "timestamp": "2026-05-27T12:00:00.000Z"
                  }
                }
              },
              "leak_source_not_found": {
                "value": {
                  "error": {
                    "code": "LEAK_SOURCE_NOT_FOUND",
                    "message": "Leak source not found",
                    "details": "No leaked results source matches 'unknown-source'"
                  },
                  "meta": {
                    "environment": "production",
                    "timestamp": "2026-05-27T12:00:00.000Z"
                  }
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "HealthResponse": {
        "type": "object",
        "required": ["status", "timestamp", "service"],
        "properties": {
          "status": {
            "type": "string",
            "enum": ["healthy"],
            "description": "Always `healthy` when the API is reachable and responding."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Server time when the health check was answered (ISO 8601, UTC)."
          },
          "service": {
            "type": "string",
            "enum": ["api"],
            "description": "Name of the service that answered. Always `api`."
          }
        }
      },
      "AuthValidationResponse": {
        "type": "object",
        "required": ["message", "help"],
        "properties": {
          "message": {
            "type": "string",
            "description": "Confirmation that the bearer token is valid."
          },
          "help": {
            "type": "string",
            "format": "uri",
            "description": "Link to the API quick start guide."
          }
        }
      },
      "ModulesSortBy": {
        "type": "string",
        "default": "popular",
        "enum": [
          "popular",
          "usage-desc",
          "usage-asc",
          "recent",
          "name-asc",
          "name-desc",
          "rating"
        ]
      },
      "ModulesCatalogItem": {
        "type": "object",
        "required": ["id", "name", "slug", "type"],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Module UUID"
          },
          "name": {
            "type": "string",
            "description": "Module display name."
          },
          "slug": {
            "type": "string",
            "description": "URL-safe module slug"
          },
          "description": {
            "type": "string",
            "description": "Short description of what the module looks up."
          },
          "type": {
            "type": "string",
            "description": "Search type supported by the module",
            "example": "Pseudonym"
          },
          "logo": {
            "type": "string",
            "description": "Logo URL, or an empty string when unavailable"
          },
          "featured": {
            "type": "boolean",
            "description": "Whether the module is featured in the catalog. Featured modules are listed first."
          },
          "installs": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of times the module has been installed."
          },
          "categories": {
            "type": ["array", "null"],
            "items": {
              "type": "string"
            },
            "description": "Returned in full mode"
          },
          "tags": {
            "type": ["array", "null"],
            "items": {
              "type": "string"
            },
            "description": "Returned in full mode. Internal execution tags are removed."
          },
          "rating": {
            "type": "number",
            "description": "Returned in full mode when available"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Returned in full mode"
          },
          "version": {
            "type": "integer",
            "description": "Returned in full mode"
          }
        },
        "additionalProperties": false
      },
      "ModulesAggregations": {
        "type": "object",
        "required": [
          "categories",
          "featuredCount",
          "searchTypes",
          "totalCount"
        ],
        "properties": {
          "categories": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Module count by category after applying compatible filters"
          },
          "featuredCount": {
            "type": "integer",
            "description": "Number of featured modules that match the current filters."
          },
          "searchTypes": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Module count by search type after applying compatible filters"
          },
          "totalCount": {
            "type": "integer",
            "description": "Number of modules that match the current filters."
          }
        },
        "additionalProperties": false
      },
      "ModulesPagination": {
        "type": "object",
        "required": [
          "hasNext",
          "hasPrevious",
          "limit",
          "page",
          "total",
          "totalPages"
        ],
        "properties": {
          "hasNext": {
            "type": "boolean",
            "description": "Whether another page exists after this one."
          },
          "hasPrevious": {
            "type": "boolean",
            "description": "Whether a page exists before this one."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 250,
            "description": "Maximum number of modules returned per page."
          },
          "page": {
            "type": "integer",
            "minimum": 1,
            "description": "Current page number, starting at 1."
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of modules that match the filters, across all pages."
          },
          "totalPages": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of pages available with the current `limit`."
          }
        },
        "additionalProperties": false
      },
      "ModulesCatalogResponse": {
        "type": "object",
        "required": [
          "aggregations",
          "featuredModules",
          "items",
          "modules",
          "pagination",
          "total"
        ],
        "properties": {
          "aggregations": {
            "$ref": "#/components/schemas/ModulesAggregations",
            "description": "Module counts by category and search type, used to build filters."
          },
          "featuredModules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModulesCatalogItem"
            },
            "description": "Featured modules that match the current filters."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModulesCatalogItem"
            },
            "description": "Modules on the requested page."
          },
          "modules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModulesCatalogItem"
            },
            "description": "Alias of `items` for clients that expect a module list property"
          },
          "pagination": {
            "$ref": "#/components/schemas/ModulesPagination",
            "description": "Pagination details for `items`."
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of modules that match the filters, across all pages. Same value as `pagination.total`."
          }
        },
        "additionalProperties": false
      },
      "LimitWindow": {
        "type": "object",
        "required": ["used", "max"],
        "properties": {
          "used": {
            "type": ["integer", "null"],
            "description": "Searches already counted in this window."
          },
          "max": {
            "type": ["integer", "null"],
            "description": "Maximum number of searches allowed in this window, or null when the plan sets no limit."
          }
        }
      },
      "UsageLimits": {
        "type": "object",
        "required": ["global", "daily"],
        "properties": {
          "global": {
            "$ref": "#/components/schemas/LimitWindow",
            "description": "Search usage over the current subscription period."
          },
          "daily": {
            "$ref": "#/components/schemas/LimitWindow",
            "description": "Search usage for the current day (UTC)."
          }
        }
      },
      "CheckLimitsResult": {
        "type": "object",
        "required": ["allowed", "limits"],
        "properties": {
          "allowed": {
            "type": "boolean",
            "description": "Whether the API key can start a new search right now. False once a window reaches its `max`."
          },
          "limits": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UsageLimits"
              },
              {
                "type": "null"
              }
            ],
            "description": "Usage per window, or null when no limit data is available."
          }
        }
      },
      "ValidationIssue": {
        "type": "object",
        "required": ["path", "message"],
        "properties": {
          "path": {
            "type": "string",
            "description": "Location of the invalid field in the request, with segments joined by dots, for example `query.value`."
          },
          "message": {
            "type": "string",
            "description": "Why the field was rejected."
          }
        }
      },
      "ValidationErrorResponse": {
        "type": "object",
        "required": ["error", "meta"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message", "details"],
            "properties": {
              "code": {
                "type": "string",
                "enum": ["VALIDATION_ERROR"],
                "description": "Always `VALIDATION_ERROR` for invalid request bodies or parameters."
              },
              "message": {
                "type": "string",
                "enum": ["Invalid request parameters"],
                "description": "Short summary of the error."
              },
              "details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ValidationIssue"
                },
                "description": "One entry per invalid field."
              }
            },
            "description": "Details about the rejected request."
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta",
            "description": "Response metadata."
          }
        }
      },
      "BasicErrorResponse": {
        "type": "object",
        "required": ["success", "message"],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [false],
            "description": "Always false for error responses."
          },
          "message": {
            "type": "string",
            "description": "Human-readable error message."
          }
        },
        "additionalProperties": true
      },
      "InternalErrorResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BasicErrorResponse"
          },
          {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "enum": ["Internal server error"],
                "description": "Generic message returned for unexpected server errors."
              }
            }
          }
        ]
      },
      "SearchType": {
        "type": "string",
        "description": "Currently accepted Search API types. Domain Name and IP Address will soon stop being supported here; migrate those lookups to the corresponding intelligence tools. No cutoff date has been announced.",
        "enum": [
          "Pseudonym",
          "Email Address",
          "Domain Name",
          "Cryptocurrency",
          "IP Address"
        ]
      },
      "LeakSourceValue": {
        "type": "string",
        "enum": [
          "Hudson Rock",
          "Leak Check",
          "Snusbase",
          "Breach Base",
          "Leak Osint"
        ]
      },
      "SearchQuery": {
        "type": "object",
        "required": ["type", "value"],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/SearchType",
            "description": "Kind of value to search for. Determines which modules, leak sources and account checks can run."
          },
          "value": {
            "type": "string",
            "description": "Value to search for, such as an email address or a username. Converted to lowercase before the search starts."
          }
        },
        "additionalProperties": false
      },
      "SearchModules": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": ["all", "selected"],
            "default": "all",
            "description": "`all` runs every module compatible with the query type. `selected` runs only the modules listed in `ids`."
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "IDs of the modules to run, taken from `GET /modules`. Required when `mode` is `selected`."
          }
        },
        "additionalProperties": false
      },
      "SearchLeaks": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": ["default", "selected", "none"],
            "default": "none",
            "description": "`none` (default) skips leak sources, `default` queries the default leak sources for the query type, and `selected` queries only the sources listed in `sources`. Omitting `leaks` also skips leak sources. With `default`, you need the add-on of every default source for the query type. Each leak source requires its own active API add-on: a missing add-on returns `403 ADDON_REQUIRED` and an exhausted one returns `429 ADDON_QUOTA_EXCEEDED`."
          },
          "custom_mapping": {
            "type": "boolean",
            "default": false,
            "description": "Enable Osintly custom leak mapping. Disabled by default."
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeakSourceValue"
            },
            "description": "Leak sources to query. Required when `mode` is `selected`."
          }
        },
        "additionalProperties": false
      },
      "SearchFeatures": {
        "type": "object",
        "properties": {
          "breached_accounts": {
            "type": "boolean",
            "default": true,
            "description": "Look up known data breaches for the searched value: Have I Been Pwned for Email Address, LeakCheck for Pseudonym and Domain Name. Enabled by default; set features.breached_accounts to false to skip it. Not run when features.registered_accounts is \"only\"."
          },
          "registered_accounts": {
            "type": "string",
            "enum": ["exclude", "include", "only"],
            "description": "Checks which online services have an account registered with the searched email address. `include` runs the check with the rest of the search, `exclude` skips it, and `only` runs this check alone, without modules, leak sources or breach lookups. Email Address only; for other query types, omit the field or set it to `exclude`. When omitted on an Email Address search, the check runs as with `include`."
          }
        },
        "additionalProperties": false
      },
      "SearchCache": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": ["prefer", "bypass"],
            "default": "prefer",
            "description": "`prefer` reuses a recent cached result for the same query when one exists. `bypass` always runs a fresh search."
          }
        },
        "additionalProperties": false
      },
      "WebhookConfig": {
        "type": "object",
        "required": ["url"],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Endpoint that receives a POST request when the search finishes."
          },
          "secret": {
            "type": "string",
            "minLength": 8,
            "maxLength": 256,
            "description": "Optional shared secret. When set, each webhook request carries an `x-osintly-signature` header (HMAC SHA-256) that you can use to verify the request comes from Osintly."
          }
        },
        "additionalProperties": false
      },
      "SearchDelivery": {
        "type": "object",
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/WebhookConfig",
            "description": "Webhook to call when the search finishes."
          }
        },
        "additionalProperties": false
      },
      "SearchByokProvider": {
        "type": "object",
        "required": ["api_key"],
        "properties": {
          "api_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "description": "External provider API key sent with the search request and not returned by the API."
          }
        },
        "additionalProperties": false
      },
      "SearchByokOsintIndustriesProvider": {
        "type": "object",
        "required": ["api_key"],
        "properties": {
          "api_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "description": "External provider API key sent with the search request and not returned by the API."
          },
          "timeout": {
            "type": "integer",
            "minimum": 25,
            "maximum": 80,
            "description": "OSINT Industries execution timeout in seconds. type and query are derived from the search and cannot be overridden."
          },
          "exact_match": {
            "type": "boolean",
            "description": "Forwarded to OSINT Industries when supported by the selected query type."
          },
          "premium": {
            "type": "boolean",
            "description": "Enable premium OSINT Industries modules."
          },
          "premium_modules_only": {
            "type": "boolean",
            "description": "Only run premium OSINT Industries modules."
          }
        },
        "additionalProperties": false
      },
      "SearchByokSherlockeyeProvider": {
        "type": "object",
        "required": ["api_key"],
        "properties": {
          "api_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "description": "External provider API key sent with the search request and not returned by the API."
          },
          "additional_modules": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "description": "Optional Sherlockeye async search modules to request in addition to the default search. type and value are derived from the Osintly search and cannot be overridden."
          }
        },
        "additionalProperties": false
      },
      "SearchByok": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": ["default", "only"],
            "default": "default",
            "description": "Use BYOK providers in addition to the standard pipeline, or exclusively when set to only."
          },
          "osint_industries": {
            "$ref": "#/components/schemas/SearchByokOsintIndustriesProvider",
            "description": "Run OSINT Industries with your own API key."
          },
          "sherlockeye": {
            "$ref": "#/components/schemas/SearchByokSherlockeyeProvider",
            "description": "Run Sherlockeye with your own API key."
          }
        },
        "description": "Bring your own external OSINT provider API keys for this search.",
        "additionalProperties": false,
        "minProperties": 1
      },
      "SearchCreateRequest": {
        "type": "object",
        "required": ["query"],
        "properties": {
          "query": {
            "$ref": "#/components/schemas/SearchQuery",
            "description": "What to search for. Required."
          },
          "modules": {
            "$ref": "#/components/schemas/SearchModules",
            "description": "Which modules to run. Defaults to every module compatible with the query type."
          },
          "leaks": {
            "$ref": "#/components/schemas/SearchLeaks",
            "description": "Which leak sources to query. Omit it unless you have leak source add-ons: when omitted, no leak source is queried. Send `mode: default` for the default sources of the query type, or `mode: selected` with `sources` to choose them. Each leak source requires its own active API add-on: a missing add-on returns `403 ADDON_REQUIRED` and an exhausted one returns `429 ADDON_QUOTA_EXCEEDED`."
          },
          "features": {
            "$ref": "#/components/schemas/SearchFeatures",
            "description": "Optional checks: breach lookups (`breached_accounts`, on by default) and registered account checks (`registered_accounts`, email only)."
          },
          "cache": {
            "$ref": "#/components/schemas/SearchCache",
            "description": "Whether a recent cached result can be reused. Defaults to `prefer`."
          },
          "delivery": {
            "$ref": "#/components/schemas/SearchDelivery",
            "description": "How to be notified when the search finishes."
          },
          "byok": {
            "$ref": "#/components/schemas/SearchByok",
            "description": "External providers to run with your own API keys."
          }
        },
        "additionalProperties": false
      },
      "ModuleRunOnceRequest": {
        "type": "object",
        "required": ["query", "module_id"],
        "properties": {
          "query": {
            "$ref": "#/components/schemas/SearchQuery",
            "description": "What to search for."
          },
          "module_id": {
            "type": "string",
            "minLength": 1,
            "description": "ID of the module to execute. Exactly one module is executed per request."
          },
          "cache": {
            "$ref": "#/components/schemas/SearchCache",
            "description": "Whether a recent cached result can be reused. Defaults to `prefer`."
          }
        },
        "additionalProperties": false
      },
      "ModuleRunOnceResponse": {
        "type": "object",
        "required": ["data", "meta"],
        "properties": {
          "data": {
            "type": "object",
            "required": ["search", "module", "cards"],
            "properties": {
              "search": {
                "type": "object",
                "required": ["id", "status", "created_at", "completed_at"],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Search ID."
                  },
                  "status": {
                    "type": "string",
                    "enum": ["pending", "processing", "finished", "failed"],
                    "description": "Lifecycle status of the search."
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the search was created."
                  },
                  "completed_at": {
                    "type": ["string", "null"],
                    "format": "date-time",
                    "description": "When the search finished, or null if it has not finished."
                  }
                },
                "description": "Search record created for this module run."
              },
              "module": {
                "type": "object",
                "required": ["id", "name"],
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Module ID."
                  },
                  "name": {
                    "type": "string",
                    "description": "Module display name."
                  }
                },
                "description": "Module that was executed."
              },
              "cards": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                },
                "description": "Result cards returned by the module. The fields of each card depend on the module."
              }
            },
            "description": "Result of the module run."
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta",
            "description": "Response metadata."
          }
        }
      },
      "SearchDeleteRequest": {
        "type": "object",
        "required": ["ids"],
        "properties": {
          "ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Search IDs to delete as a single all-or-nothing batch. Minimum 1 ID, maximum 100 IDs per request. Every ID must belong to the authenticated caller, and every referenced search must already be in a terminal state (`finished` or `failed`). If one ID is invalid, inaccessible, or still active, the whole request is rejected."
          },
          "ignore_missing": {
            "type": "boolean",
            "default": false,
            "description": "Skip IDs that no longer exist for this API key instead of rejecting the batch. Useful when clearing searches mirrored in another system. Other checks still apply to the remaining IDs."
          }
        },
        "additionalProperties": false
      },
      "ResponseMeta": {
        "type": "object",
        "required": ["timestamp"],
        "properties": {
          "environment": {
            "type": "string",
            "description": "API environment that served the request: `production` or `development`."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Server time when the response was generated (ISO 8601, UTC)."
          }
        }
      },
      "SearchLinks": {
        "type": "object",
        "required": ["self", "stream", "results", "byok", "leaks"],
        "properties": {
          "self": {
            "type": "string",
            "format": "uri",
            "description": "URL of this search (`GET /search/{id}`)."
          },
          "stream": {
            "type": "string",
            "format": "uri",
            "description": "URL of the Server-Sent Events stream for this search."
          },
          "results": {
            "type": "string",
            "format": "uri",
            "description": "URL of the module, BYOK and account results."
          },
          "byok": {
            "type": "string",
            "format": "uri",
            "description": "URL of the BYOK provider results."
          },
          "leaks": {
            "type": "string",
            "format": "uri",
            "description": "URL of the leak sources overview."
          }
        }
      },
      "SearchCreateResponse": {
        "type": "object",
        "required": ["data", "meta"],
        "properties": {
          "data": {
            "type": "object",
            "required": ["search", "execution", "links"],
            "properties": {
              "search": {
                "type": "object",
                "required": ["id", "status", "query", "created_at"],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Search ID. Use it in every follow-up request."
                  },
                  "status": {
                    "type": "string",
                    "enum": ["pending", "processing", "finished", "failed"],
                    "description": "Lifecycle status right after creation."
                  },
                  "query": {
                    "$ref": "#/components/schemas/SearchQuery",
                    "description": "Query as it will be searched, with the value converted to lowercase."
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the search was created."
                  }
                },
                "description": "Search record."
              },
              "execution": {
                "type": "object",
                "required": ["run_id", "cache_mode"],
                "properties": {
                  "run_id": {
                    "type": "string",
                    "description": "Identifier of the execution run started for this search."
                  },
                  "cache_mode": {
                    "type": "string",
                    "enum": ["prefer", "bypass"],
                    "description": "Cache mode applied to this search."
                  }
                },
                "description": "Execution details."
              },
              "links": {
                "$ref": "#/components/schemas/SearchLinks",
                "description": "URLs to follow the search and read its results."
              }
            },
            "description": "The created search."
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta",
            "description": "Response metadata."
          }
        }
      },
      "SearchStateResponse": {
        "type": "object",
        "required": ["data", "meta"],
        "properties": {
          "data": {
            "type": "object",
            "required": ["search", "summary", "delivery", "links"],
            "properties": {
              "search": {
                "type": "object",
                "required": [
                  "id",
                  "status",
                  "query",
                  "created_at",
                  "started_at",
                  "completed_at"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Search ID."
                  },
                  "status": {
                    "type": "string",
                    "enum": ["pending", "processing", "finished", "failed"],
                    "description": "Lifecycle status. `finished` and `failed` are final."
                  },
                  "query": {
                    "$ref": "#/components/schemas/SearchQuery",
                    "description": "Query that was searched."
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the search was created."
                  },
                  "started_at": {
                    "type": ["string", "null"],
                    "format": "date-time",
                    "description": "When execution started, or null if it has not started."
                  },
                  "completed_at": {
                    "type": ["string", "null"],
                    "format": "date-time",
                    "description": "When the search finished, or null if it has not finished."
                  }
                },
                "description": "Search record."
              },
              "summary": {
                "type": "object",
                "required": [
                  "module_results",
                  "breached_accounts",
                  "registered_accounts",
                  "leak_sources"
                ],
                "properties": {
                  "module_results": {
                    "type": "integer",
                    "description": "Number of module results."
                  },
                  "breached_accounts": {
                    "type": "integer",
                    "description": "Number of breaches found by the breach lookup. 0 when the lookup was disabled or did not run for this query type."
                  },
                  "registered_accounts": {
                    "type": "integer",
                    "description": "Number of registered account verdicts returned. 0 when the check was excluded or the query is not an email address."
                  },
                  "leak_sources": {
                    "type": "integer",
                    "description": "Number of leak sources that finished with results."
                  }
                },
                "description": "Result counters."
              },
              "delivery": {
                "type": "object",
                "required": ["webhook"],
                "properties": {
                  "webhook": {
                    "type": "object",
                    "required": [
                      "status",
                      "attempts",
                      "sent_at",
                      "last_attempt_at"
                    ],
                    "properties": {
                      "status": {
                        "type": ["string", "null"],
                        "description": "`pending` until the webhook is sent, then `delivered` or `failed`. Null when no webhook was configured."
                      },
                      "attempts": {
                        "type": "integer",
                        "description": "Number of delivery attempts."
                      },
                      "sent_at": {
                        "type": ["string", "null"],
                        "format": "date-time",
                        "description": "When the webhook was delivered, or null."
                      },
                      "last_attempt_at": {
                        "type": ["string", "null"],
                        "format": "date-time",
                        "description": "When the latest delivery attempt happened, or null."
                      }
                    },
                    "description": "Webhook delivery state."
                  }
                },
                "description": "Delivery state."
              },
              "links": {
                "type": "object",
                "required": ["stream", "results", "byok", "leaks"],
                "properties": {
                  "stream": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the Server-Sent Events stream for this search."
                  },
                  "results": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the module, BYOK and account results."
                  },
                  "byok": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the BYOK provider results."
                  },
                  "leaks": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the leak sources overview."
                  }
                },
                "description": "URLs to follow the search and read its results."
              }
            },
            "description": "Current state of the search."
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta",
            "description": "Response metadata."
          }
        }
      },
      "SearchDeleteResponse": {
        "type": "object",
        "required": ["data", "meta"],
        "properties": {
          "data": {
            "type": "object",
            "required": ["accepted", "deletion"],
            "properties": {
              "accepted": {
                "type": "boolean",
                "enum": [true],
                "description": "Always true when the deletion request is accepted."
              },
              "deletion": {
                "type": "object",
                "required": ["requested_count", "queued_ids"],
                "properties": {
                  "requested_count": {
                    "type": "integer",
                    "description": "Number of search IDs in the request."
                  },
                  "queued_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Search IDs queued for deletion. Deletion runs asynchronously."
                  }
                },
                "description": "Deletion details."
              }
            },
            "description": "Deletion request result."
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta",
            "description": "Response metadata."
          }
        }
      },
      "SearchResultsResponse": {
        "type": "object",
        "required": ["data", "meta"],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "modules",
              "byok",
              "breached_accounts",
              "registered_accounts"
            ],
            "properties": {
              "modules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["module", "cards"],
                  "properties": {
                    "module": {
                      "type": "object",
                      "required": ["id", "name"],
                      "properties": {
                        "id": {
                          "type": ["string", "null"],
                          "description": "Module ID, or null when it is unavailable."
                        },
                        "name": {
                          "type": "string",
                          "description": "Module display name."
                        }
                      },
                      "description": "Module that produced the cards."
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Result cards from this module. The fields of each card depend on the module."
                    }
                  }
                },
                "description": "Module results, grouped by module."
              },
              "byok": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["provider", "cards"],
                  "properties": {
                    "provider": {
                      "type": "string",
                      "enum": ["osint_industries", "sherlockeye"],
                      "description": "BYOK provider that produced the cards."
                    },
                    "cards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "description": "Result cards from this provider."
                    }
                  }
                },
                "description": "Results from BYOK providers, grouped by provider."
              },
              "breached_accounts": {
                "type": "array",
                "items": {},
                "description": "Breaches found for the searched value: Have I Been Pwned for Email Address, LeakCheck for Pseudonym and Domain Name. Each entry contains `source` (breach name), `breach_date` and `logo`. Empty when the lookup was disabled, did not run for this query type, or found nothing."
              },
              "registered_accounts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["name", "domain", "section", "logo", "found"],
                  "properties": {
                    "check_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Identifier of the account check that produced this verdict."
                    },
                    "name": {
                      "type": "string",
                      "description": "Service display name."
                    },
                    "domain": {
                      "type": "string",
                      "description": "Service domain."
                    },
                    "section": {
                      "type": "string",
                      "description": "Catalog category the service belongs to, for example \"Social & Content\"."
                    },
                    "logo": {
                      "type": "string",
                      "description": "Service logo URL."
                    },
                    "description": {
                      "type": "string",
                      "nullable": true,
                      "description": "Public description of the service."
                    },
                    "found": {
                      "type": "boolean",
                      "description": "Whether an account exists for the searched email address."
                    },
                    "deletion": {
                      "type": "object",
                      "nullable": true,
                      "description": "Account deletion guide for the service, when Osintly has one on file.",
                      "properties": {
                        "url": {
                          "type": "string",
                          "nullable": true,
                          "description": "Deletion page URL."
                        },
                        "difficulty": {
                          "type": "string",
                          "enum": ["easy", "medium", "hard", "impossible"],
                          "nullable": true,
                          "description": "How hard it is to delete the account."
                        },
                        "notes": {
                          "type": "string",
                          "nullable": true,
                          "description": "Human-readable deletion instructions."
                        },
                        "email": {
                          "type": "string",
                          "nullable": true,
                          "description": "Support or privacy contact email for deletion requests."
                        }
                      }
                    }
                  }
                },
                "description": "Registered account verdicts for the searched email address. Empty for other query types or when the check was excluded."
              }
            },
            "description": "Search results."
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta",
            "description": "Response metadata."
          }
        }
      },
      "SearchLeaksOverviewResponse": {
        "type": "object",
        "required": ["data", "meta"],
        "properties": {
          "data": {
            "type": "object",
            "required": ["sources"],
            "properties": {
              "sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["name", "key", "status", "count", "fetch_url"],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Leak source identifier."
                    },
                    "name": {
                      "type": "string",
                      "description": "Leak source display name."
                    },
                    "key": {
                      "type": "string",
                      "description": "Leak source identifier used in the source results URL. Same value as `id`."
                    },
                    "status": {
                      "type": "string",
                      "description": "Source state: `pending`, `processing`, `success`, `no_results`, `error` or `skipped`."
                    },
                    "count": {
                      "type": "integer",
                      "description": "Published record count. Provisional for an opted-in processing source; zero during processing without opt-in."
                    },
                    "fetchable": {
                      "type": "boolean",
                      "description": "Whether stored records are currently readable. Can be true during processing only for a published subset with progressive opt-in."
                    },
                    "fetch_url": {
                      "type": ["string", "null"],
                      "description": "Source-page endpoint when fetchable; null when no page is available to this request.",
                      "format": "uri"
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page_size": {
                          "type": "integer",
                          "description": "Number of record groups per page."
                        },
                        "total_pages": {
                          "type": "integer",
                          "description": "Published page count, provisional while an opted-in source is processing. Refresh after the terminal source event."
                        }
                      },
                      "description": "Page information, present once the source has published pages."
                    },
                    "logo": {
                      "type": ["string", "null"],
                      "description": "Leak source logo URL, or null."
                    },
                    "description": {
                      "type": ["string", "null"],
                      "description": "Leak source description, or null."
                    },
                    "error": {
                      "type": "string",
                      "description": "Error message, present when the source failed."
                    }
                  }
                },
                "description": "One entry per leak source queried for this search."
              }
            },
            "description": "Leak sources overview."
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta",
            "description": "Response metadata."
          }
        }
      },
      "SearchByokResponse": {
        "type": "object",
        "required": ["data", "meta"],
        "properties": {
          "data": {
            "type": "object",
            "required": ["mode", "providers"],
            "properties": {
              "mode": {
                "type": ["string", "null"],
                "enum": ["default", "only", null],
                "description": "BYOK mode requested for the search, or null when BYOK was not used."
              },
              "providers": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "osint_industries": {
                    "$ref": "#/components/schemas/SearchByokProviderResponse",
                    "description": "OSINT Industries execution details."
                  },
                  "sherlockeye": {
                    "$ref": "#/components/schemas/SearchByokProviderResponse",
                    "description": "Sherlockeye execution details."
                  }
                },
                "description": "Execution details per provider. Only providers configured on the search are present."
              }
            },
            "description": "BYOK execution details."
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta",
            "description": "Response metadata."
          }
        }
      },
      "SearchByokProviderResponse": {
        "type": "object",
        "required": [
          "status",
          "result_count",
          "started_at",
          "finished_at",
          "mapping_version",
          "error",
          "raw"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "Provider execution state, for example `success`, `no_results` or `failed`."
          },
          "result_count": {
            "type": "integer",
            "description": "Number of result cards returned by the provider."
          },
          "started_at": {
            "type": ["string", "null"],
            "format": "date-time",
            "description": "When the provider call started, or null."
          },
          "finished_at": {
            "type": ["string", "null"],
            "format": "date-time",
            "description": "When the provider call finished, or null."
          },
          "mapping_version": {
            "type": ["integer", "null"],
            "description": "Version of the mapping used to convert the provider response into cards, or null."
          },
          "error": {
            "type": ["string", "null"],
            "description": "Error message when the provider failed, or null."
          },
          "raw": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {}
              }
            ],
            "description": "Raw provider response as stored by Osintly, or null."
          }
        }
      },
      "SearchLeakSourceResponse": {
        "type": "object",
        "required": ["data", "meta"],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "source",
              "pagination",
              "template",
              "results",
              "count"
            ],
            "properties": {
              "source": {
                "type": "object",
                "required": ["name", "key", "status"],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Leak source display name."
                  },
                  "key": {
                    "type": "string",
                    "description": "Leak source identifier."
                  },
                  "status": {
                    "type": "string",
                    "description": "Source state: `pending`, `processing`, `success`, `no_results`, `error` or `skipped`."
                  },
                  "logo": {
                    "type": ["string", "null"],
                    "description": "Leak source logo URL, or null."
                  },
                  "description": {
                    "type": ["string", "null"],
                    "description": "Leak source description, or null."
                  }
                },
                "description": "Leak source details."
              },
              "pagination": {
                "type": "object",
                "required": [
                  "page",
                  "page_size",
                  "total_pages",
                  "has_next_page"
                ],
                "properties": {
                  "page": {
                    "type": "integer",
                    "description": "Current page number, starting at 1."
                  },
                  "page_size": {
                    "type": "integer",
                    "description": "Number of record groups per page."
                  },
                  "total_pages": {
                    "type": "integer",
                    "description": "Number of pages available for this source."
                  },
                  "has_next_page": {
                    "type": "boolean",
                    "description": "Whether another page exists after this one."
                  }
                },
                "description": "Page information."
              },
              "template": {
                "type": "object",
                "additionalProperties": true,
                "description": "Display template describing how to render the fields of this source's records."
              },
              "results": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["key", "items"],
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "Unique identifier of the leak entry within the source, for example `leakcheck-result-1`."
                    },
                    "items": {
                      "type": "array",
                      "items": {},
                      "description": "Fields of the leak entry."
                    },
                    "stats": {
                      "type": "array",
                      "items": {},
                      "description": "Optional summary values for the leak entry."
                    },
                    "additional": {
                      "type": "array",
                      "items": {},
                      "description": "Optional extra fields for the leak entry."
                    }
                  }
                },
                "description": "Records on this page, grouped by leak entry."
              },
              "count": {
                "type": "integer",
                "description": "Number of records stored for this source."
              }
            },
            "description": "Records for one leak source."
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta",
            "description": "Response metadata."
          }
        }
      },
      "RadarSeverity": {
        "type": "string",
        "enum": ["critical", "high", "medium"]
      },
      "RadarBreachListItem": {
        "type": "object",
        "required": [
          "id",
          "name",
          "title",
          "domain",
          "breachDate",
          "addedDate",
          "pwnCount",
          "severity",
          "shortDescription"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Radar breach ID."
          },
          "name": {
            "type": "string",
            "description": "Unique breach name. Use it with `GET /radar/breaches/{name}`."
          },
          "title": {
            "type": "string",
            "description": "Breach display title."
          },
          "domain": {
            "type": "string",
            "description": "Domain of the breached service."
          },
          "breachDate": {
            "type": "string",
            "format": "date",
            "description": "Date the breach happened."
          },
          "addedDate": {
            "type": "string",
            "format": "date",
            "description": "Date the breach was added to Radar."
          },
          "pwnCount": {
            "type": "integer",
            "description": "Number of exposed accounts."
          },
          "severity": {
            "$ref": "#/components/schemas/RadarSeverity",
            "description": "Severity level of the breach."
          },
          "shortDescription": {
            "type": ["string", "null"],
            "description": "One-line summary of the breach, or null."
          }
        }
      },
      "RadarPagination": {
        "type": "object",
        "required": [
          "page",
          "limit",
          "total",
          "totalPages",
          "hasNext",
          "hasPrev"
        ],
        "properties": {
          "page": {
            "type": "integer",
            "description": "Current page number, starting at 1."
          },
          "limit": {
            "type": "integer",
            "description": "Maximum number of breaches returned per page."
          },
          "total": {
            "type": "integer",
            "description": "Number of breaches that match the filters, across all pages."
          },
          "totalPages": {
            "type": "integer",
            "description": "Number of pages available with the current `limit`."
          },
          "hasNext": {
            "type": "boolean",
            "description": "Whether another page exists after this one."
          },
          "hasPrev": {
            "type": "boolean",
            "description": "Whether a page exists before this one."
          }
        }
      },
      "RadarBreachesResponse": {
        "type": "object",
        "required": ["breaches", "pagination"],
        "properties": {
          "breaches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RadarBreachListItem"
            },
            "description": "Breaches on the requested page."
          },
          "pagination": {
            "$ref": "#/components/schemas/RadarPagination",
            "description": "Pagination details for `breaches`."
          }
        }
      },
      "RadarBreach": {
        "type": "object",
        "required": [
          "id",
          "name",
          "title",
          "domain",
          "breachDate",
          "addedDate",
          "modifiedDate",
          "pwnCount",
          "description",
          "shortDescription",
          "severity",
          "dataClasses",
          "isVerified",
          "isFabricated",
          "isSensitive",
          "isRetired",
          "isSpamList",
          "isMalware",
          "isSubscriptionFree",
          "isStealerLog",
          "logoPath",
          "attribution",
          "disclosureUrl",
          "aiEnrichments"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Radar breach ID."
          },
          "name": {
            "type": "string",
            "description": "Unique breach name."
          },
          "title": {
            "type": "string",
            "description": "Breach display title."
          },
          "domain": {
            "type": "string",
            "description": "Domain of the breached service."
          },
          "breachDate": {
            "type": "string",
            "format": "date",
            "description": "Date the breach happened."
          },
          "addedDate": {
            "type": "string",
            "format": "date",
            "description": "Date the breach was added to Radar."
          },
          "modifiedDate": {
            "type": "string",
            "format": "date",
            "description": "Date the breach record was last updated."
          },
          "pwnCount": {
            "type": "integer",
            "description": "Number of exposed accounts."
          },
          "description": {
            "type": "string",
            "description": "Full description of the breach."
          },
          "shortDescription": {
            "type": ["string", "null"],
            "description": "One-line summary of the breach, or null."
          },
          "severity": {
            "$ref": "#/components/schemas/RadarSeverity",
            "description": "Severity level of the breach."
          },
          "dataClasses": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Types of data exposed, for example `Email addresses` or `Passwords`."
          },
          "isVerified": {
            "type": "boolean",
            "description": "Whether the breach is confirmed as legitimate."
          },
          "isFabricated": {
            "type": "boolean",
            "description": "Whether the breach is believed to contain fabricated data."
          },
          "isSensitive": {
            "type": "boolean",
            "description": "Whether the breach is flagged as sensitive, for example because membership in the service could harm the people exposed."
          },
          "isRetired": {
            "type": "boolean",
            "description": "Whether the breach has been retired and is no longer searchable."
          },
          "isSpamList": {
            "type": "boolean",
            "description": "Whether the data comes from a spam list rather than a breach of the service."
          },
          "isMalware": {
            "type": "boolean",
            "description": "Whether the data was collected by malware."
          },
          "isSubscriptionFree": {
            "type": "boolean",
            "description": "Whether Have I Been Pwned flags this breach as subscription free."
          },
          "isStealerLog": {
            "type": "boolean",
            "description": "Whether the data comes from infostealer logs."
          },
          "logoPath": {
            "type": ["string", "null"],
            "description": "Breach logo URL, or null."
          },
          "attribution": {
            "type": ["string", "null"],
            "description": "Credit for the breach data source, or null."
          },
          "disclosureUrl": {
            "type": ["string", "null"],
            "description": "URL of the public disclosure, or null."
          },
          "aiEnrichments": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": true
              }
            ],
            "description": "Additional analysis of the breach generated by AI, or null."
          }
        }
      },
      "RadarBreachResponse": {
        "type": "object",
        "required": ["breach"],
        "properties": {
          "breach": {
            "$ref": "#/components/schemas/RadarBreach",
            "description": "Full breach record."
          }
        }
      },
      "SearchApiErrorResponse": {
        "type": "object",
        "required": ["error", "meta"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message"],
            "properties": {
              "code": {
                "type": "string",
                "description": "Machine-readable error code, for example `RATE_LIMIT_EXCEEDED`."
              },
              "message": {
                "type": "string",
                "description": "Short summary of the error."
              },
              "details": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ValidationIssue"
                    }
                  }
                ],
                "description": "More information: a text explanation, or one entry per invalid field for validation errors."
              }
            },
            "description": "Details about the error."
          },
          "meta": {
            "$ref": "#/components/schemas/ResponseMeta",
            "description": "Response metadata."
          }
        }
      },
      "UsageSuccessResponse": {
        "type": "object",
        "required": ["success", "message", "data", "code"],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [true],
            "description": "Always true when the usage lookup succeeds."
          },
          "message": {
            "type": "string",
            "enum": ["Usage limits fetched"],
            "description": "Fixed confirmation message."
          },
          "data": {
            "$ref": "#/components/schemas/CheckLimitsResult",
            "description": "Whether a new search is allowed, and current usage per window."
          },
          "code": {
            "type": "integer",
            "enum": [200],
            "description": "HTTP status code. Always 200."
          }
        }
      },
      "UsageErrorResponse": {
        "type": "object",
        "required": ["success", "message", "error"],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [false],
            "description": "Always false when the usage lookup fails."
          },
          "message": {
            "type": "string",
            "enum": ["An error occurred while fetching usage limits"],
            "description": "Fixed error message."
          },
          "error": {
            "type": "object",
            "required": ["message"],
            "properties": {
              "message": {
                "type": "string",
                "description": "Reason the usage lookup failed."
              }
            },
            "description": "Error details."
          }
        }
      },
      "WebhookDispatchRequest": {
        "type": "object",
        "required": ["searchId"],
        "properties": {
          "searchId": {
            "type": "string",
            "format": "uuid",
            "description": "ID of the search whose webhook should be sent."
          }
        },
        "additionalProperties": false
      },
      "WebhookDispatchResponse": {
        "type": "object",
        "required": ["success", "status", "body"],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Whether the webhook endpoint answered with a success status."
          },
          "status": {
            "type": ["integer", "null"],
            "description": "HTTP status returned by the webhook endpoint, or null when no response was received."
          },
          "body": {
            "type": "string",
            "description": "Response body returned by the webhook endpoint, or an error message when delivery failed."
          }
        }
      }
    }
  }
}
