Class: ElevenlabsClient::Admin::WorkspaceWebhooks

Inherits:
Object
  • Object
show all
Defined in:
lib/elevenlabs_client/endpoints/admin/workspace_webhooks.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ WorkspaceWebhooks

Returns a new instance of WorkspaceWebhooks.



6
7
8
# File 'lib/elevenlabs_client/endpoints/admin/workspace_webhooks.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#list(**options) ⇒ Hash

GET /v1/workspace/webhooks List all webhooks for a workspace Documentation: https://elevenlabs.io/docs/api-reference/workspace/webhooks/list

Parameters:

  • options (Hash)

    Optional parameters

Options Hash (**options):

  • :include_usages (Boolean)

    Whether to include active usages of the webhook (admin only)

Returns:

  • (Hash)

    JSON response containing list of webhooks



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/elevenlabs_client/endpoints/admin/workspace_webhooks.rb', line 17

def list(**options)
  endpoint = "/v1/workspace/webhooks"
  query_params = options.compact

  if query_params.any?
    query_string = URI.encode_www_form(query_params)
    endpoint = "#{endpoint}?#{query_string}"
  end

  @client.get(endpoint)
end