Skip to content

Activities ​

Original activity endpoints: create, update, load, search, follow, linked activities, and phase counts.

Endpoints ​

EndpointArgumentsReturns
activities.add_followersactivityId, unknownunknown
activities.create-unknown
activities.filesObjectIdany[]
activities.followObjectIdboolean
activities.linked_fromObjectIdactivityId[]
activities.linked_from_extendedObjectIdobject[]
activities.loadObjectIdobject
activities.phase_countprocessIdunknown
activities.removeunknownobject
activities.searchunknown, unknown, optionsobject[]
activities.set_updateoptionsobject
activities.updateoptionsobject

activities.add_followers ​

Description

Undocumented

This endpoint has no description in the source yet.

Parameters

Argument 1 (activityId, required): activityId

Argument 2 (userId[], required):

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('activities.add_followers', [
  '507f1f77bcf86cd799439011', // activityId (required)
  ['507f1f77bcf86cd799439011'],
]);
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.

activities.create ​

Description

This function will create an activity if given the appropriate parameter object. We strongly recommend you use v3.activity.create or v3.activity.createMany.

Parameters

Undocumented

This endpoint declares no argument schema in the source yet.

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('activities.create', []);
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.

activities.files ​

Description

If provided with a valid activityId that the user has access to, it will list filesIds for all files attached to that activity.

Parameters

Argument 1 (ObjectId, required): A valid activityId

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('activities.files', [
  '507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);

Returns

Array of any.

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.

activities.follow ​

Description

Toggles follow state

Parameters

Argument 1 (ObjectId, required):

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('activities.follow', [
  '507f1f77bcf86cd799439011', // ObjectId (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.

activities.linked_from ​

Description

When provided a valid activityId which the user has permissions to view, it will return an array containing activityIds for activities which link to the original activity.

If no such activities exist, it will return an empty array.

Parameters

Argument 1 (ObjectId, required):

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('activities.linked_from', [
  '507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);

Returns

Array of activityId.

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.

activities.linked_from_extended ​

Description

Much like linked_from this function takes in a valid activityId and returns all activities linked to it, in their full form. This means that the results are not just an array of other activityIds but rather an array containing Activity Objects with field information and content.

Parameters

Argument 1 (ObjectId, required):

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('activities.linked_from_extended', [
  '507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);

Returns

Array of objects:

FieldTypeRequiredDescription
_idactivityIdyesactivityId
namestringno
processNamestringno
processIdprocessIdyesworkflowId
processprocessIdyesworkflowId
phaseIdphaseIdyesphaseId (phase in a Workflow)
phaseNamestringno
primaryNumericFieldnumberno
primaryDateFieldnumberno
fieldsobject[]noSee below.
prioritynumberno
processFieldsRecord<string, object>noSee below.
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampyesTime (milliseconds since 1970-01-01 UTC)

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

processFields.* (object):

FieldTypeRequiredDescription
editablebooleannoEnables editing for function fields
placeholderstringnoPlaceholder text for label
descriptionstringnoDescription text for field
data(ObjectId | string)[]noList of allowable values for predefined options or process ids for linked activities
unitstringnoUnit - default to null (no unit)
defaultTobooleannoEnable default to given value in defaultValue
defaultValuestringnoDefault value for field if defaultTo is enabled
functionstringnoJavascript function code
functionEnabledbooleannoEnable function
functionVariablesRecord<string, object | object[]>no
reminderEnabledbooleannoEnable reminder
modifierobjectnofield type modifiers See below.
keystringnoField Key
reminderSettingsobjectnoSee below.
collapsedByDefaultbooleannoHides fields under subheader if enabled
labelstringyesField label
requiredbooleannoRequire field to be given - defaults to false Default: false.
typestringyesOne of: activitylink, country, date, daterange, datetime, datetimerange, numeric, numericunit, teams, text, textarea, textunit, textpredefinedoptions, time, timerange, users, linkedfrom, subheader.
inviteToDiscussionOnChangebooleannoOnly used for User fields. If true the user will be added to the activity discussion if they are not already in it. Default: false.
_idObjectIdyes
createdtimestampnoTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
uiduserIdnouserId

processFields.*.modifier (object):

FieldTypeRequiredDescription
checkboxbooleanno
filebooleanno
linkbooleanno
activityFieldFiltersobject[]noSee below.
matchAllFieldFiltersbooleannoSet true if all activityFieldFilters must match
quickAddobjectnoSee below.

processFields.*.modifier.activityFieldFilters[] (object):

FieldTypeRequiredDescription
targetWorkflowIdprocessIdyesworkflowId
targetFieldIdfieldIdyesfieldId
sourceFieldIdstringno

processFields.*.modifier.quickAdd (object):

FieldTypeRequiredDescription
targetFieldIdfieldIdyesfieldId
fieldIdsfieldId[]no

processFields.*.reminderSettings (object):

FieldTypeRequiredDescription
usersObjectId[]noUsers to Remind
teamsObjectId[]noTeams to Remind
fieldsObjectId[]noUser/Team Fields to Remind
phasesObjectId[]noPhases where the reminder is active
activityOwnerbooleanyesShould we remind the activity owner
activityOwnerTeambooleanyesShould we remind the activity owner team
activityParticipantsbooleanyesShould we remind the activity discussion participants
reminderTextstringno
fieldOffsetobjectnoOffset to add to field dates for reminders See below.

processFields.*.reminderSettings.fieldOffset (object):

FieldTypeRequiredDescription
millisecondsnumberyesMilliseconds to add/subtract from offset
daysnumberyesDays to add/subtract from offset
monthsnumberyesMonths to add/subtract from offset
beforeOrAfterbefore | afteryes
startOrEndstart | endno

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.

activities.load ​

Description

When provided a valid activityId to which the user has access, will return the corresponding Activity.

Parameters

Argument 1 (ObjectId, required):

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('activities.load', [
  '507f1f77bcf86cd799439011', // ObjectId (required)
]);
console.log(result);

Returns

FieldTypeRequiredDescription
_idObjectIdyes
processprocessIdyesworkflowId
followersObjectId[]no
team_accountobjectyesSee below.
namestringno
createdtimestampyesTime (milliseconds since 1970-01-01 UTC)
updatedtimestampnoTime (milliseconds since 1970-01-01 UTC)
uiduserIdyesuserId
cidWorkspaceIdyesworkspaceId (former networkId)
completePhasesObjectId[]no
currentPhaseObjectIdyes
discussionObjectIdyes
fieldsRecord<string, object>noFields of activity, format of items is dependent on the configuration of the process given in process field. See below.
filesany[]no
locationobjectnoSee below.
prioritynumberno
activebooleannoActivity not in endpoint phase is considered active
linksobject[]noSee below.
sequencenumberno
ballHolderobjectnoSee below.

team_account (object):

FieldTypeRequiredDescription
accountObjectIdyesaccountId
teamObjectIdyesteamId

fields.* (object):

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

location (object):

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

location.data[] (object):

FieldTypeRequiredDescription
latnumberno
lngnumberno

links[] (object):

FieldTypeRequiredDescription
idstringno
linkIdObjectIdno
typereaction | tag | linked-to | in_process | user-mention | apple-id | feed.lastseenno
createdtimestampnoTime (milliseconds since 1970-01-01 UTC)

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.

activities.phase_count ​

Description

If given a valid workflowId which the user has permission to view, will give out a count of the amount of activities are currently in each phase of the workflow.

If possible, please use the function v3/activities/list instead.

Parameters

Argument 1 (processId, optional): workflowId

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('activities.phase_count', [
  '507f1f77bcf86cd799439011', // processId
]);
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.

activities.remove ​

Description

When provided a valid activityId or an array of activityIds, this function will remove the provided activities.

If the user does not have the required permissions or is a Guest User in the network the activities are in, it will return the appropriate error message

Parameters

Argument 1 (ObjectId \| ObjectId[], required):

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('activities.remove', [
  '507f1f77bcf86cd799439011', // argument 1 (required)
]);
console.log(result);

Returns

FieldTypeRequiredDescription
successactivityId[]yes
failedactivityId[]yes

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.

Description

Searches for an activity whose name contains the substring provided, in a the designated process.

Example: In a process X with the activities foo, foob, fooba & foobar calling this function with the request {0:'fooba', 1:'X'} should return [fooba, foobar].

Parameters

Argument 1 (string, required): Substring to search activity names with

Argument 2 (processId[], required): Id for the process to search in

Argument 3 (object, optional):

FieldTypeRequiredDescription
fieldFiltersobject[]noSee below.
matchAllFieldFiltersbooleanno

fieldFilters[] (object):

FieldTypeRequiredDescription
targetWorkflowIdprocessIdyesworkflowId
targetFieldIdfieldIdyesfieldId
sourceFieldValueanyno

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('activities.search', [
  'string', // Substring to search activity names with (required)
  ['507f1f77bcf86cd799439011'],
  {
    fieldFilters: [{
      targetWorkflowId: '507f1f77bcf86cd799439011', // workflowId
      targetFieldId: '507f1f77bcf86cd799439011', // fieldId
    }],
    matchAllFieldFilters: false,
  },
]);
console.log(result);

Returns

Array of objects:

FieldTypeRequiredDescription
_idactivityIdyesactivityId
namestringno
activebooleanno
processprocessIdyesworkflowId
currentPhasephaseIdyesphaseId (phase in a Workflow)

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.

activities.set_update ​

Description

Undocumented

This endpoint has no description in the source yet.

Parameters

Argument 1 (object, required):

FieldTypeRequiredDescription
activitiesObjectId[]yes
completedOntimestampnoTime (milliseconds since 1970-01-01 UTC)
createdtimestampnoTime (milliseconds since 1970-01-01 UTC)
openAndMoveToPhaseObjectIdno
ownerObjectIdno
team_accountobjectnoSee below.

team_account (object):

FieldTypeRequiredDescription
accountObjectIdyesaccountId
teamObjectIdyesteamId

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('activities.set_update', [
  {
    activities: ['507f1f77bcf86cd799439011'],
  },
]);
console.log(result);

Returns

FieldTypeRequiredDescription
phase_idphaseIdyesphaseId (phase in a Workflow)
activitiesactivityId[]yes

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.

activities.update ​

Description

Note: We highly recommend you use the v3.activity.updateMany endpointWhen called with a correctly formatted Activity object, it will update the indicated Activity. The request will return an error if the user lacks permissions to edit the Activity in question.

Parameters

Argument 1 (object, required):

FieldTypeRequiredDescription
activitiesRecord<string, object>noSee below.
completeActionobjectnoSee below.

activities.* (object):

FieldTypeRequiredDescription
fieldsanyno
filesObjectId[]no
locationobjectnoSee below.
namestringno

activities.*.location (object):

FieldTypeRequiredDescription
labelstringno
typearea | point | polylineyes
dataobject[]noSee below.

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

FieldTypeRequiredDescription
latnumberyesLatitude
lngnumberyesLongitude

completeAction (object):

FieldTypeRequiredDescription
nextPhaseObjectIdno

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('activities.update', [
  {
    activities: {
      '507f1f77bcf86cd799439012': { /* ... */ }, // fieldId: value
    },
    completeAction: {
      nextPhase: '507f1f77bcf86cd799439011',
    },
  },
]);
console.log(result);

Returns

object

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