{
  "schema": {
    "claim": {
      "$id": "https://spec.atpub.me/schema/claim.json",
      "title": "ATpub Identity Claim",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "$type",
        "did",
        "service",
        "identifier"
      ],
      "properties": {
        "$type": {
          "type": "string",
          "const": "me.atpub.identity.claim"
        },
        "did": {
          "type": "string"
        },
        "service": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "https://spec.atpub.me/schema/service.json"
            }
          ]
        },
        "identifier": {
          "type": "string"
        },
        "proofs": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "method"
            ],
            "properties": {
              "method": {
                "type": "string"
              }
            }
          }
        },
        "createdAt": {
          "type": "string"
        }
      }
    },
    "service": {
      "$id": "https://spec.atpub.me/schema/service.json",
      "title": "ATpub Services",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name"
      ],
      "properties": {
        "$type": {
          "type": "string",
          "const": "me.atpub.identity.service"
        },
        "name": {
          "type": "string"
        },
        "homepage": {
          "type": "string",
          "format": "uri"
        },
        "profileUrlTemplate": {
          "type": "string"
        },
        "identifier": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "renderFormat": {
              "type": "string"
            },
            "pattern": {
              "type": "string"
            },
            "punycode": {
              "type": "boolean"
            }
          }
        },
        "icon": {
          "type": "string"
        },
        "verificationMethods": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "type"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "http",
                    "dns",
                    "atproto"
                  ]
                },
                "input": {
                  "type": "object"
                },
                "url": {
                  "type": "string"
                },
                "format": {
                  "type": "string",
                  "enum": [
                    "html",
                    "json",
                    "text"
                  ]
                },
                "selector": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "attr": {
                  "type": "string"
                },
                "needProxy": {
                  "type": "boolean"
                }
              },
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "type": {
                        "const": "http"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "url",
                      "format"
                    ]
                  }
                },
                {
                  "if": {
                    "properties": {
                      "type": {
                        "const": "http"
                      },
                      "format": {
                        "const": "html"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "selector"
                    ]
                  }
                },
                {
                  "if": {
                    "properties": {
                      "type": {
                        "const": "http"
                      },
                      "format": {
                        "const": "json"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "path"
                    ]
                  }
                }
              ]
            }
          }
        }
      }
    }
  },
  "example": {
    "claim": [
      {
        "title": "Claim without proof",
        "item": {
          "$type": "me.atpub.identity.claim",
          "did": "did:plc:mm2qkv2rroigo4y4xa37ib2e",
          "service": "bsky",
          "identifier": "atpub.me",
          "createdAt": "2025-09-12T02:05:00.017Z"
        }
      },
      {
        "title": "Claim without proof (inline service)",
        "item": {
          "$type": "me.atpub.identity.claim",
          "did": "did:plc:mm2qkv2rroigo4y4xa37ib2e",
          "service": {
            "name": "ATpub",
            "profileUrlTemplate": "https://my-custom-url/{identifier}",
            "identifier": {
              "renderFormat": "#{identifier}"
            }
          },
          "identifier": "atpub",
          "createdAt": "2025-09-12T02:05:00.017Z"
        }
      },
      {
        "title": "Claim without proof (remote service)",
        "item": {
          "$type": "me.atpub.identity.claim",
          "did": "did:plc:mm2qkv2rroigo4y4xa37ib2e",
          "service": "test-service@atpub.me",
          "identifier": "my-username",
          "createdAt": "2025-09-12T02:05:00.017Z"
        }
      },
      {
        "title": "Claim with proof (dns)",
        "item": {
          "$type": "me.atpub.identity.claim",
          "did": "did:plc:mm2qkv2rroigo4y4xa37ib2e",
          "service": "dns",
          "identifier": "atpub.me",
          "proofs": [
            {
              "method": "txt"
            }
          ],
          "createdAt": "2025-09-12T02:05:00.017Z"
        }
      },
      {
        "title": "Claim with proof (github)",
        "item": {
          "$type": "me.atpub.identity.claim",
          "did": "did:plc:mm2qkv2rroigo4y4xa37ib2e",
          "service": "github",
          "identifier": "atpub",
          "proofs": [
            {
              "method": "profile"
            }
          ],
          "createdAt": "2025-09-12T02:05:00.017Z"
        }
      },
      {
        "title": "Claim with proof (inline service)",
        "item": {
          "$type": "me.atpub.identity.claim",
          "did": "did:plc:mm2qkv2rroigo4y4xa37ib2e",
          "service": {
            "name": "Custom GitHub",
            "verificationMethods": {
              "profile": {
                "type": "http",
                "url": "https://api.github.com/users/{claim.identifier}",
                "format": "json",
                "path": "$.bio",
                "needProxy": true
              }
            }
          },
          "identifier": "atpub",
          "proofs": [
            {
              "method": "profile"
            }
          ],
          "createdAt": "2025-09-12T02:05:00.017Z"
        }
      }
    ],
    "service": [
      {
        "title": "Basic Services",
        "item": {
          "$type": "me.atpub.identity.claim",
          "name": "Custom GitHub",
          "verificationMethods": {
            "profile": {
              "type": "http",
              "url": "https://api.github.com/users/{claim.identifier}",
              "format": "json",
              "path": "$.bio",
              "needProxy": true
            }
          }
        }
      }
    ]
  },
  "time": "2025-09-17T01:03:06.670Z"
}