Skip to main content
GET
/
api
/
users
/
profile
Get User Profile
curl --request GET \
  --url https://api.example.com/api/users/profile
{
  "id": "<string>",
  "email": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "name": "<string>",
  "image": {},
  "company": {},
  "provider": "<string>",
  "isActive": true,
  "isAdmin": true,
  "isEmailVerified": true,
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "subscription.plan": "<string>",
  "subscription.planName": "<string>",
  "subscription.status": "<string>",
  "subscription.spansUsed": 123,
  "subscription.spansLimit": 123,
  "subscription.usagePercentage": 123,
  "subscription.cancelAtPeriodEnd": true,
  "subscription.currentPeriodEnd": {},
  "subscription.features": {},
  "subscription.trialEndDate": {},
  "subscription.trialDaysRemaining": 123,
  "subscription.trialExpired": true,
  "resources.agentCount": 123,
  "resources.activeApiKeyCount": 123
}

Get User Profile

Returns a comprehensive profile for the authenticated user, including subscription plan and features, and resource counts — all in a single call.

Authentication

Requires a valid JWT Bearer token.
curl -X GET https://api.getfoil.ai/api/users/profile \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response

id
string
User ID
email
string
User email address
firstName
string
First name
lastName
string
Last name
name
string
Full display name (firstName + lastName)
image
string | null
Profile image URL
company
string | null
Company name
provider
string
Auth provider: local, google, or github
isActive
boolean
Whether the account is active
isAdmin
boolean
Whether the user has admin privileges
isEmailVerified
boolean
Whether the email address has been verified
createdAt
string
ISO 8601 account creation date
updatedAt
string
ISO 8601 last update date

subscription

Current plan, usage, and feature entitlements.
subscription.plan
string
Plan key: trial, starter, or pro
subscription.planName
string
Human-readable plan name: Free Trial, Starter, or Pro
subscription.status
string
Subscription status: trialing, active, canceled, past_due
subscription.spansUsed
number
Number of spans consumed in the current period
subscription.spansLimit
number
Maximum spans allowed in the current period
subscription.usagePercentage
number
Percentage of span limit used (0–100)
subscription.cancelAtPeriodEnd
boolean
Whether the subscription will cancel at the end of the current period
subscription.currentPeriodEnd
string | null
ISO 8601 date when the current billing period ends
subscription.features
object
Plan feature entitlements (see Features below)
subscription.trialEndDate
string | null
ISO 8601 trial end date. Only present when plan is trial.
subscription.trialDaysRemaining
number
Days remaining in trial. Only present when plan is trial.
subscription.trialExpired
boolean
Whether the trial has expired. Only present when plan is trial.

Features

The subscription.features object contains plan entitlements. Numeric values of -1 mean unlimited.
FieldTypeDescription
spansnumberMax spans per period (-1 = unlimited)
agentsnumberMax agents (-1 = unlimited)
retentionnumberData retention in days (-1 = unlimited)
alertsbooleanAlert notifications enabled
evaluationsbooleanLLM evaluations enabled
exportsbooleanData export enabled
deepSearchbooleanNatural-language ClickHouse search
semanticSearchbooleanEmbedding-based semantic search
smartSearchbooleanUnified intelligent search
customLLMLogicbooleanCustom LLM evaluation logic
modelTrainingbooleanML model training
ssobooleanSingle sign-on
rbacbooleanRole-based access control
supportstringSupport tier: community, email, or priority
trialDaysnumberLength of trial period in days

resources

Account resource counts.
resources.agentCount
number
Total number of agents
resources.activeApiKeyCount
number
Number of non-revoked API keys

Example Response

{
  "id": "664f1a2b3c4d5e6f7a8b9c0d",
  "email": "user@example.com",
  "firstName": "Jane",
  "lastName": "Doe",
  "name": "Jane Doe",
  "image": null,
  "company": null,
  "provider": "google",
  "isActive": true,
  "isAdmin": false,
  "isEmailVerified": true,
  "createdAt": "2026-01-07T10:00:00.000Z",
  "updatedAt": "2026-02-01T15:30:00.000Z",
  "subscription": {
    "plan": "trial",
    "planName": "Free Trial",
    "status": "trialing",
    "spansUsed": 0,
    "spansLimit": 10000,
    "usagePercentage": 0,
    "cancelAtPeriodEnd": false,
    "currentPeriodEnd": null,
    "features": {
      "spans": 10000,
      "agents": -1,
      "retention": -1,
      "alerts": true,
      "evaluations": true,
      "exports": true,
      "trialDays": 14,
      "deepSearch": true,
      "semanticSearch": false,
      "smartSearch": false,
      "support": "community"
    },
    "trialEndDate": "2026-02-21T00:00:00.000Z",
    "trialDaysRemaining": 14,
    "trialExpired": false
  },
  "resources": {
    "agentCount": 3,
    "activeApiKeyCount": 1
  }
}

Error Responses

StatusDescription
401Missing or invalid authentication
404User not found