{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tunnelpowered-com/json-schema/tunnelpowered-com-entity-detail-schema.json",
  "title": "EntityDetail",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tunnelpowered-com-openapi.json#/components/schemas/EntityDetail",
  "allOf": [
    {
      "$ref": "#/$defs/RecordSummary"
    },
    {
      "type": "object",
      "properties": {
        "identity": {
          "type": "object",
          "description": "Address, city, region, country, phone, email — whichever the merchant supplied. An absent field means we do not hold it, NOT that the business lacks it.",
          "additionalProperties": true
        },
        "socialProfiles": {
          "type": "object",
          "additionalProperties": true
        },
        "offerings": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          }
        },
        "faq": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "question": {
                "type": "string"
              },
              "answer": {
                "type": "string"
              }
            }
          }
        },
        "website": {
          "type": [
            "object",
            "null"
          ],
          "description": "Set only when a verified, non-archived website is linked to this entity.",
          "properties": {
            "url": {
              "type": "string",
              "format": "uri"
            },
            "kbUrl": {
              "type": "string",
              "format": "uri"
            },
            "machineReadable": {
              "type": "object",
              "additionalProperties": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  ],
  "$defs": {
    "HumanReview": {
      "type": "object",
      "description": "Whether a person at tunnel edited this KB entry by hand. This is a statement about the RECORD, not about the business — it is not the verification status. Read `verification.level` for that.",
      "required": [
        "reviewed"
      ],
      "properties": {
        "reviewed": {
          "type": "boolean"
        },
        "reviewedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "reviewedBy": {
          "type": "string"
        }
      }
    },
    "RecordSummary": {
      "type": "object",
      "required": [
        "kind",
        "slug",
        "name",
        "entityType",
        "humanReview",
        "url"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "entity",
            "website"
          ]
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "entityType": {
          "type": "string",
          "enum": [
            "company",
            "merchant",
            "organization",
            "person",
            "other",
            "website"
          ]
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "humanReview": {
          "$ref": "#/$defs/HumanReview"
        },
        "verification": {
          "$ref": "#/$defs/Verification"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "Verification": {
      "type": "object",
      "description": "Present on entity records. Absent on website records, which are not verified subjects.",
      "required": [
        "level",
        "status",
        "checkUrl"
      ],
      "properties": {
        "level": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "human",
            "automated",
            null
          ],
          "description": "`human` — a tunnel employee checked legal identity, channel control and that the service is real, and a second employee approved it. `automated` — machines confirmed the merchant controls the channels this record cites, and nothing more. `null` — not verified. Read this field; do not infer verification from the presence of a badge."
        },
        "status": {
          "type": "string",
          "enum": [
            "verified_by_human",
            "verified_automated",
            "unverified"
          ]
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Present when `level` is `automated`. States what the check did NOT establish. The same array is inside the signed attestation, so it cannot be stripped in transit without breaking the signature."
        },
        "checkUrl": {
          "type": "string",
          "format": "uri",
          "description": "Fetch this before a high-stakes action. Revocations propagate faster than caches expire."
        }
      }
    }
  }
}