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, and what the organisation can do: its plan, the plan’s features and main limits, and the partner-settable feature flags as they resolve for it. With Mv-Account (a partner key acting in a client organisation), the client’s.
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). |
plan |
string | null |
The organisation’s plan (starter, growth, business, enterprise, …). With Mv-Account, the client organisation’s. Null only while the plan can’t be read (try again). |
features |
PlanFeatures | null |
— |
limits |
PlanLimits | null |
— |
flags |
CapabilityFlags | null |
— |
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)