{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/selfbadge-com/json-schema/selfbadge-com-attested-claim-request-schema.json",
  "title": "AttestedClaimRequest",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/selfbadge-com-openapi.yml#/components/schemas/AttestedClaimRequest",
  "type": "object",
  "required": [
    "handle",
    "email",
    "method",
    "evidence",
    "declaration"
  ],
  "additionalProperties": false,
  "properties": {
    "handle": {
      "type": "string"
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "The owner's email: SelfBadge makes their account for it (private)."
    },
    "method": {
      "type": "string",
      "enum": [
        "linkedin",
        "facebook",
        "work_email",
        "id_check",
        "website",
        "manual",
        "partner_declaration"
      ]
    },
    "evidence": {
      "type": "object",
      "description": "linkedin, facebook: {account_id, profile_url (optional), name (as the provider returned it)}. work_email: {email, name}. id_check: {verification_session_id (vs_...), verified_name}. website: {url (where the code was found), name}. manual: {reviewer_id and reviewer_name (a named person on this client's staff, never an automatic process), note, name}. partner_declaration: {declared_at (ISO time), declared_name, email (the same as email), name_rule (this client's rule for the name, short text)}.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "declaration": {
      "type": "object",
      "required": [
        "text",
        "accepted_at",
        "ip"
      ],
      "properties": {
        "text": {
          "type": "string",
          "const": "I confirm I am this person and that the facts are about me"
        },
        "accepted_at": {
          "type": "string",
          "format": "date-time"
        },
        "ip": {
          "type": "string",
          "description": "The person's network address when they accepted (kept 24 months)."
        }
      }
    },
    "test_outcome": {
      "type": "string",
      "enum": [
        "approved",
        "rejected"
      ],
      "description": "Test clients only: how a claim that needs review is decided."
    }
  }
}