Appearance
Activities
Activity operations: copy, list, kanban, timeline, files, and field evaluation.
Endpoints
| Endpoint | Arguments | Returns |
|---|---|---|
v2.activities.copy | unknown, Object for storing all optional modifiers for copy behaviour | object[] |
v2.activities.count.linked | unknown | object |
v2.activities.dependentFields | ObjectId, ObjectId | object |
v2.activities.evaluate | ObjectId, unknown, unknown, FunctionDependency, options | object |
v2.activities.evaluateDependencies | unknown, unknown | object |
v2.activities.events | options | object[] |
v2.activities.expired | options | object[] |
v2.activities.files | ObjectId, options | unknown |
v2.activities.kanban.list | ObjectId, options | object |
v2.activities.kanban.load | ObjectId | object |
v2.activities.list | Phase object, Options object | object |
v2.activities.nameIsUnique | ObjectId, unknown | boolean |
v2.activities.removeFollower | options | boolean |
v2.activities.timeline | options | object |
v2.activities.updatePriority | options | unknown |
v2.activities.copy
Description
Creates copies of activities provided in an array. The resulting activities will all be called 'Copy of ...' unless otherwise specified in the rename object within the second parameter. The values in any given field will be kept for all fields used in the initial phase of the workflow.
Example: If supplied the correct activityId for foo, the result will be named Copy of foo. If the rename object was {fooId: 'New Name'} then the result would be New Name.
Parameters
Argument 1 (ObjectId[], required): One or many activityIds to copy
Argument 2 (Object for storing all optional modifiers for copy behaviour, optional):
| Field | Type | Required | Description |
|---|---|---|---|
workspaceId | WorkspaceId | no | workspaceId (former networkId) |
advanced | boolean | no | Check for linked activities and create copies of those with linkage preserved Default: false. |
rename | Record<activityId, string> | no | activity._id: "newName" Default: null. |
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.activities.copy', [
['507f1f77bcf86cd799439011'],
{
workspaceId: '507f1f77bcf86cd799439011', // workspaceId (former networkId)
advanced: false, // Check for linked activities and create copies of those with linkage preserved
},
]);
console.log(result);Returns
Array of objects:
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | |
name | string | no | |
copyOfActivity | activityId | no | activityId |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.count.linked
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (ObjectId[], required): ActivityIds you want a linked count for
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.activities.count.linked', [
['507f1f77bcf86cd799439011'],
]);
console.log(result);Returns
Record<string, number>
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.dependentFields
Description
Get dependendent fields of the given fieldId
Parameters
Argument 1 (ObjectId, required): processId
Argument 2 (ObjectId, required): fieldId
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.activities.dependentFields', [
'507f1f77bcf86cd799439011', // ObjectId (required)
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
processes | object[] | no | |
unauthorized | number | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.evaluate
Description
Dryrun Function Field function
Evaluation of Function Field function on a given activity and field without saving the result, only returning it.
Parameters
Argument 1 (ObjectId, required): activityId
Argument 2 (ObjectId \| name``, required): fieldId
Argument 3 (string, required): code
Argument 4 (FunctionDependency, Record<string, object | object[]>, optional):
Argument 5 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
incomingMaxDepth | integer | no | |
evaluateIncomingNodes | boolean | no |
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.activities.evaluate', [
'507f1f77bcf86cd799439011', // ObjectId (required)
'507f1f77bcf86cd799439011', // fieldId (required)
'string', // code (required)
{
'507f1f77bcf86cd799439012': {
type: '<',
data: ['string'],
}, // fieldId: value
},
{
incomingMaxDepth: 0,
evaluateIncomingNodes: false,
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
activity | object | no | |
context | any | no | Evaluation context for given activity |
Context that is available in the function execution sandbox | | issues | object | no | Default: {"unusedDependencies":[],"noFunctionBody":false,"hasStackedDependencies":false}. | | meta | object | no | | | error | string | no | | | metrics | any | no | Metrics for Function Fields Evaluation | | cost | any | no | Token Cost for Evaluation |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.evaluateDependencies
Description
Get dependency graph to the field
Parameters
Argument 1 (ObjectId[], required): activityIds
Argument 2 (ObjectId[], required): fieldIds
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.activities.evaluateDependencies', [
['507f1f77bcf86cd799439011'],
['507f1f77bcf86cd799439011'],
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
nodes | object[] | no | |
edges | object[] | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.events
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (object, required):
| Field | Type | Required | Description |
|---|---|---|---|
dates | object | yes | |
filter | object | no | Optional filtering |
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.activities.events', [
{
dates: {
start: Date.now(), // Start Date as iso date string or timestamp
end: Date.now(), // End Date as iso date string or timestamp
},
},
]);
console.log(result);Returns
Array of objects:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Event id based on activity id and field id |
title | string | yes | Activity name |
extendedProps | object | yes | Activity meta data |
start | timestamp | yes | Start timestamp |
end | timestamp | any | yes | End timestamp. Will be false on single all day event. |
allDay | boolean | yes | All day event |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.expired
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (object, required):
| Field | Type | Required | Description |
|---|---|---|---|
processes | ObjectId[] | yes | Processes to look for overdue activities. |
phases | ObjectId[] | no | Phases to look in for overdue activities. |
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.activities.expired', [
{
processes: ['507f1f77bcf86cd799439011'], // Processes to look for overdue activities.
},
]);
console.log(result);Returns
Array of objects:
| Field | Type | Required | Description |
|---|---|---|---|
_id | ObjectId | yes | |
name | string | yes | |
process | object | no | |
phase | object | no | |
isFollowed | boolean | no | |
discussion | ObjectId | no | |
field | object | no | |
daysOverdue | integer | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.files
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (ObjectId, required):
Argument 2 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
limit | number | no | |
skip | number | no | |
search | string | no |
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.activities.files', [
'507f1f77bcf86cd799439011', // ObjectId (required)
{
limit: 0,
skip: 0,
},
]);
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?, debug? }.
v2.activities.kanban.list
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (ObjectId, required):
Argument 2 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
filter | object | no | |
search | string | no | Default: null. |
limit | integer | no | Default: 20. |
skip | integer | no | Default: 0. |
phase | ObjectId | no | Limits query to one phase only. |
includeUsers | boolean | no | Include available user & field list. Default true Default: true. |
includeTeams | boolean | no | Includes available team & account list. Default true. Default: true. |
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.activities.kanban.list', [
'507f1f77bcf86cd799439011', // ObjectId (required)
{
filter: {
user: { /* ... */ },
account: '507f1f77bcf86cd799439011',
},
search: 'string',
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
map | Record<string, object> | no | The map contains phases grouped by phaseId containing activities and meta for phase |
typescript
map: { [phaseId: string]: {
activities: {
_id: validObjectId.required(),
followers: Joi.array().items(Joi.string().hex().length(24)),
name: Joi.string(),
fields: ,
files: Joi.array().items(validObjectId),
primaryDateField: JoiDate,
priority: Joi.number(),
}[]
meta: {
count: number,
totalPrimaryNumericValue: number,
primaryNumericFieldUnit: string \| null
}
}
``` |
| `meta` | object | no | |
**Auth:** requires an authenticated session.
**Errors:** on failure returns the standard Hailer error object `{ code, msg, details?, debug? }`.
## `v2.activities.kanban.load`
**Description**
::: warning Undocumented
This endpoint has no description in the source yet.
:::
**Parameters**
**Argument 1 (`ObjectId`, required):** Activity id
**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.activities.kanban.load', [
'507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
activity | object | no | |
process | processId | no | workflowId |
phase | phaseId | no | phaseId (phase in a Workflow) |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.list
Description
With this function, you can get the activities of one workflow and phase (or of one dataset and category) listed by calling the function with workflowId (optional) and phaseId (required) in the Phase object. The successful response will be "activities" array of activity objects and a "metadata" object.
You can sort and filter the list of activities with the Options object. The successful response has up to 20 activities sorted by the latest update time and date in descending order by default. All options for sorting and filtering are listed in the request body schema below.
Parameters
Argument 1 (Phase object, required):
| Field | Type | Required | Description |
|---|---|---|---|
process | processId | no | workflowId |
phase | phaseId | yes | phaseId (phase in a Workflow) |
Argument 2 (Options object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
sortBy | name | created | updated | following | owner | team | completedOn | priority | sequence | ObjectId | no | Default: "updated". |
sortOrder | asc | desc | no | "asc" for ascending and "desc" for descending order Default: "desc". |
filter | object | no | |
search | string | no | |
limit | integer | no | Limit the maximum number of results Default: 20. |
skip | integer | no | Skip the number of the first results. Default: 0 Default: 0. |
includeUsers | boolean | no | Includes available users & fields list in the "metadata" object Default: true. |
includeTeams | boolean | no | Includes available teams & accounts list in the "metadata" object Default: true. |
includeHistory | boolean | no | Includes "history" array of objects with all versions of the activity Default: false. |
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.activities.list', [
{
phase: '507f1f77bcf86cd799439011', // phaseId (phase in a Workflow)
},
{
sortBy: 'name',
sortOrder: 'asc', // "asc" for ascending and "desc" for descending order
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
activities | object[] | no | |
metadata | object | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.nameIsUnique
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (ObjectId, required): Process ID
Argument 2 (string, required): Activity name to check
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.activities.nameIsUnique', [
'507f1f77bcf86cd799439011', // ObjectId (required)
'string', // Activity name to check (required)
]);
console.log(result);Returns
boolean
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.removeFollower
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (object, required):
| Field | Type | Required | Description |
|---|---|---|---|
activityId | ObjectId | yes | activityId of the activity user needs to be removed from |
userId | ObjectId | yes | userId of the to be removed user |
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.activities.removeFollower', [
{
activityId: '507f1f77bcf86cd799439011', // activityId of the activity user needs to be removed from
userId: '507f1f77bcf86cd799439011', // userId of the to be removed user
},
]);
console.log(result);Returns
boolean
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.timeline
Description
Undocumented
This endpoint has no description in the source yet.
Parameters
Argument 1 (object, required):
| Field | Type | Required | Description |
|---|---|---|---|
dateFieldId | ObjectId | yes | |
dates | object | yes | |
groupByFieldId | ObjectId | name | team_account | no | Field to group results by |
phaseIds | ObjectId[] | yes | |
processId | ObjectId | yes | |
resourceIds | ObjectId[] | no | |
search | string | no | |
showEmptyResources | boolean | no | |
teamAccount | ObjectId | no | |
user | object | no |
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.activities.timeline', [
{
dateFieldId: '507f1f77bcf86cd799439011',
dates: {
start: Date.now(), // Date (Time 00:00:00.000 of day starting milliseconds since 1970-01-01 UTC)
end: Date.now(), // Date (Time 00:00:00.000 of day starting milliseconds since 1970-01-01 UTC)
},
phaseIds: ['507f1f77bcf86cd799439011'],
processId: '507f1f77bcf86cd799439011',
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
activities | object[] | no | |
metadata | object | no |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v2.activities.updatePriority
Description
Update one or many priority fields in a phase.Ex: change position for activity in Kanban view.Function only used when change position for an activity in same phase
Parameters
Argument 1 (object, required):
| Field | Type | Required | Description |
|---|---|---|---|
activityId | ObjectId | yes | activityId of changed activity |
priority | number | yes | New priority number for changed activity |
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.activities.updatePriority', [
{
activityId: '507f1f77bcf86cd799439011', // activityId of changed activity
priority: 0, // New priority number for changed activity
},
]);
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?, debug? }.