List users
Returns all users in the workspace including roles and profile access. Also returns the currentUserId of the caller.
API key authentication - use your Zernio API key as a Bearer token
In: header
Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.users.listUsers();console.log(data);{
"currentUserId": "6507a1b2c3d4e5f6a7b8c9d0",
"users": [
{
"_id": "6507a1b2c3d4e5f6a7b8c9d0",
"name": "John Doe",
"email": "john@example.com",
"role": "owner",
"isRoot": true,
"profileAccess": [
"all"
],
"createdAt": "2024-01-15T10:30:00Z",
"lastLoginAt": "2024-06-02T09:12:00Z"
},
{
"_id": "6507a1b2c3d4e5f6a7b8c9d1",
"name": "Jane Smith",
"email": "jane@example.com",
"role": "member",
"isRoot": false,
"profileAccess": [
"64f0a1b2c3d4e5f6a7b8c9d0",
"64f0a1b2c3d4e5f6a7b8c9d1"
],
"createdAt": "2024-03-20T14:45:00Z",
"lastLoginAt": "2024-05-28T16:03:00Z"
}
]
}{
"error": "Unauthorized"
}Revoke connected app DELETE
Ends an app's access: invalidates the client's pending authorization codes and revokes every live token it holds for the authenticated user. Takes effect on the app's next request. Idempotent while the authorization is still on record: revoking an app that was already revoked returns 200 with `revokedTokens: 0`. Requires a session or a full-access API key. A profile-scoped API key, a restricted (zrk_) API key, or an OAuth access token is rejected with 403.
Get user GET
Returns a single user's details by ID, including name, email, and role.