post-private-webhooks.rst (937B)
1 .. http:post:: [/instances/$INSTANCES]/private/webhooks 2 3 This is used to create a webhook. 4 5 **Required permission:** ``webhooks-write`` 6 7 **Request:** 8 9 The request must be a `WebhookAddDetails`. 10 11 **Response:** 12 13 :http:statuscode:`204 No content`: 14 The creation of the webhook is successsful. 15 16 :http:statuscode:`404 Not found`: 17 The merchant instance is unknown or it not in our data. 18 19 **Details:** 20 21 .. ts:def:: WebhookAddDetails 22 23 interface WebhookAddDetails { 24 25 // Webhook ID to use. 26 webhook_id: string; 27 28 // The event of the webhook: why the webhook is used. 29 event_type: WebhookEventType; 30 31 // URL of the webhook where the customer will be redirected. 32 url: string; 33 34 // Method used by the webhook 35 http_method: string; 36 37 // Header template of the webhook 38 header_template?: string; 39 40 // Body template by the webhook 41 body_template?: string; 42 43 }