Class: ElevenlabsClient::Endpoints::AgentsPlatform::Secrets

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Secrets

Returns a new instance of Secrets.



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

def initialize(client)
  @client = client
end

Instance Method Details

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

POST /v1/convai/secrets Create a new secret in ElevenLabs Documentation: https://elevenlabs.io/docs/api-reference/convai/secrets/create

Parameters:

  • name (String)

    Name of the secret

  • value (String)

    Value of the secret

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

    Type of secret (default: "new")

Returns:

  • (Hash)

    Created secret with ID and metadata



29
30
31
32
33
34
35
36
37
# File 'lib/elevenlabs_client/endpoints/agents_platform/secrets.rb', line 29

def create(name:, value:, type: "new")
  endpoint = "/v1/convai/secrets"
  request_body = {
    type: type,
    name: name,
    value: value
  }
  @client.post(endpoint, request_body)
end

#delete(secret_id) ⇒ Hash

DELETE /v1/convai/secrets/secret_id Delete a secret from ElevenLabs Documentation: https://elevenlabs.io/docs/api-reference/convai/secrets/delete

Parameters:

  • secret_id (String)

    ID of the secret to delete

Returns:

  • (Hash)

    Empty response on success



45
46
47
48
# File 'lib/elevenlabs_client/endpoints/agents_platform/secrets.rb', line 45

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

#listHash

GET /v1/convai/secrets List all secrets from ElevenLabs Documentation: https://elevenlabs.io/docs/api-reference/convai/secrets/list

Returns:

  • (Hash)

    List of secrets with their metadata



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

def list
  endpoint = "/v1/convai/secrets"
  @client.get(endpoint)
end