diff --git a/BTCPayServer/wwwroot/swagger/v1/swagger.template.webhooks.json b/BTCPayServer/wwwroot/swagger/v1/swagger.template.webhooks.json index 70c0d829d..53e391c9e 100644 --- a/BTCPayServer/wwwroot/swagger/v1/swagger.template.webhooks.json +++ b/BTCPayServer/wwwroot/swagger/v1/swagger.template.webhooks.json @@ -68,7 +68,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/WebhookDataCreate" + "$ref": "#/components/schemas/WebhookDataCreateResult" } } } @@ -526,9 +526,6 @@ }, "WebhookData": { "allOf": [ - { - "$ref": "#/components/schemas/WebhookDataBase" - }, { "type": "object", "properties": { @@ -538,10 +535,30 @@ "nullable": false } } + }, + { + "$ref": "#/components/schemas/WebhookDataBase" } ] }, "WebhookDataCreate": { + "allOf": [ + { + "$ref": "#/components/schemas/WebhookDataBase" + }, + { + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Must be used by the callback receiver to ensure the delivery comes from BTCPay Server. BTCPay Server includes the `BTCPay-Sig` HTTP header, whose format is `sha256=HMAC256(UTF8(webhook's secret), body)`. The pattern to authenticate the webhook is similar to [how to secure webhooks in Github](https://docs.github.com/webhooks/securing/). If left out, null, or empty, the secret will be auto-generated.", + "nullable": true + } + } + } + ] + }, + "WebhookDataCreateResult": { "allOf": [ { "$ref": "#/components/schemas/WebhookData" @@ -551,8 +568,8 @@ "properties": { "secret": { "type": "string", - "description": "Must be used by the callback receiver to ensure the delivery comes from BTCPay Server. BTCPay Server includes the `BTCPay-Sig` HTTP header, whose format is `sha256=HMAC256(UTF8(webhook's secret), body)`. The pattern to authenticate the webhook is similar to [how to secure webhooks in Github](https://docs.github.com/webhooks/securing/).", - "nullable": false + "description": "Must be used by the callback receiver to ensure the delivery comes from BTCPay Server. BTCPay Server includes the `BTCPay-Sig` HTTP header, whose format is `sha256=HMAC256(UTF8(webhook's secret), body)`. The pattern to authenticate the webhook is similar to [how to secure webhooks in Github](https://docs.github.com/webhooks/securing/). Value of the auto-generated or custom secret.", + "nullable": true } } } @@ -579,11 +596,6 @@ "type": "object", "additionalProperties": false, "properties": { - "id": { - "type": "string", - "description": "The id of the webhook", - "nullable": false - }, "enabled": { "type": "boolean", "description": "Whether this webhook is enabled or not",