{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/selfbadge-com/json-schema/selfbadge-com-draft-request-schema.json",
  "title": "DraftRequest",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/selfbadge-com-openapi.yml#/components/schemas/DraftRequest",
  "type": "object",
  "required": [
    "name",
    "email"
  ],
  "additionalProperties": false,
  "properties": {
    "name": {
      "type": "string",
      "description": "The person's full name."
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "Private: used only to match the claim, cleared when the person claims."
    },
    "other_names": {
      "type": "array",
      "maxItems": 5,
      "items": {
        "type": "string"
      },
      "description": "Other names the person uses (a name in another script matches an attested claim only through these)."
    },
    "description": {
      "type": "string",
      "maxLength": 160
    },
    "job_title": {
      "type": "string",
      "maxLength": 120
    },
    "organization": {
      "type": "string",
      "maxLength": 120
    },
    "city": {
      "description": "A city from the GeoNames list: \"Lisbon, Portugal\" or {name, country}.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "country": {
              "type": "string"
            }
          }
        }
      ]
    },
    "same_as": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "string",
        "format": "uri"
      },
      "description": "The person's own pages and accounts."
    },
    "facts": {
      "type": "array",
      "maxItems": 30,
      "items": {
        "$ref": "#/$defs/PartnerFact"
      },
      "description": "Facts from the editor's closed lists, with an organization where the property names one."
    },
    "not_confused_with": {
      "description": "The \"not to be confused with\" text: a namesake's public description (at most 120 characters), or {description, url}. Needs an active Pro plan from this client for this person.",
      "oneOf": [
        {
          "type": "string",
          "maxLength": 120
        },
        {
          "type": "object",
          "required": [
            "description"
          ],
          "properties": {
            "description": {
              "type": "string",
              "maxLength": 120
            },
            "url": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      ]
    },
    "create_anyway": {
      "type": "boolean",
      "default": false,
      "description": "Create even when a profile with the same name and organization exists."
    }
  },
  "$defs": {
    "PartnerFact": {
      "type": "object",
      "required": [
        "property",
        "value"
      ],
      "additionalProperties": false,
      "properties": {
        "property": {
          "type": "string",
          "enum": [
            "givenName",
            "familyName",
            "honorificPrefix",
            "additionalName",
            "honorificSuffix",
            "alternateName",
            "description",
            "disambiguatingDescription",
            "jobTitle",
            "worksFor",
            "founder",
            "workLocation",
            "hasOccupation",
            "memberOf",
            "affiliation",
            "alumniOf",
            "hasCredential",
            "award",
            "url",
            "sameAs",
            "identifier",
            "knowsAbout",
            "knowsLanguage",
            "authored",
            "subjectOf"
          ]
        },
        "value": {
          "description": "As the editor takes it: a string for one-line fields, or the field's object (for example {code, level} for knowsLanguage, {name, year} for award)."
        },
        "organization": {
          "description": "For worksFor, founder, memberOf, affiliation and alumniOf: a name or {name, url}.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          ]
        },
        "source_url": {
          "type": "string",
          "format": "uri",
          "description": "Where the fact can be checked; the client's website when absent."
        },
        "visibility": {
          "type": "string",
          "enum": [
            "public",
            "private"
          ],
          "description": "The field's default when absent."
        }
      }
    }
  }
}