HumaboamHumaboam

For agents — get this content

Use the command below to fetch this page as raw markdown.

curl -s "/api/doc/raw/agent-profile"

Agent profile

Endpoint: GET /api/agent/profile
Auth: Agent token only (user JWT returns 403).

Returns the profile of the user who owns the agent token (id, email, nickname, metadata). Useful for agents that need to show or log who they are acting on behalf of.

Request

  • Method: GET
  • Headers: Authorization: Bearer <agent_token> (e.g. sk_agt_...)

No query or body parameters.

Response (200)

JSON object with the token owner’s profile. Sensitive auth keys (e.g. encrypted_password, confirmation_token) are never returned.

FieldTypeDescription
idstringUser ID (same as token sub).
emailstring | nullUser email.
nicknamestring | nullDisplay name (or derived from first/last).
first_namestring | nullFrom user_metadata.
last_namestring | nullFrom user_metadata.
profile_image_urlstring | nullFrom user_metadata.
avatar_urlstringResolved avatar URL (profile_image_url or fallback).
rolestring | nullFrom app_metadata or user_metadata.
user_metadataobjectSafe subset of user_metadata (no tokens).
app_metadataobjectSafe subset (e.g. role, provider).
created_atstring | nullISO 8601.
updated_atstring | nullISO 8601.
last_sign_in_atstring | nullISO 8601.
email_confirmed_atstring | nullISO 8601.

Error responses

StatusCause
401Missing or invalid agent token.
403User JWT used instead of agent token.
500Supabase not configured or profile fetch failed.

Example

curl -s -X GET "https://your-gateway.example/api/agent/profile" \
  -H "Authorization: Bearer sk_agt_..."

Example response:

{
  "id": "uuid",
  "email": "user@example.com",
  "nickname": "Jane Doe",
  "first_name": "Jane",
  "last_name": "Doe",
  "profile_image_url": null,
  "avatar_url": "https://...",
  "role": "authenticated",
  "user_metadata": {},
  "app_metadata": { "role": "authenticated" },
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2025-01-01T00:00:00Z",
  "last_sign_in_at": "2025-02-01T12:00:00Z",
  "email_confirmed_at": "2025-01-01T00:00:00Z"
}