Scripto docs
View as Markdown

GET /api/auth/me

The current authenticated principal — works for a session cookie or a Bearer API key. Backs scripto whoami.

The CLI equivalent is scripto whoami.

Returns the current principal. Works for both a session cookie (web) and a Bearer scripto_ key (CLI / agents) — the user is resolved in hooks.server.ts.

Endpoint

GET https://scripto.codika.io/api/auth/me

Auth

HeaderValue
AuthorizationBearer scripto_… (or a session cookie)

Response (200)

{
  "user": {
    "id": "user_…",
    "email": "you@example.com",
    "name": "Your Name"
  }
}

For a key-authenticated request, email / name may be blank — the server synthesizes a minimal user for key auth. The CLI falls back to the cached profile email when present.

Errors

HTTPBodyCause
401{ "error": "Unauthorized" }Missing or invalid key/session.

curl

curl -sS https://scripto.codika.io/api/auth/me \
  -H "Authorization: Bearer $SCRIPTO_API_KEY"

Next