Skip to content

client.secrets

Secret names available to tools and flows (values are never returned). These methods are on client.secrets, where client is a MoreVoice client (see the Python SDK). On AsyncMoreVoice the same methods are awaited. Each one returns the response object and raises an exception when the API answers with an error.

Delete a secret. Flows that still reference {{secret.NAME}} then get an empty value. Needs a live key.

client.secrets
def delete(self, name: str, *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.DeletedSecret

client.secrets.delete() · await async_client.secrets.delete() · DELETE /secrets/{name} · API reference

Name Type Required Description
name str yes The secret’s name.

DeletedSecret:

Field Type Description
object "secret" Always secret.
name string —
deleted true —
from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
deleted_secret = client.secrets.delete("name_123")
print(deleted_secret)

List secrets. Names and update times only, most recently changed first: values are never returned.

client.secrets
def list(self, *, limit: int | Unset = 20, starting_after: str | Unset = UNSET, ending_before: str | Unset = UNSET, more_voice_version: str | Unset = UNSET) -> AsyncPage[_m.Secret]

client.secrets.list() · await async_client.secrets.list() · GET /secrets · API reference

Name Type Required Description
limit integer no How many objects to return, 1–100 (default 20).
starting_after string no A cursor (next_cursor) or object ID: return the objects after it (older).
ending_before string no A cursor or object ID: return the objects before it (newer).

A page of results (SecretList): data, has_more and next_cursor.

from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
for secret in client.secrets.list():
print(secret)

Create or replace a secret. Sets the value of {{secret.NAME}} (creating it, or replacing the value). Write-only: the value is encrypted at rest and never returned. Flows and providers pick the new value up within seconds. Needs a live key.

client.secrets
def set(self, name: str, body: _m.SecretsSetBody | Mapping[str, Any], *, more_voice_version: str | Unset = UNSET) -> _m.Secret

client.secrets.set() · await async_client.secrets.set() · PUT /secrets/{name} · API reference

Name Type Required Description
name str yes The secret’s name.
Field Type Required Description
value string yes The value (up to 8 KB). Write-only: it is encrypted at rest and never returned.

Secret:

Field Type Description
object "secret" Always secret.
livemode boolean true in live mode, false in test mode.
name string Referenced as {{secret.NAME}} in flow API nodes and messaging settings.
updated string An ISO-8601 timestamp in UTC.
from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
secret = client.secrets.set("name_123", {
"value": "sk_live_…",
})
print(secret)