> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oathnet.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Victim File Metadata

> Search victim file metadata. This does not return file bytes;
use the victim file-content endpoint for a selected `log_id` and `file_id`.




## OpenAPI

````yaml /openapi.yaml get /service/v2/files/search
openapi: 3.1.0
info:
  title: OathNet Service API
  version: 2.0.0
  description: >
    # OathNet Service API Documentation


    Welcome to the OathNet Service API. This API provides breach search, stealer
    search,

    victims exploration, file search, exports, bulk search, scanners, and OSINT
    enrichment.


    ## Authentication


    Most `/api/service/*` endpoints require authentication via API key. Include
    your API key

    in the `x-api-key` header.


    ```

    x-api-key: YOUR_API_KEY

    ```


    You can obtain an API key from your dashboard at
    https://oathnet.org/dashboard?tab=account


    ## Rate Limiting & Quotas


    - Each request consumes from your daily lookup quota

    - Quota limits depend on your subscription plan

    - The `_meta.lookups` object in responses shows remaining daily lookups

    - Service-specific quotas may apply to certain endpoints


    ## Search Sessions


    For optimal quota management, initialize a search session before making
    service calls:

    1. Call `/service/search/init` with your query

    2. Use the returned `session.id` as `search_id` in subsequent service calls

    3. This groups related lookups and provides better quota tracking


    ## Structured Filters


    V2 search endpoints share one structured filter contract:


    - use `GET` for simple searches and URL-friendly flat filters

    - use `POST` on the same search route when you have an AI/manual structured
    filter, a saved `filter_id`, or a filter tree that is awkward to URL-encode

    - `filter` is a JSON-encoded filter tree on query-string endpoints and a
    real JSON object on POST endpoints

    - POST search routes still take pagination, sorting, date range, `view`, and
    `search_id` as query parameters; the JSON body is for `filter` and
    `filter_id`

    - `filter_id` is a 24-character transient context ID returned by the AI
    filter flow or prior searches

    - explicit `filter` overrides a stored `filter_id` context, and flat params
    may still be used in the same request

    - the same filter objects are reused by AI filter responses, exports, bulk
    search, and scanners

    - advanced filters use leaf rules with `field`, `operator`, and `value`,
    plus `and` / `or` groups for boolean logic

    - supported operators are `eq`, `neq`, `contains`, `starts_with`,
    `ends_with`, `wildcard`, `gt`, `gte`, `lt`, `lte`, `exists`, `in`, and
    `not_in`


    See the `StructuredFilterNode` schema and `/guides/structured-filters` for
    the full operator list and examples.


    ## Success Response Patterns


    Successful responses use three main patterns:


    - Envelope JSON:
      Common on search-session and OSINT endpoints, plus `v2/stealer/search`,
      `v2/breach/search`, `v2/victims/search`, `v2/stealer/subdomain`,
      and `v2/bulk-search` create.
    - Raw JSON:
      Common on `v2/breach/autocomplete*`, `v2/ai/filter*`,
      `v2/files/search`, `v2/victims/*/properties`, `v2/victims/*/summary`,
      `v2/file-search*`, `v2/exports*`, `v2/bulk-search` list and status,
      `v2/victims/{log_id}`, `v2/phonebook`, and most scanner endpoints.
    - File or text stream:
      Victim file downloads, victim archive downloads, export downloads,
      and bulk-search downloads.

    ## Error Handling


    API-generated errors generally return with `success: false` and include:

    - `message`: Human-readable error description

    - `errors`: Object with field-specific or general error details


    Common HTTP status codes:

    - `200`: Success

    - `202`: Async job accepted

    - `400`: Bad Request (invalid parameters)

    - `401`: Unauthorized (missing or invalid token)

    - `403`: Forbidden (Cloudflare block or quota exceeded)

    - `404`: Not Found

    - `409`: Conflict

    - `429`: Too Many Requests

    - `500`: Internal Server Error

    - `502`: Bad Gateway

    - `503`: Service Unavailable
  contact:
    name: OathNet Support
    url: https://oathnet.org/support
  license:
    name: Proprietary
    url: https://oathnet.org/terms
servers:
  - url: https://oathnet.org/api
    description: Production API Server
security:
  - ApiKeyAuth: []
tags:
  - name: Search Session
    description: Initialize and manage search sessions for grouped lookups
  - name: Breach Search
    description: Search across breach databases for leaked credentials and data
  - name: Stealer Search
    description: Original stealer search route for simple credential lookups
  - name: V2 Stealer
    description: Enhanced V2 stealer search with advanced filtering and pagination
  - name: V2 Investigation
    description: >-
      Multi-section investigation across credentials, victims, evidence, files,
      and related credentials
  - name: V2 Breach
    description: Current breach search, autocomplete, and filter workflows
  - name: V2 Victims
    description: Search and explore victim profiles and their associated files
  - name: V2 File Search
    description: Search within victim files using regex, literal, or wildcard patterns
  - name: V2 File Metadata
    description: Search victim file metadata without fetching file bytes
  - name: V2 Export
    description: Export search results to JSONL or CSV format
  - name: V2 Bulk Search
    description: Batch many terms into an asynchronous export-style search job
  - name: Scanners
    description: >-
      Automated monitoring and delivery management for stealer and breach
      scanners
  - name: OSINT Lookups
    description: Open Source Intelligence lookups for various platforms
  - name: Utility
    description: Utility endpoints for autocomplete and other helpers
paths:
  /service/v2/files/search:
    get:
      tags:
        - V2 File Metadata
      summary: Search Victim File Metadata
      description: >
        Search victim file metadata. This does not return file bytes;

        use the victim file-content endpoint for a selected `log_id` and
        `file_id`.
      operationId: searchFilesMetadataV2
      parameters:
        - name: q
          in: query
          description: >-
            Smart search for file id, log id, kind, extension, path, name, or
            folder.
          schema:
            type: string
        - name: log_id
          in: query
          schema:
            type: string
        - name: name
          in: query
          schema:
            type: string
        - name: folder
          in: query
          schema:
            type: string
        - name: kind
          in: query
          schema:
            type: string
            example: cookies
        - name: ext
          in: query
          schema:
            type: string
            example: txt
        - name: size_min
          in: query
          schema:
            type: integer
        - name: size_max
          in: query
          schema:
            type: integer
        - $ref: '#/components/parameters/PageSizeParam'
        - $ref: '#/components/parameters/CursorParam'
        - $ref: '#/components/parameters/SearchIdParam'
      responses:
        '200':
          description: Wrapped file metadata response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2FileMetadataSearchResponse'
        '403':
          description: Feature or filter denied by plan policy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    PageSizeParam:
      name: page_size
      in: query
      description: Number of results to return.
      schema:
        type: integer
        minimum: 1
        maximum: 200
    CursorParam:
      name: cursor
      in: query
      description: Cursor token from the previous response's `next_cursor`.
      schema:
        type: string
    SearchIdParam:
      name: search_id
      in: query
      description: Search session ID from `POST /service/search/init`.
      schema:
        type: string
  schemas:
    V2FileMetadataSearchResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          $ref: '#/components/schemas/V2FileMetadataSearchData'
        _meta:
          $ref: '#/components/schemas/ResponseMeta'
    ErrorResponse:
      type: object
      description: >
        Standard error response format. All errors return `success: false`.


        **Common error messages by endpoint:**

        - Search endpoints: "'q' parameter is required.", "No results found."

        - IP Info: "ip_address parameter is required", "Invalid IP address
        format provided to ip-api."

        - Steam: "steam_id parameter is required", "Steam user not found or
        profile is private"

        - Discord: "discord_id parameter is required", "Invalid Discord ID:
        Discord ID must be 14-19 digits long", "Discord user not found."

        - Xbox: "xbl_id parameter is required", "Xbox user not found."

        - Roblox: "Either 'username' or 'user_id' parameter is required.",
        "Roblox user not found."

        - Holehe: "email parameter is required"

        - Extract Subdomain: "domain parameter is required", "No results found."

        - Auth: "Invalid API key."
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: Human-readable error message
        errors:
          type: object
          description: Error details object. May contain `_meta` with quota info.
          properties:
            error:
              type: string
              description: Error message (for OSINT lookups)
            detail:
              type: string
              description: Error detail (for auth errors)
            details:
              type: string
              description: Additional error details
            status_code:
              type: integer
              description: HTTP status code (for OSINT lookups - 404 for not found)
              example: 404
            _meta:
              $ref: '#/components/schemas/ResponseMeta'
      example:
        success: false
        message: Discord user not found.
        errors:
          error: Discord user not found.
          status_code: 404
          _meta:
            user:
              plan: Pro
              plan_type: pro
              is_plan_active: true
            lookups:
              used_today: 5
              left_today: 995
              daily_limit: 1000
              is_unlimited: false
            service:
              name: Service Name
              id: service-id
              category: general
              is_premium: false
              is_available: true
              session_quota: 10
            performance:
              duration_ms: 508.81
              timestamp: '2026-01-06T01:07:27.981019'
    V2FileMetadataSearchData:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/V2FileMetadataResult'
        meta:
          $ref: '#/components/schemas/V2SearchMetadata'
        next_cursor:
          type: string
        policy_redacted:
          type: boolean
        upgrade_required:
          type: boolean
        redaction_marker:
          type: string
    ResponseMeta:
      type: object
      description: Metadata included in all API responses
      properties:
        user:
          type: object
          properties:
            plan:
              type: string
              description: User's plan name
              example: Pro
            plan_type:
              type: string
              description: Plan type identifier
              example: pro
            is_plan_active:
              type: boolean
              example: true
        lookups:
          type: object
          properties:
            used_today:
              type: integer
              description: Lookups used today
              example: 5
            left_today:
              type: integer
              description: Lookups remaining today
              example: 995
            daily_limit:
              type: integer
              description: Daily lookup limit
              example: 1000
            is_unlimited:
              type: boolean
              example: false
        service:
          type: object
          properties:
            name:
              type: string
              example: Service Name
            id:
              type: string
              example: service-id
            category:
              type: string
              example: general
            is_premium:
              type: boolean
              example: false
            is_available:
              type: boolean
              example: true
            session_quota:
              type: integer
              example: 10
        performance:
          type: object
          properties:
            duration_ms:
              type: number
              description: Request duration in milliseconds
              example: 111.47
            timestamp:
              type: string
              format: date-time
              example: '2026-01-06T00:44:08.191547'
    V2FileMetadataResult:
      type: object
      properties:
        log_id:
          type: string
        file_id:
          type: string
        name:
          type: string
        folder:
          type: string
        path:
          type: string
        ext:
          type: string
        kind:
          type: string
        size_bytes:
          type: integer
    V2SearchMetadata:
      type: object
      properties:
        count:
          type: integer
          description: Results in this page
        total:
          type: integer
          description: Total matching results
        took_ms:
          type: integer
          description: Query time in milliseconds
        has_more:
          type: boolean
        total_pages:
          type: integer
        max_score:
          type: number
        filter_id:
          $ref: '#/components/schemas/FilterContextId'
    FilterContextId:
      type: string
      description: 24-character transient filter context ID.
      pattern: ^[0-9a-fA-F]{24}$
      example: 0123456789abcdef01234567
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication (lowercase header name)

````