parseur.webhook =============== .. py:module:: parseur.webhook Classes ------- .. autoapisummary:: parseur.webhook.Webhook Module Contents --------------- .. py:class:: Webhook .. py:method:: from_response(data: Dict) -> Dict :classmethod: Deserialize a webhook API response. :param data: Raw API response dictionary. :return: Deserialized webhook dictionary. .. py:method:: create(event: parseur.event.ParseurEvent, target_url: str, mailbox_id: Optional[int] = None, table_field_id: Optional[str] = None, headers: Optional[Dict[str, str]] = None, name: Optional[str] = None) -> Dict[str, Any] :classmethod: Create a new custom webhook for Parseur. :param event: Webhook event type (document or table event). :param target_url: The URL to send webhook POSTs to. :param mailbox_id: Mailbox ID (required for document events). :param table_field_id: Table field ID (required for table events, e.g. "PF12345"). :param headers: Optional custom HTTP headers. :param name: Optional custom name for the webhook. :return: The created webhook object as a dictionary. .. py:method:: retrieve(webhook_id: int) -> Dict[str, Any] :classmethod: Retrieve a webhook from the account. :param webhook_id: ID of the webhook to delete. :return: The updated mailbox object as a dictionary. .. py:method:: delete(webhook_id: int) -> bool :classmethod: Delete a webhook from the account. :param webhook_id: ID of the webhook to delete. :return: True if deletion was successful. .. py:method:: enable(mailbox_id: int, webhook_id: int) -> Dict[str, Any] :classmethod: Enable an existing webhook for a given mailbox. :param mailbox_id: ID of the mailbox. :param webhook_id: ID of the webhook to enable. :return: The updated mailbox object as a dictionary. .. py:method:: pause(mailbox_id: int, webhook_id: int) -> Dict[str, Any] :classmethod: Pause (disable) an existing webhook for a given mailbox. :param mailbox_id: ID of the mailbox. :param webhook_id: ID of the webhook to pause. :return: The updated mailbox object as a dictionary. .. py:method:: list() -> List[Dict[str, Any]] :classmethod: Retrieve all webhooks as a list. .. py:method:: iter() -> Iterable[Dict[str, Any]] :classmethod: Yield all webhooks registered on the account.