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
mainand deployed to production (platform.clockwork-co.com), and the platform flagCLOCKWORK_PLANNING_V2is 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
| Method | Description |
|---|---|
me.get() | Fetch auth context: identity, organizations, API key details |
me.get()
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:
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:
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
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[]
}Related
- Authentication — API key scopes and session auth