{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/entitylight/json-schema/entitylight-business-search-schema.json",
  "title": "BusinessSearch",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entitylight-openapi.json#/components/schemas/BusinessSearch",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "by": {
      "type": "string",
      "enum": [
        "officer",
        "registered_agent",
        "address"
      ]
    },
    "name": {
      "description": "The officer or registered agent searched",
      "type": [
        "string",
        "null"
      ]
    },
    "street": {
      "type": [
        "string",
        "null"
      ]
    },
    "zip": {
      "type": [
        "string",
        "null"
      ]
    },
    "state": {
      "type": "string",
      "enum": [
        "AL",
        "AK",
        "AZ",
        "AR",
        "CA",
        "CO",
        "CT",
        "DE",
        "DC",
        "FL",
        "GA",
        "HI",
        "ID",
        "IL",
        "IN",
        "IA",
        "KS",
        "KY",
        "LA",
        "ME",
        "MD",
        "MA",
        "MI",
        "MN",
        "MS",
        "MO",
        "MT",
        "NE",
        "NV",
        "NH",
        "NJ",
        "NM",
        "NY",
        "NC",
        "ND",
        "OH",
        "OK",
        "OR",
        "PA",
        "RI",
        "SC",
        "SD",
        "TN",
        "TX",
        "UT",
        "VT",
        "VA",
        "WA",
        "WV",
        "WI",
        "WY"
      ]
    },
    "businessCount": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "truncated": {
      "type": "boolean",
      "description": "The register lists more than 25 businesses; narrow the search to see the rest"
    },
    "businesses": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "legalName": {
            "type": "string"
          },
          "sosId": {
            "description": "The state's own id for the business; look it up for the full record",
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string"
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "entityType": {
            "description": "As the state records it",
            "type": [
              "string",
              "null"
            ]
          },
          "formationDate": {
            "description": "YYYY-MM-DD",
            "type": [
              "string",
              "null"
            ]
          },
          "registeredAgent": {
            "type": [
              "string",
              "null"
            ]
          },
          "registeredAgentAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "principalAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "mailingAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "officers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "address": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "name",
                "title",
                "address"
              ],
              "additionalProperties": false
            },
            "description": "Officers as the state's register lists them"
          },
          "matched": {
            "type": "object",
            "properties": {
              "as": {
                "type": "string",
                "enum": [
                  "officer",
                  "registered_agent",
                  "address"
                ]
              },
              "value": {
                "type": "string",
                "description": "The officer, agent or address as the register spells it"
              },
              "title": {
                "description": "The officer's title, for officer searches",
                "type": [
                  "string",
                  "null"
                ]
              },
              "addressTypes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "principal",
                    "mailing",
                    "registered_agent"
                  ]
                },
                "description": "Which of the business's addresses matched, for address searches"
              }
            },
            "required": [
              "as",
              "value",
              "title",
              "addressTypes"
            ],
            "additionalProperties": false
          },
          "sourceAsOf": {
            "description": "ISO 8601. When the state's register was published, where it comes from a published file",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "legalName",
          "sosId",
          "state",
          "status",
          "entityType",
          "formationDate",
          "registeredAgent",
          "registeredAgentAddress",
          "principalAddress",
          "mailingAddress",
          "officers",
          "matched",
          "sourceAsOf"
        ],
        "additionalProperties": false
      }
    },
    "createdAt": {
      "type": "string",
      "description": "ISO 8601"
    }
  },
  "required": [
    "id",
    "by",
    "name",
    "street",
    "zip",
    "state",
    "businessCount",
    "truncated",
    "businesses",
    "createdAt"
  ],
  "additionalProperties": false
}