abacusai.webhook — AbacusAI documentation

# `abacusai.webhook`

## Module Contents

### Classes

`Webhook` | A Abacus.AI Webhook attached to an endpoint and event trigger for a given object.

class abacusai.webhook.Webhook(client, webhookId=None, deploymentId=None, endpoint=None, webhookEventType=None, payloadTemplate=None, createdAt=None)

  Bases: `abacusai.return_class.AbstractApiClass`

  A Abacus.AI Webhook attached to an endpoint and event trigger for a given object.

  Parameters:

    - client (ApiClient) – An authenticated API Client instance

    - webhookId (str) – Unique identifier for this webhook.

    - deploymentId (str) – Identifier for the deployment this webhook is attached to.

    - endpoint (str) – The URI this webhook will send HTTP POST requests to.

    - webhookEventType (str) – The event that triggers the webhook action.

    - payloadTemplate (str) – Template for JSON Dictionary to be sent as the body of the POST request.

    - createdAt (str) – The date and time this webhook was created.

  __repr__()

    Return repr(self).

  to_dict()

    Get a dict representation of the parameters in this class

    Returns:

      The dict value representation of the class parameters

    Return type:

      dict

  refresh()

    Calls describe and refreshes the current object’s fields

    Returns:

      The current object

    Return type:

      Webhook

  describe()

    Describe the webhook with a given id.

    Parameters:

      webhook_id (str) – ID of target webhook.

    Returns:

      The Webhook with the given id.

    Return type:

      Webhook

  update(endpoint=None, webhook_event_type=None, payload_template=None)

    Update the webhook associated with a given webhook id.

    Parameters:

      - endpoint (str) – If set, changes the webhook’s endpoint.

      - webhook_event_type (str) – If set, changes event type.

      - payload_template (dict) – If set, changes payload template.

  delete()

    Delete the webhook with a given id.

    Parameters:

      webhook_id (str) – ID of target webhook.