Creating updates with mention of a specific user

In my app, I’m trying to create an update that mentions someone else, so that they can perform a task stated in the update.

I’m seeing that I can use the create_update mutation to create an update, e.g:

mutation {
  create_update (
    item_id: "2801294194", 
    body: "<p>Hello <a href=\"\" data-mention-type=\"User\"></a></p>"
  ) {

This “looks right”, but is missing the actual mention mechanism, so the user does not see the mention under “I was mentioned” in the inbox:

If I look at the browser console when posting an update in the UI, I see the following call:


BODY (as FormData):
  post[item_id]: 2801294194
  post[kind]: update
  post[body]: <p>Mentioning&nbsp;<a class="user_mention_editor router" 
  href="" data- 
 mention-type="User" data-mention- 
 id="30515803"></a>&nbsp;from the UI</p>
  mentions: [{"type":"User","id":"38005153"}]
  asset_id: []
  gifs: []
  version: 1
  theme: light

So, the platform uses a different endpoint than the public GraphQL endpoint, and it also adds the mentions object.

Looking in the API playground, I can’t see any way to add mentions to the create_update mutation.

How do I do this?

If I can’t, please convert this into a feature request.

Cc: @Matias.Monday @dipro

Also, if I trigger this:

  • server side, I’d expect the update to come from whoever installed the app,
  • client side, I’d expect the update to come from the current logged in user

Is this correct?

Hello there @dvdsmpsn,

This is not possible via API (to mention someone). I have turned this into a request.

Regarding your last question, it will be on behalf of the user whose token is being used for the call.

Let me know if you have any questions!


1 Like