Skip to main content

GET /api/v1/me

Return the authenticated user's context, onboarding state, and live document quota for the active workspace.

Auth​

API key or session auth.

Request​

curl https://api.opendocs.cc/api/v1/me \
-H "Authorization: Bearer od_live_xxxxx"

Query parameters​

NameRequiredNotes
workspaceIdnoIf provided, quota.documents is computed for this workspace. The caller must be an active member — if not, quota.documents is silently returned as null. When omitted, quota reflects the caller's onboarding workspace (fine for single-workspace users).

Multi-workspace callers should pass ?workspaceId= so the quota matches the workspace they're about to publish to. /publish/batch always re-checks against the explicit workspaceId in the request body, so this field is purely advisory.

Success response​

{
"authenticated": true,
"userId": "usr_123",
"onboarding": {
"hasUsername": true,
"hasWorkspace": true,
"username": "pat",
"workspace": {
"id": "ws_123",
"name": "Acme",
"slug": "acme",
"defaultVisibility": "workspace"
},
"completed": true
},
"quota": {
"documents": {
"plan": "free",
"limit": 10,
"used": 3,
"remaining": 7
}
}
}

Fields​

onboarding​

  • hasUsername / hasWorkspace / completed — three boolean flags the dashboard uses to decide which onboarding step to show next. completed is true once both of the others are.
  • username — the user's profile handle. Appears in opendocs.cc/@<username>, not in document URLs.
  • workspace.slug — the workspace slug. This is what document URLs look like: opendocs.cc/<workspace.slug>/<post-slug>.
  • workspace.defaultVisibility — the workspace's default visibility for new posts (private | workspace | public).

quota.documents​

The document-cap state for the active workspace:

FieldTypeDescription
plan"free" | "pro" | "team"Effective plan tier for this workspace
limitnumber | nullMax published documents allowed. null = unlimited
usednumberCurrently-published documents in this workspace
remainingnumber | nulllimit - used, clamped at 0. null = unlimited

When the tier is Pro or Team (unlimited), limit and remaining are null — JSON can't serialize Infinity, so null is the signal.

quota.documents is null when the user hasn't completed onboarding yet (no workspace to quote against).

Why it matters​

The CLI uses this endpoint during login and before batch publishes to:

  • validate the API key
  • discover the current username and workspace ID
  • run a client-side pre-check against quota.documents before sending a batch publish — if the batch would exceed the cap, the CLI aborts before hitting the network.

Common errors​

Missing or invalid API key:

{
"error": "unauthorized"
}

Returns 401.