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()
Section titled “retrieve()”Retrieve the caller. Returns the organisation, key, mode, scopes and API version of the key that authenticated the request.
def retrieve(self, *, more_voice_version: str | Unset = UNSET) -> _m.ApiKeyPrincipalclient.whoami.retrieve() · await async_client.whoami.retrieve() · GET /whoami · API reference
Returns
Section titled “Returns”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). |
Example
Section titled “Example”from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
api_key_principal = client.whoami.retrieve()print(api_key_principal)