Skip to main content

Write journal entries

The journal is the activity log of an entity: notes, calls, emails and meetings. Write to it from your systems, for example when a support ticket is closed or a call is finished.

const { Journal } = sdk.asAdmin().Customers()

await Journal.create(['SC-COMPANY'], {
channel: 'PHONE',
direction: 'INCOMING',
text: 'Customer called about the delayed delivery of order ORD-1012.'
})

The first argument is a list of humanIds. One call writes the same entry to all of them.

Entry fields​

FieldRequiredValues
channelyesNOTE, PHONE, MOBILE, FAX, EMAIL, CONVERSATION, CALENDAR_EVENT, FILE, JIRA, MAIL
textyesThe entry text
directionnoUNKNOWN, INCOMING, OUTGOING. Only valid for PHONE, MOBILE, FAX, EMAIL, MAIL

The response has status 201 and the created journal documents, one per entity.

Author​

  • With sdk.asAdmin() the author is SYSTEM.
  • With sdk.asUser(idToken) the entry shows the user's display name and avatar.

Examples​

Log an email sent by your system​

await Journal.create([customerHumanId], {
channel: 'EMAIL',
direction: 'OUTGOING',
text: 'Sent invoice INV-2026-0042 (PDF attached).'
})

Note on a company and its contact person​

await Journal.create([companyHumanId, personHumanId], {
channel: 'NOTE',
text: 'Renewed the support contract until 2027-12-31.'
})

Errors​

ErrorCause
customers/missing-humanIds (SDK) / journal/missing-humanIdsEmpty array
journal/invalid-channelUnknown channel
journal/missing-textNo text
journal/direction-not-supporteddirection on a channel that does not support it
journal/invalid-directionUnknown direction
entity/not-foundOne of the humanIds does not exist