Skip to main content

GET /api/v1/me

Returns who you are, your onboarding state and the live document quota for a workspace. Agents call it to check that a key works.

Auth​

API key or session.

Request​

curl "https://api.opendocs.cc/api/v1/me?workspaceId=ws_123" \
-H "Authorization: Bearer od_live_xxxxx"
QueryRequiredNotes
workspaceIdnoCompute quota.documents for this workspace. If you aren't an active member of it, quota.documents is null. Without it, the quota is for the workspace shown in onboarding.workspace.

If you belong to more than one workspace, pass workspaceId so the quota matches the workspace you're about to publish to. The quota is advisory: POST /publish and POST /publish/batch check the cap again themselves.

Response​

{
"authenticated": true,
"userId": "usr_123",
"onboarding": {
"hasUsername": true,
"hasWorkspace": true,
"username": "dana",
"workspace": {
"id": "ws_123",
"name": "Halvard",
"slug": "halvard",
"defaultVisibility": "workspace",
"defaultProject": {
"id": "proj_123",
"workspaceId": "ws_123",
"name": "Default",
"slug": "default",
"isDefault": true
}
},
"completed": true
},
"quota": {
"documents": {
"plan": "free",
"limit": 50,
"used": 12,
"remaining": 38
}
}
}

Fields​

onboarding​

  • hasUsername, hasWorkspace, completed: completed is true once you have both a username and a workspace.
  • username: your profile handle.
  • workspace: your earliest-joined active workspace, or null. It's the same one the CLI picks at login. If you belong to several, pass workspaceId for anything workspace-specific. workspace.slug is the first segment of document URLs: opendocs.cc/<workspace.slug>/<post-slug>. List every workspace with GET /api/v1/workspaces.
  • workspace.defaultVisibility: private, workspace or public.
  • workspace.defaultProject: the project documents go to when you don't name one.

quota.documents​

FieldTypeDescription
plan"free" | "pro" | "team"The workspace's effective plan (its owner's plan)
limitnumber or nullPublished documents allowed. null means unlimited (Pro and Team)
usednumberPublished documents in the workspace. Unpublished ones don't count
remainingnumber or nulllimit - used, never below 0. null means unlimited

quota.documents is null when you have no workspace yet, or when you passed a workspaceId you aren't a member of.

How the CLI uses it​

During login and before a batch publish the CLI calls /me to confirm the key, find the username and workspace, and compare the batch size against quota.documents.remaining so it can stop before sending a batch that would be rejected.

Errors​

StatuserrorWhen
401unauthorizedMissing, invalid or revoked key