Skip to content

Commit 1f4651c

Browse files
author
Maria Korlotian
authored
CAS-5564/Add webhooks docs (#97)
1 parent 31ea127 commit 1f4651c

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

README.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Installation
1717
Configuration
1818
-------------
1919

20-
import and configure the library with your Castle API secret.
20+
Import and configure the library with your Castle API secret.
2121

2222
.. code:: python
2323
@@ -231,6 +231,20 @@ Exceptions
231231
level HTTP response. You can also choose to catch a more `finegrained
232232
error <https://github.com/castle/castle-python/blob/master/castle/errors.py>`__.
233233

234+
Webhooks
235+
--------
236+
237+
Castle uses webhooks to notify about ``$incident.confirmed`` or `$review.opened` events.
238+
Each webhook has ``X-Castle-Signature`` header that allows verifying webhook's source.
239+
240+
.. code:: python
241+
242+
from castle.webhooks.verify import WebhooksVerify
243+
244+
# Verify the webhook, passed as a Request object
245+
WebhooksVerify.call(webhook_request)
246+
# WebhookVerificationError is raised when the signature is not matching
247+
234248
Documentation
235249
-------------
236250

0 commit comments

Comments
 (0)