Get the calling credential
Returns the organization the request acts in and the credential it presents: an API key with its name, prefix, and access, or a signed-in user with their role.
GET
Returns the organization the request acts in and the credential it presents: an API key with its name, prefix, and access, or a signed-in user with their role. Any valid credential may call it, whatever its grants.
apiKeyheader
x-api-key<token>Whoami
application/json- response
organization*credential*|import { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.whoami.get({});Example Response
{
"organization": {
"id": "string",
"slug": "string",
"name": "string",
"hostedMailDomain": "string"
},
"credential": {
"type": "apiKey",
"id": "string",
"name": "string",
"start": "string",
"access": {
"mode": "full"
}
}
}