Skip to main content
Print the user and workspace associated with the saved API key. Useful for confirming auth is set up before an agent or human interacts with Clay.
clay whoami

Output

{
  "user": {
    "id": "12345",
    "name": "Ada Lovelace"
  },
  "workspace": {
    "id": "ws_abc123"
  }
}
FieldTypeDescription
user.idstringClay user id of the API key owner.
user.namestring | nullDisplay name of the user, or null if not set.
workspace.idstringWorkspace the API key is scoped to.

Errors

CodeExitNotes
auth_missing_api_key3No API key configured. Run clay login to set one. Universal code, listed here because whoami is the first auth check.
auth_invalid3The configured API key was rejected by Clay. whoami is the canonical check.
See the quickstart for universal error codes that apply to every command.

Examples

clay whoami
clay whoami | jq -r '.user.id'
clay whoami | jq -r '.workspace.id'
clay whoami >/dev/null && echo "authenticated" || echo "not authenticated"