Appearance
Core
Core API for managing users, networks, teams, groups, accounts, processes, calendars, tags, and apps.
Endpoints
| Endpoint | Arguments | Returns |
|---|---|---|
v2.core.init | sections?: string[], opts?: { timestamp?: { users?: number, networks?: number, processes?: number, teams?: number } } | unknown |
v2.core.init
Description
Loads the initial state for the current user: own user, visible users, current and all workspaces, teams, accounts, groups, processes, tags and apps.
The first argument selects which sections to load. When omitted, all sections are loaded. An empty list returns only { timestamp: {} }.
accounts is loaded together with teams, so selecting either runs the same query.
The second argument can pass timestamp per section (users, networks, processes, teams) to only return items modified after that time. The response timestamp holds the latest modified time of each of these sections, to use in the next call.
Parameters
Argument 1 (string[], optional): Sections to load, all when omitted
Argument 2 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
timestamp | Record<users | networks | processes | teams, timestamp> | no | Modified timestamp to only include new or modified items |
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v2.core.init', [
['user'],
{
timestamp: {
'507f1f77bcf86cd799439012': Date.now(), // fieldId: value
}, // Modified timestamp to only include new or modified items
},
]);
console.log(result);Returns
Undocumented
The return value is not described in the source yet.
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.