{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/whoisgeni-us/json-schema/whoisgeni-us-api-response-entity-search-response-schema.json",
  "title": "ApiResponse[EntitySearchResponse]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/whoisgeni-us-entities-api-openapi.yml#/components/schemas/ApiResponse_EntitySearchResponse_",
  "properties": {
    "data": {
      "anyOf": [
        {
          "$ref": "#/$defs/EntitySearchResponse"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/ErrorDetail"
        },
        {
          "type": "null"
        }
      ]
    },
    "meta": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Meta"
    }
  },
  "type": "object",
  "$defs": {
    "DomainAttribution": {
      "properties": {
        "domain": {
          "type": "string",
          "title": "Domain"
        },
        "domain_id": {
          "type": "string",
          "title": "Domain Id"
        },
        "confidence": {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0,
          "title": "Confidence"
        },
        "signal_count": {
          "type": "integer",
          "title": "Signal Count"
        },
        "last_seen": {
          "type": "string",
          "title": "Last Seen"
        }
      },
      "type": "object",
      "required": [
        "domain",
        "domain_id",
        "confidence",
        "signal_count",
        "last_seen"
      ],
      "title": "DomainAttribution",
      "description": "A domain linked to an entity with attribution confidence.\n\nAttributes:\n    domain: Domain name (e.g., \"example.com\").\n    domain_id: UUID of the domain record.\n    confidence: Maximum attribution confidence for this entity-domain pair.\n    signal_count: Number of distinct signals linking entity to domain.\n    last_seen: ISO 8601 timestamp of the most recent signal."
    },
    "EntityMatch": {
      "properties": {
        "entity_id": {
          "type": "string",
          "title": "Entity Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "display_name": {
          "type": "string",
          "title": "Display Name"
        },
        "entity_type": {
          "type": "string",
          "title": "Entity Type"
        },
        "domain_count": {
          "type": "integer",
          "title": "Domain Count"
        },
        "domains": {
          "items": {
            "$ref": "#/$defs/DomainAttribution"
          },
          "type": "array",
          "title": "Domains"
        },
        "relevance": {
          "type": "number",
          "maximum": 1.0,
          "minimum": 0.0,
          "title": "Relevance"
        },
        "portfolio_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Portfolio Count"
        }
      },
      "type": "object",
      "required": [
        "entity_id",
        "name",
        "display_name",
        "entity_type",
        "domain_count",
        "relevance"
      ],
      "title": "EntityMatch",
      "description": "A single entity matching the search query.\n\nAttributes:\n    entity_id: UUID of the entity record.\n    name: Normalized canonical entity name.\n    display_name: Human-readable entity name (first alias or name).\n    entity_type: Entity classification (organization, person, unknown).\n    domain_count: Total number of associated domains.\n    domains: Top domains by confidence (capped at 10 in search results).\n    relevance: Search relevance score (1.0=exact, 0.8=prefix, 0.5=substring).\n    portfolio_count: Domain count from Reverse WHOIS preview (None when unavailable)."
    },
    "EntitySearchResponse": {
      "properties": {
        "query": {
          "type": "string",
          "title": "Query"
        },
        "total": {
          "type": "integer",
          "title": "Total"
        },
        "entities": {
          "items": {
            "$ref": "#/$defs/EntityMatch"
          },
          "type": "array",
          "title": "Entities"
        },
        "limit": {
          "type": "integer",
          "title": "Limit"
        },
        "offset": {
          "type": "integer",
          "title": "Offset"
        },
        "has_more": {
          "type": "boolean",
          "title": "Has More"
        }
      },
      "type": "object",
      "required": [
        "query",
        "total",
        "entities",
        "limit",
        "offset",
        "has_more"
      ],
      "title": "EntitySearchResponse",
      "description": "Paginated entity search results.\n\nAttributes:\n    query: Original search query string.\n    total: Total number of matching entities.\n    entities: List of matched entities with relevance and domains.\n    limit: Maximum results per page.\n    offset: Number of results skipped.\n    has_more: Whether more results exist beyond this page."
    },
    "ErrorDetail": {
      "properties": {
        "code": {
          "type": "string",
          "title": "Code"
        },
        "message": {
          "type": "string",
          "title": "Message"
        },
        "details": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Details"
        }
      },
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "title": "ErrorDetail",
      "description": "Structured error information for API error responses.\n\nAttributes:\n    code: Machine-readable error code (e.g. \"JOB_NOT_FOUND\").\n    message: Human-readable error description.\n    details: Optional additional context for debugging."
    }
  }
}