{
    "lexicon": 1,
    "id": "place.wisp.v2.wh",
    "defs": {
        "main": {
            "type": "record",
            "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": {
                "type": "object",
                "required": [
                    "scope",
                    "url",
                    "createdAt"
                ],
                "properties": {
                    "scope": {
                        "type": "ref",
                        "ref": "#atUri",
                        "description": "What to watch. An AT-URI scopes to a specific DID, collection, or record."
                    },
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "maxLength": 2048,
                        "description": "HTTPS endpoint to POST the webhook payload to."
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "create",
                                "update",
                                "delete"
                            ]
                        },
                        "description": "Which record events to trigger on. Defaults to all events if omitted.",
                        "maxLength": 3
                    },
                    "secret": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "Optional raw secret used to sign the webhook payload with HMAC-SHA256. Prefer secretId to avoid embedding plaintext values in PDS records."
                    },
                    "secretId": {
                        "type": "string",
                        "format": "record-key",
                        "maxLength": 64,
                        "description": "1–64 character server-managed signing secret ID. Use ASCII letters, digits, dots, underscores, and hyphens only."
                    },
                    "enabled": {
                        "type": "boolean",
                        "description": "Whether the webhook is active. Defaults to true if omitted."
                    },
                    "createdAt": {
                        "type": "string",
                        "format": "datetime",
                        "description": "Timestamp of when the webhook was created."
                    }
                }
            }
        },
        "atUri": {
            "type": "object",
            "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.",
            "required": [
                "aturi"
            ],
            "properties": {
                "aturi": {
                    "type": "string"
                },
                "backlinks": {
                    "type": "boolean",
                    "description": "If true, also watch for records in any repo that reference this DID and collection."
                }
            }
        }
    }
}
