def get(*, timeout: float | None = None) -> IdentityResourceasync def get(*, timeout: float | None = None) -> IdentityResourceReturns the user the key belongs to, the workspace it is bound to, and a summary of the key itself. This is the only method that needs no scope, so it works with any valid key and is the cheapest way to check that a credential is still live.
Use it at startup to discover workspaceId, which you need for every encryption and decryption call. A key is permanently bound to one workspace, so this value never changes for a given key and is safe to cache for the process lifetime.
Example
from envless import envless
identity = envless.me.get()
print(identity['user']['email'])
print(identity['workspaceId'])import asyncio
from envless import AsyncEnvless
async def main() -> None:
async with AsyncEnvless() as envless:
identity = await envless.me.get()
print(identity['user']['email'])
print(identity['workspaceId'])
asyncio.run(main())Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
timeout | float | No | Seconds each attempt of this call may take, the response body included, before it raises EnvlessNetworkError with is_timeout set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
IdentityResource with user, workspaceId and key.
Worth knowing
keyisNoneonly when the request was authenticated by something other than an API key.- A failure here means the credential itself is bad. Every other method would fail the same way.
Required scopes
None. Any valid API key can call this.
Underlying endpoint
GET /me
Request and response schema, every error code, and a live playground.
In TypeScript
envless.me.get()
The same method in @goenvless/sdk, with the same request, retries and errors.