Skip to content

client.whoami

The API key making the request. These methods are on client.whoami, 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.

Retrieve the caller. Returns the organisation, key, mode, scopes and API version of the key that authenticated the request.

client.whoami
def retrieve(self, *, more_voice_version: str | Unset = UNSET) -> _m.ApiKeyPrincipal

client.whoami.retrieve() · await async_client.whoami.retrieve() · GET /whoami · API reference

ApiKeyPrincipal:

Field Type Description
object "api_key_principal" Always api_key_principal.
org_id string The organisation the key belongs to (org_…).
key_id string | null The API key (key_…); null for OAuth app tokens.
livemode boolean false for test-mode keys (mv_test_…).
scopes string[] The scopes granted to the key; [“*”] means every scope.
api_version string The API version this request was answered in (MoreVoice-Version header, else the key’s pinned version).
from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
api_key_principal = client.whoami.retrieve()
print(api_key_principal)