Magidoc

insertMessage
Mutation

Sends a message or comment to a Hive chat, action, note, goal, project, opportunity, or notification. Requires target-container access; participant-created direct messages require workspace access. For an existing container, pass containerId and containerType. For a new direct message, omit containerId and pass workspaceId, participants, and containerType: group. Participants must be active workspace members, external members, or system admins, never stubs. Prefer bodyMarkdown and omit body; body wins when both are supplied. To notify, put the 17-character user ID in mentions and <@USER_ID> in bodyMarkdown; plain @name or @userId does not notify. To mention a whole group chat, put GROUP: in mentions and <@containerId> in bodyMarkdown. Returns the created message with computed fields.

Arguments

#

_id

Optional client-generated message ID; the server generates one when omitted. Resending your own message ID to the same container returns that stored message instead of creating a duplicate

workspaceId

Workspace ID; required when participants are used instead of containerId

containerId

Existing container ID; omit only when creating or finding a direct message from participants

containerType = "group"

Message container type. Specify explicitly with containerId. Supported here: action, group, note, goal, project, opportunity, notification

participants = []

[ID !]

Direct-message participant IDs; each must be an eligible active workspace participant with a non-stub account

mentions = []

17-char user IDs to notify, or GROUP: for every member of a group chat; with bodyMarkdown each id must also appear as <@ID> in the message text

automated

body

Slate/HTML message body; takes precedence if bodyMarkdown is also provided

bodyMarkdown

Markdown message body; converted to Slate HTML before storage; preferred for agent-authored content when body is omitted

attachments = []

File or action attachments to include with the message

color

isNoteJsonComment

replyToMessageId

Original comment the caller can read on the same action; omitted for ordinary comments

mentionType

Space-separated action notification categories: ACTION, PROJECT, PROJECT_OWNER; recipient IDs still come from mentions

isPrivate

userMentionsByGroup = []

[ID !]

User IDs to notify because their group was mentioned; pass expanded member IDs, not group IDs (mention a group chat with GROUP: in mentions)

userMentionsByTeam = []

Mentioned users paired with their team names

senderFirstName

Custom sender display name (overrides default user name when sending as an identity)

senderPicture

Custom sender profile picture URL (overrides default user avatar when sending as an identity)

onBehalfOfUserId

If Buzz is authoring the comment on behalf of a human, store that human's user id

Response

#

Returns Message !.

Example

#