Skip to main content

Create an item via API

  • November 8, 2024
  • 5 replies
  • 59 views

Hello experts,
I know it is a basic question but could I have help from you please?

I am trying to create an item via API.
It works if I copy the sample GraphQL code from the guide exactly (changed the board_id and group_id), but it doesn’t work if I change the column_values.
What is missing my code? Thank you so much in advance.

for example, it works:

mutation {   create_item (board_id: xxx, group_id: "xxx", item_name: "new item", column_values: "{\\"date\\":\\"2023-05-25\\"}") {     id   } }

it does not work:

mutation {   create_item (board_id: 7772434243, group_id: "new_group29179", item_name: "new item", column_values: "{\\"text8__1\\":\\"システム\\"}") {     id   } }

it also does not:

mutation {   create_item (board_id: xxx, group_id: "xxx", item_name: "new item", column_values: "text8__1":"システム") {     id   } }

*column ‘text8__1’ is a custom column. I made sure the same issue with other default values.

Referred: Items

5 replies

  • New Participant
  • 1 reply
  • November 9, 2024

What’s that in the mutation?
Date is recognized label so it works. Please check


  • Author
  • New Participant
  • 2 replies
  • November 10, 2024

Thanks having a look.
‘text8__1’ is the name of custom column (text) I created. I intended to write it the same as the date…


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • 3512 replies
  • November 10, 2024

Hello there @shiorly and welcome to the community!

What error message are you getting?

What is a “custom column” in this case? How did you create that column?

Looking forward to hearing from you!

Cheers,
Matias


  • Author
  • New Participant
  • 2 replies
  • November 19, 2024

Hi Matias, thank you for your comment.

What error message are you getting?

I tried it on an API integration service (IBM’s tool that can offer the custom API process generation) and it responded nothing when it did not work, so I will check the result with other environment.

What is a “custom column” in this case? How did you create that column?

I created it by clicking a + button on column header.


  • New Participant
  • 1 reply
  • November 20, 2024

Hey there @shiorly.

The 3rd line you shared with us, has some incorrect escaping, so I can see why it wouldn’t work.

As for the 2nd one I recreated the code in a board and it worked fine for me.

mutation {
  create_item(
    board_id: 7860139053
    item_name: "new item"
    column_values: "{\\"text__1\\":\\"システム\\"}"
  ) {
    id
  }
}

I know it is a basic thing but my guess would be that your “board_id”, “group_id” or “column_id” is incorrect!

Share an error message whenever you get it to see what’s happening.