{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "atUri": {
      "description": "Watch by AT-URI. at://did watches all collections for a DID. at://did/collection watches all records of that collection for a DID. at://did/collection/record watches a specific record.",
      "properties": {
        "aturi": {
          "type": "string"
        },
        "backlinks": {
          "description": "If true, also watch for records in any repo that reference this DID and collection.",
          "type": "boolean"
        },
        "backlinksOnly": {
          "description": "If true, fire only for records in other repos that reference this scope. Events from the scope DID's own repo never fire, including records that reference itself. Implies backlinks.",
          "type": "boolean"
        }
      },
      "required": [
        "aturi"
      ],
      "type": "object"
    },
    "main": {
      "description": "Webhook configuration for AT Protocol record events. Fires an HTTP POST to a URL when a matching record event is observed on the firehose.",
      "key": "any",
      "record": {
        "properties": {
          "createdAt": {
            "description": "Timestamp of when the webhook was created.",
            "format": "datetime",
            "type": "string"
          },
          "enabled": {
            "description": "Whether the webhook is active. Defaults to true if omitted.",
            "type": "boolean"
          },
          "events": {
            "description": "Which record events to trigger on. Defaults to all events if omitted.",
            "items": {
              "enum": [
                "create",
                "update",
                "delete"
              ],
              "type": "string"
            },
            "maxLength": 3,
            "type": "array"
          },
          "scope": {
            "description": "What to watch. An AT-URI scopes to a specific DID, collection, or record.",
            "ref": "#atUri",
            "type": "ref"
          },
          "secret": {
            "description": "Optional raw secret used to sign the webhook payload with HMAC-SHA256. Prefer secretId to avoid embedding plaintext values in PDS records.",
            "maxLength": 256,
            "minLength": 1,
            "type": "string"
          },
          "secretId": {
            "description": "1–64 character server-managed signing secret ID. Use ASCII letters, digits, dots, underscores, and hyphens only.",
            "format": "record-key",
            "maxLength": 64,
            "type": "string"
          },
          "url": {
            "description": "HTTPS endpoint to POST the webhook payload to.",
            "format": "uri",
            "maxLength": 2048,
            "type": "string"
          }
        },
        "required": [
          "scope",
          "url",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "place.wisp.v2.wh",
  "lexicon": 1
}
