Me

The Me resource returns information about the currently authenticated identity — useful for verifying your API key, checking scopes, and discovering which organizations and projects you have access to.

Planning v2 availability. The endpoints on this page behave the same with the planning-v2 flag on or off. For reference: planning v2 is merged to main and deployed to production (platform.clockwork-co.com), and the platform flag CLOCKWORK_PLANNING_V2 is currently on globally, in production and in preview, as of 2026-10-12. Per-organization gating (CLOCKWORK_PLANNING_V2=orgs) is merged but not enabled in production, so the global flag is the only access control in effect. Exact dates: Changelog.

Methods

MethodDescription
me.get()Fetch auth context: identity, organizations, API key details

me.get()

typescript
const { data: me } = await client.me.get()
 
console.log(me.id)    // User or key ID
console.log(me.email) // Authenticated email
console.log(me.name)  // Display name
 
// API key details (only present for apiKey auth)
if (me.apiKey) {
  console.log(me.apiKey.name)   // Key name from the console
  console.log(me.apiKey.prefix) // First 8 chars (e.g., 'ck_live_')
  console.log(me.apiKey.scopes) // ['tasks:read', 'tasks:write', ...]
}
 
// Organization memberships
for (const org of me.organizations) {
  console.log(org.name, org.slug, org.role) // 'Acme Corp', 'acme', 'admin'
}

Common uses

Validate an API key at startup:

typescript
async function validateApiKey() {
  try {
    const { data: me } = await client.me.get()
    console.log(`Authenticated as ${me.email}`)
    return true
  } catch (err) {
    if (err instanceof ClockworkError && err.status === 401) {
      console.error('Invalid API key')
      return false
    }
    throw err
  }
}

Check if a scope is available before calling:

typescript
const { data: me } = await client.me.get()
const scopes = me.apiKey?.scopes ?? []
 
const canWrite = scopes.includes('*') || scopes.includes('tasks:write')
if (!canWrite) {
  throw new Error('This key does not have tasks:write scope')
}

Type reference

typescript
interface Me {
  id: string
  email: string
  name: string
  organizations: MeOrganization[]
  apiKey?: MeApiKey
}
 
interface MeOrganization {
  id: string
  name: string
  slug: string
  role: 'owner' | 'admin' | 'member'
}
 
interface MeApiKey {
  id: string
  name: string
  prefix: string
  scopes: string[]
}