Skip to main content

How to add an update to a subitem via API

  • May 16, 2023
  • 3 replies
  • 450 views

jsararas

I am creating subitems via API calls. Now I want to include comment text as an Update. It works fine in the playground so I know it’s supported. But I keep getting an 500 response.

{"query": "mutation { create_update (item_id: 9876543210, body: "TEST") { ID } }"}

What am I doing wrong here?

3 replies

Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • May 17, 2023

Hello @jsararas,

This works well for me:

mutation {
  create_update(item_id: 1234567890, body: "TEST") {
    id
  }
}

(id instead of ID)

You say the same thing works in the Playground and not from you script?

Would you be able to send the full script you are using without adding any sensitive information?


jsararas
  • Author
  • Participating Frequently
  • May 17, 2023

Thanks @Matias.Monday, I realized I was not escaping properly:
body: "TEST" needed to be body: \\"TEST\\" and it works now. But as you mentioned ID instead of id would have also broken it!


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • May 18, 2023

Hello @jsararas,

I am glad you found the source of the issue!

Let us know if you have any questions or issues in the future 😁

Cheers,
Matias