Whoami

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
/v1/whoami

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.

Authorization

apiKey
headerx-api-key<token>

Response Body

Whoami

application/json
  1. response
organization*
credential*|
Example Request
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"  },  "credential": {    "type": "apiKey",    "id": "string",    "name": "string",    "start": "string",    "access": {      "mode": "full"    }  }}

Related documentation