Class: ElevenlabsClient::Endpoints::AgentsPlatform::Workspace

Inherits:
Object
  • Object
show all
Defined in:
lib/elevenlabs_client/endpoints/agents_platform/workspace.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Workspace

Returns a new instance of Workspace.



7
8
9
# File 'lib/elevenlabs_client/endpoints/agents_platform/workspace.rb', line 7

def initialize(client)
  @client = client
end

Instance Method Details

#create_secret(name:, value:, type: "new") ⇒ Hash

POST /v1/convai/secrets Create a new secret for the workspace Documentation: https://elevenlabs.io/docs/api-reference/conversational-ai/workspace/create-secret

Parameters:

  • name (String)

    Name of the secret

  • value (String)

    Value of the secret

  • type (String) (defaults to: "new")

    Type of secret (defaults to "new")

Returns:

  • (Hash)

    JSON response containing created secret info

Raises:

  • (ArgumentError)


53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/elevenlabs_client/endpoints/agents_platform/workspace.rb', line 53

def create_secret(name:, value:, type: "new")
  raise ArgumentError, "name is required" if name.nil? || name.to_s.strip.empty?
  raise ArgumentError, "value is required" if value.nil? || value.to_s.strip.empty?

  body = {
    type: type,
    name: name,
    value: value
  }

  @client.post("/v1/convai/secrets", body)
end

#delete_secret(secret_id) ⇒ Hash

DELETE /v1/convai/secrets/:secret_id Delete a workspace secret if it's not in use Documentation: https://elevenlabs.io/docs/api-reference/conversational-ai/workspace/delete-secret

Parameters:

  • secret_id (String)

    ID of the secret to delete

Returns:

  • (Hash)

    JSON response with deletion confirmation

Raises:

  • (ArgumentError)


95
96
97
98
99
# File 'lib/elevenlabs_client/endpoints/agents_platform/workspace.rb', line 95

def delete_secret(secret_id)
  raise ArgumentError, "secret_id is required" if secret_id.nil? || secret_id.to_s.strip.empty?

  @client.delete("/v1/convai/secrets/#{secret_id}")
end

#get_dashboard_settingsHash Also known as: dashboard_settings

GET /v1/convai/settings/dashboard Retrieve Convai dashboard settings for the workspace Documentation: https://elevenlabs.io/docs/api-reference/conversational-ai/workspace/get-dashboard-settings

Returns:

  • (Hash)

    JSON response containing dashboard settings



106
107
108
# File 'lib/elevenlabs_client/endpoints/agents_platform/workspace.rb', line 106

def get_dashboard_settings
  @client.get("/v1/convai/settings/dashboard")
end

#get_secretsHash Also known as: secrets

GET /v1/convai/secrets Get all workspace secrets for the user Documentation: https://elevenlabs.io/docs/api-reference/conversational-ai/workspace/get-secrets

Returns:

  • (Hash)

    JSON response containing list of secrets



41
42
43
# File 'lib/elevenlabs_client/endpoints/agents_platform/workspace.rb', line 41

def get_secrets
  @client.get("/v1/convai/secrets")
end

#get_settingsHash Also known as: settings

GET /v1/convai/settings Retrieve Convai settings for the workspace Documentation: https://elevenlabs.io/docs/api-reference/conversational-ai/workspace/get-settings

Returns:

  • (Hash)

    JSON response containing workspace settings



16
17
18
# File 'lib/elevenlabs_client/endpoints/agents_platform/workspace.rb', line 16

def get_settings
  @client.get("/v1/convai/settings")
end

#update_dashboard_settings(charts: nil) ⇒ Hash

PATCH /v1/convai/settings/dashboard Update Convai dashboard settings for the workspace Documentation: https://elevenlabs.io/docs/api-reference/conversational-ai/workspace/update-dashboard-settings

Parameters:

  • charts (Array) (defaults to: nil)

    Array of chart configurations

Returns:

  • (Hash)

    JSON response containing updated dashboard settings



116
117
118
119
120
121
# File 'lib/elevenlabs_client/endpoints/agents_platform/workspace.rb', line 116

def update_dashboard_settings(charts: nil)
  body = {}
  body[:charts] = charts if charts

  @client.patch("/v1/convai/settings/dashboard", body)
end

#update_secret(secret_id, name:, value:, type: "update") ⇒ Hash

PATCH /v1/convai/secrets/:secret_id Update an existing secret for the workspace Documentation: https://elevenlabs.io/docs/api-reference/conversational-ai/workspace/update-secret

Parameters:

  • secret_id (String)

    ID of the secret to update

  • name (String)

    New name for the secret

  • value (String)

    New value for the secret

  • type (String) (defaults to: "update")

    Type of operation (defaults to "update")

Returns:

  • (Hash)

    JSON response containing updated secret info

Raises:

  • (ArgumentError)


75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/elevenlabs_client/endpoints/agents_platform/workspace.rb', line 75

def update_secret(secret_id, name:, value:, type: "update")
  raise ArgumentError, "secret_id is required" if secret_id.nil? || secret_id.to_s.strip.empty?
  raise ArgumentError, "name is required" if name.nil? || name.to_s.strip.empty?
  raise ArgumentError, "value is required" if value.nil? || value.to_s.strip.empty?

  body = {
    type: type,
    name: name,
    value: value
  }

  @client.patch("/v1/convai/secrets/#{secret_id}", body)
end

#update_settings(**options) ⇒ Hash

PATCH /v1/convai/settings Update Convai settings for the workspace Documentation: https://elevenlabs.io/docs/api-reference/conversational-ai/workspace/update-settings

Parameters:

  • options (Hash)

    Settings to update

Options Hash (**options):

  • :conversation_initiation_client_data_webhook (Hash)

    Webhook configuration

  • :webhooks (Hash)

    Webhook settings

  • :can_use_mcp_servers (Boolean)

    Whether workspace can use MCP servers

  • :rag_retention_period_days (Integer)

    RAG retention period (<=30)

  • :default_livekit_stack (String)

    Default LiveKit stack ("standard" or "static")

Returns:

  • (Hash)

    JSON response containing updated settings



31
32
33
34
# File 'lib/elevenlabs_client/endpoints/agents_platform/workspace.rb', line 31

def update_settings(**options)
  body = options.compact
  @client.patch("/v1/convai/settings", body)
end