{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/drillerdb-com/json-schema/drillerdb-com-driller-license-lookup-response-schema.json",
  "title": "DrillerLicenseLookupResponse",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/drillerdb-com-openapi.json#/components/schemas/DrillerLicenseLookupResponse",
  "type": "object",
  "properties": {
    "state": {
      "type": "string"
    },
    "matches": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/LicenseMatch"
      }
    },
    "nearbyDrillers": {
      "type": "array",
      "description": "Only populated when matches is empty.",
      "items": {
        "$ref": "#/$defs/LicensedDriller"
      }
    }
  },
  "required": [
    "state",
    "matches",
    "nearbyDrillers"
  ],
  "$defs": {
    "LicenseMatch": {
      "type": "object",
      "properties": {
        "licenseNumber": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "description": "Two-letter state."
        },
        "licenseType": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": [
            "string",
            "null"
          ],
          "description": "The state record's status. unverified: the record came from a state license roster DrillerDB cannot re-check, so it is reported as neither active nor expired; expiresDate and lastVerifiedAt are null for it. Confirm it with the state board.",
          "enum": [
            "active",
            "expired",
            "suspended",
            "revoked",
            "unverified",
            null
          ]
        },
        "holderName": {
          "type": [
            "string",
            "null"
          ]
        },
        "holderType": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "individual",
            "company",
            null
          ]
        },
        "issuedDate": {
          "type": [
            "string",
            "null"
          ]
        },
        "expiresDate": {
          "type": [
            "string",
            "null"
          ]
        },
        "lastVerifiedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "sourceUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "State board record, https only."
        },
        "companyName": {
          "type": [
            "string",
            "null"
          ]
        },
        "companySlug": {
          "type": [
            "string",
            "null"
          ],
          "description": "Directory profile: https://drillerdb.com/contractor/{companySlug}."
        },
        "companyCity": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "licenseNumber",
        "state",
        "licenseType",
        "status",
        "holderName",
        "holderType",
        "issuedDate",
        "expiresDate",
        "lastVerifiedAt",
        "sourceUrl",
        "companyName",
        "companySlug",
        "companyCity"
      ]
    },
    "LicensedDriller": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "slug": {
          "type": "string",
          "description": "Directory profile: https://drillerdb.com/contractor/{slug}."
        },
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "activeLicenses": {
          "type": "integer"
        }
      },
      "required": [
        "name",
        "slug",
        "city",
        "activeLicenses"
      ]
    }
  }
}