Skip to content

Activities ​

Activity operations: copy, list, kanban, timeline, files, and field evaluation.

Endpoints ​

EndpointArgumentsReturns
v2.activities.copyunknown, Object for storing all optional modifiers for copy behaviourobject[]
v2.activities.count.linkedunknownobject
v2.activities.dependentFieldsObjectId, ObjectIdobject
v2.activities.evaluateObjectId, unknown, unknown, FunctionDependency, optionsobject
v2.activities.evaluateDependenciesunknown, unknownobject
v2.activities.eventsoptionsobject[]
v2.activities.expiredoptionsobject[]
v2.activities.filesObjectId, optionsunknown
v2.activities.kanban.listObjectId, optionsobject
v2.activities.kanban.loadObjectIdobject
v2.activities.listPhase object, Options objectobject
v2.activities.nameIsUniqueObjectId, unknownboolean
v2.activities.removeFolloweroptionsboolean
v2.activities.timelineoptionsobject
v2.activities.updatePriorityoptionsunknown

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):

FieldTypeRequiredDescription
workspaceIdWorkspaceIdnoworkspaceId (former networkId)
advancedbooleannoCheck for linked activities and create copies of those with linkage preserved Default: false.
keepEditableFunctionValuesbooleannoCopy the stored values of editable function fields as-is instead of re-evaluating them on the copy Default: false.
renameRecord<activityId, string>noactivity._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:

FieldTypeRequiredDescription
_idObjectIdyes
namestringno
copyOfActivityactivityIdnoactivityId

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.

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?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.

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

FieldTypeRequiredDescription
processesobject[]noSee below.
unauthorizednumberno

processes[] (object):

FieldTypeRequiredDescription
_idObjectIdno
namestringno
fieldsobject[]noSee below.

processes[].fields[] (object):

FieldTypeRequiredDescription
_idObjectIdno
labelstringno
typestringno
functionVariablesanyno

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.

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):

FieldTypeRequiredDescription
incomingMaxDepthintegerno
evaluateIncomingNodesbooleanno

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

FieldTypeRequiredDescription
activityobjectnoSee below.
contextanynoEvaluation context for given activity

Context that is available in the function execution sandbox | | issues | object | no | Default: {"unusedDependencies":[],"noFunctionBody":false,"hasStackedDependencies":false}. See below. | | meta | object | no | See below. | | error | string | no | | | metrics | any | no | Metrics for Function Fields Evaluation | | cost | any | no | Token Cost for Evaluation |

activity (object):

FieldTypeRequiredDescription
_idactivityIdyesactivityId
processprocessIdyesworkflowId
namestringno
nameErrorstringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
cidWorkspaceIdyesworkspaceId (former networkId)
currentPhasephaseIdyesphaseId (phase in a Workflow)
fieldsobject[]noSee below.
sequencenumberno

activity.fields[] (object):

FieldTypeRequiredDescription
idObjectIdyes
valueanyyes
typestringyesOne of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader.
errorstringno

issues (object):

FieldTypeRequiredDescription
unusedDependenciesstring[]noDefault: [].
noFunctionBodybooleannoDefault: false.
hasStackedDependenciesbooleannoDefault: false.

meta (object):

FieldTypeRequiredDescription
stablebooleannotrue if all fields could be evaluated to a stable value
fieldsRecord<string, object>noField level stability and errors. See below.
dryRunobjectnoDry-run comparison data for the requested field. See below.
errorstringno

meta.fields.* (object):

FieldTypeRequiredDescription
stablebooleanno
errorstringno

meta.dryRun (object):

FieldTypeRequiredDescription
fieldIdObjectId | nameyes
editablebooleanyes
currentValueanyno
evaluatedValueanyno
evaluatedbooleanyes

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.

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

FieldTypeRequiredDescription
nodesobject[]noSee below.
edgesobject[]noSee below.

nodes[] (object):

FieldTypeRequiredDescription
idstringno
labelstringno
parentstringno
classesstring[]no

edges[] (object):

FieldTypeRequiredDescription
idstringno
sourcestringno
targetstringno

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.

v2.activities.events ​

Description

Undocumented

This endpoint has no description in the source yet.

Parameters

Argument 1 (object, required):

FieldTypeRequiredDescription
datesobjectyesSee below.
filterobjectnoOptional filtering See below.

dates (object):

FieldTypeRequiredDescription
starttimestampyesStart Date as iso date string or timestamp
endtimestampyesEnd Date as iso date string or timestamp

filter (object):

FieldTypeRequiredDescription
userObjectId[]noUser IDs
fieldObjectId[]noDate field IDs
hideUnassignedbooleannoHide unassigned

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:

FieldTypeRequiredDescription
idstringyesEvent id based on activity id and field id
titlestringyesActivity name
extendedPropsobjectyesActivity meta data See below.
starttimestampyesStart timestamp
endtimestamp | anyyesEnd timestamp. Will be false on single all day event.
allDaybooleanyesAll day event

extendedProps (object):

FieldTypeRequiredDescription
activity_idObjectIdyesActivity id
createdtimestampyesActivity creation date
updatedtimestampyesActivity modification date
completedtimestampnoActivity completion date
phaseobjectyesPhase Meta See below.
processobjectyesProcess Meta See below.
fieldobjectyesField Meta See below.

extendedProps.phase (object):

FieldTypeRequiredDescription
_idObjectIdyesPhase id
namestringyesPhase name
isEndpointbooleannoIs Phase endpoint

extendedProps.process (object):

FieldTypeRequiredDescription
_idObjectIdyesProcess id
namestringyesProcess name

extendedProps.field (object):

FieldTypeRequiredDescription
_idObjectIdyesField id
labelstringyesField label
typedate | time | daterange | timerange | datetime | datetimerangeyesField type

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.

v2.activities.expired ​

Description

Undocumented

This endpoint has no description in the source yet.

Parameters

Argument 1 (object, required):

FieldTypeRequiredDescription
processesObjectId[]yesProcesses to look for overdue activities.
phasesObjectId[]noPhases 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:

FieldTypeRequiredDescription
_idObjectIdyes
namestringyes
processobjectnoSee below.
phaseobjectnoSee below.
isFollowedbooleanno
discussionObjectIdno
fieldobjectnoSee below.
daysOverdueintegerno

process (object):

FieldTypeRequiredDescription
_idObjectIdno
namestringno

phase (object):

FieldTypeRequiredDescription
_idObjectIdno
namestringno

field (object):

FieldTypeRequiredDescription
idObjectIdno
valuetimestamp | objectno
typestringno
labelstringno

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.

v2.activities.files ​

Description

Undocumented

This endpoint has no description in the source yet.

Parameters

Argument 1 (ObjectId, required):

Argument 2 (object, optional):

FieldTypeRequiredDescription
limitnumberno
skipnumberno
searchstringno

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?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.

v2.activities.kanban.list ​

Description

Undocumented

This endpoint has no description in the source yet.

Parameters

Argument 1 (ObjectId, required):

Argument 2 (object, optional):

FieldTypeRequiredDescription
filterobjectnoSee below.
searchstringnoDefault: null.
limitintegernoDefault: 20.
skipintegernoDefault: 0.
phaseObjectIdnoLimits query to one phase only.
includeUsersbooleannoInclude available user & field list. Default true Default: true.
includeTeamsbooleannoIncludes available team & account list. Default true. Default: true.

filter (object):

FieldTypeRequiredDescription
userobjectnoSee below.
accountObjectIdno
teamObjectIdno
datesobjectnoSee below.
ballHolderuserIdnoFilter by ball holder userId

filter.user (object):

FieldTypeRequiredDescription
uidObjectIdyes
fieldObjectIdyes

filter.dates (object):

FieldTypeRequiredDescription
fieldObjectIdyes
starttimestampyesTime (milliseconds since 1970-01-01 UTC)
endtimestampyesTime (milliseconds since 1970-01-01 UTC)

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

FieldTypeRequiredDescription
mapRecord<string, object>noThe 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
  }
}
``` See below. |
| `meta` | object | no | See below. |

**`map.*`** (object):

| Field | Type | Required | Description |
|---|---|---|---|
| `activities` | object[] | no | See below. |
| `meta` | object | no | See below. |

**`map.*.activities[]`** (object):

| Field | Type | Required | Description |
|---|---|---|---|
| `_id` | ObjectId | yes |  |
| `followers` | ObjectId[] | no |  |
| `name` | string | no |  |
| `fields` | Record<string, object> | no | Fields of activity, format of items is dependent on the configuration of the process given in `process` field. See below. |
| `files` | ObjectId[] | no |  |
| `primaryDateField` | date | no | Date (Time 00:00:00.000 of day starting milliseconds since 1970-01-01 UTC) |
| `priority` | number | no |  |
| `linkedFromCount` | number | no |  |
| `ballHolder` | object | no | See below. |
| `discussion` | discussionId | no | discussionId |

**`map.*.activities[].fields.*`** (object):

| Field | Type | Required | Description |
|---|---|---|---|
| `type` | string | yes | One of: `activitylink`, `country`, `date`, `daterange`, `datetime`, `datetimerange`, `numeric`, `numericunit`, `teams`, `text`, `textarea`, `textunit`, `textpredefinedoptions`, `time`, `timerange`, `users`, `linkedfrom`, `subheader`. |
| `value` | any | no |  |

**`map.*.activities[].ballHolder`** (object):

| Field | Type | Required | Description |
|---|---|---|---|
| `userId` | ObjectId | yes |  |
| `assignedAt` | timestamp | yes | Time (milliseconds since 1970-01-01 UTC) |
| `assignedBy` | ObjectId | yes |  |

**`map.*.meta`** (object):

| Field | Type | Required | Description |
|---|---|---|---|
| `_id` | string | no |  |
| `count` | number | yes |  |
| `totalPrimaryNumericValue` | number | no |  |
| `primaryNumericFieldUnit` | string | no |  |

**`meta`** (object):

| Field | Type | Required | Description |
|---|---|---|---|
| `users` | Record<string, ObjectId[]> | no | `[fieldId string]: userId[]` |
| `teams` | Record<string, ObjectId[]> | no | `[teamId: string]: accountId[]` |

**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.

## `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

FieldTypeRequiredDescription
activityobjectnoSee below.
processprocessIdnoworkflowId
phasephaseIdnophaseId (phase in a Workflow)

activity (object):

FieldTypeRequiredDescription
_idObjectIdyes
followersObjectId[]no
namestringno
fieldsRecord<string, object>noFields of activity, format of items is dependent on the configuration of the process given in process field. See below.
filesObjectId[]no
primaryDateFielddatenoDate (Time 00:00:00.000 of day starting milliseconds since 1970-01-01 UTC)
prioritynumberno
linkedFromCountnumberno
ballHolderobjectnoSee below.
discussiondiscussionIdnodiscussionId

activity.fields.* (object):

FieldTypeRequiredDescription
typestringyesOne of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader.
valueanyno

activity.ballHolder (object):

FieldTypeRequiredDescription
userIdObjectIdyes
assignedAttimestampyesTime (milliseconds since 1970-01-01 UTC)
assignedByObjectIdyes

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.

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):

FieldTypeRequiredDescription
processprocessIdnoworkflowId
phasephaseIdyesphaseId (phase in a Workflow)

Argument 2 (Options object, optional):

FieldTypeRequiredDescription
sortByname | created | updated | following | owner | team | completedOn | priority | sequence | ObjectIdnoDefault: "updated".
sortOrderasc | descno"asc" for ascending and "desc" for descending order Default: "desc".
filterobjectnoSee below.
searchstringno
limitintegernoLimit the maximum number of results Default: 20.
skipintegernoSkip the number of the first results. Default: 0 Default: 0.
includeUsersbooleannoIncludes available users & fields list in the "metadata" object Default: true.
includeTeamsbooleannoIncludes available teams & accounts list in the "metadata" object Default: true.
includeHistorybooleannoIncludes "history" array of objects with all versions of the activity Default: false.

filter (object):

FieldTypeRequiredDescription
userobjectnoSee below.
accountObjectIdnoaccountId
teamteamIdnoteamId
datesobjectnoSee below.
ballHolderuserIdnoFilter by ball holder userId

filter.user (object):

FieldTypeRequiredDescription
uiduserIdyesuserId
fieldfieldIdyesfieldId

filter.dates (object):

FieldTypeRequiredDescription
starttimestampyesTime (milliseconds since 1970-01-01 UTC)
endtimestampyesTime (milliseconds since 1970-01-01 UTC)

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

FieldTypeRequiredDescription
activitiesobject[]noSee below.
metadataobjectnoSee below.

activities[] (object):

FieldTypeRequiredDescription
_idObjectIdyesThe _id of the activity
processprocessIdyesworkflowId
followersObjectId[]nouserId(s) invited to the activity discussion
team_accountobjectyesSee below.
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
uiduserIdyesuserId
currentPhasephaseIdyesphaseId (phase in a Workflow)
discussiondiscussionIdyesdiscussionId
fieldsRecord<string, object>noFields of the activity. The format of the items is dependent on the configuration of the process given in process field. See below.
historyanynoAll versions of the activity
filesfileId[]no
priorityintegerno
activebooleannoActivity not in endpoint phase is considered active
locationobjectnoSee below.
sequenceintegerno
ballHolderobjectnoSee below.

activities[].team_account (object):

FieldTypeRequiredDescription
accountObjectIdyesaccountId
teamObjectIdyesteamId

activities[].fields.* (object):

FieldTypeRequiredDescription
typestringyesOne of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader.
valueanyno

activities[].location (object):

FieldTypeRequiredDescription
typepoint | area | polylineno
labelstringno
dataobject[]noSee below.

activities[].location.data[] (object):

FieldTypeRequiredDescription
latnumbernoLatitude
lngnumbernoLongitude

activities[].ballHolder (object):

FieldTypeRequiredDescription
userIdObjectIdyes
assignedAttimestampyesTime (milliseconds since 1970-01-01 UTC)
assignedByObjectIdyes

metadata (object):

FieldTypeRequiredDescription
activityLinksRecord<string, number>no[activity string]: number
totalCountintegeryesTotal number of activities in the phase
usersRecord<string, ObjectId[]>nofieldIds as keys and userIds as values
teamsRecord<string, ObjectId[]>noteamIds as keys and accountIds as values
datesobjectnoSee below.
totalPrimaryNumericValuenumberno
behindScheduleintegernoThe number of activities that are due now compared to Primary Date Value
lessThanOneWeekintegernoThe number of activities that are due in less than one week compared to Primary Date Value
onScheduleintegernoThe number of activities that are due in more than one week compared to Primary Date Value
behindScheduleValuenumberno
lessThanOneWeekValuenumberno
onScheduleValuenumberno
primaryNumericFieldUnitstringno

metadata.dates (object):

FieldTypeRequiredDescription
starttimestampnoTime (milliseconds since 1970-01-01 UTC)
endtimestampnoTime (milliseconds since 1970-01-01 UTC)

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.

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?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.

v2.activities.removeFollower ​

Description

Undocumented

This endpoint has no description in the source yet.

Parameters

Argument 1 (object, required):

FieldTypeRequiredDescription
activityIdObjectIdyesactivityId of the activity user needs to be removed from
userIdObjectIdyesuserId 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?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.

v2.activities.timeline ​

Description

Undocumented

This endpoint has no description in the source yet.

Parameters

Argument 1 (object, required):

FieldTypeRequiredDescription
dateFieldIdObjectIdyes
datesobjectyesSee below.
groupByFieldIdObjectId | name | team_accountnoField to group results by
phaseIdsObjectId[]yes
processIdObjectIdyes
resourceIdsObjectId[]no
searchstringno
showEmptyResourcesbooleanno
teamAccountObjectIdno
userobjectnoSee below.

dates (object):

FieldTypeRequiredDescription
startdateyesDate (Time 00:00:00.000 of day starting milliseconds since 1970-01-01 UTC)
enddateyesDate (Time 00:00:00.000 of day starting milliseconds since 1970-01-01 UTC)

user (object):

FieldTypeRequiredDescription
uidObjectIdyes
fieldObjectIdyes

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

FieldTypeRequiredDescription
activitiesobject[]noSee below.
metadataobjectnoSee below.

activities[] (object):

FieldTypeRequiredDescription
activebooleanyes
allDaybooleanyes
endtimestamp | booleanno
fieldsobject[]noSee below.
idObjectIdno
currentPhasephaseIdnophaseId (phase in a Workflow)
resourceIdstringno
starttimestampyesTime (milliseconds since 1970-01-01 UTC)
titlestringno
ballHolderobjectnoSee below.
discussionObjectIdno

activities[].fields[] (object):

FieldTypeRequiredDescription
idObjectIdyes
typestringyesOne of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader.
valueanyno
errorstringno

activities[].ballHolder (object):

FieldTypeRequiredDescription
userIdObjectIdyes
assignedAttimestampyesTime (milliseconds since 1970-01-01 UTC)
assignedByObjectIdyes

metadata (object):

FieldTypeRequiredDescription
activityLinksobjectno
totalCountnumberyes
usersRecord<string, ObjectId[]>no[fieldId string]: userId[]
teamsRecord<string, ObjectId[]>no[teamId: string]: accountId[]
datesobjectnoSee below.
totalPrimaryNumericValuenumberno
behindSchedulenumberno
lessThanOneWeeknumberno
onSchedulenumberno
behindScheduleValuenumberno
lessThanOneWeekValuenumberno
onScheduleValuenumberno
primaryNumericFieldUnitstringno
resourceGroupFieldObjectId | name | team_accountno
resourcesobject[]noSee below.

metadata.dates (object):

FieldTypeRequiredDescription
startstring | numberno
endstring | numberno

metadata.resources[] (object):

FieldTypeRequiredDescription
idname | team_account | ObjectIdyes
titlestringyes

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.

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):

FieldTypeRequiredDescription
activityIdObjectIdyesactivityId of changed activity
prioritynumberyesNew 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?, retryAfter?, debug? }. retryAfter is a delay in milliseconds.

Hailer Developer Documentation · v1.8.0