Create item with custom status and other columns values

Hi there,

I’m trying to create task and define status of the task, but it is not easy to understand how to properly do this.

My query:

mutation {create_item (board_id: 377902169, group_id: "new_group18793", item_name: "new item", column_values: "{"status": "Search Active"}") {id}}

This query failed with error:
[{"message":"Parse error on \": \" (STRING) at [1, 117]","locations":[{"line":1,"column":117}]}]

I’ve also tried this query:

mutation {create_item (board_id: 377902169, group_id: "new_group18793", item_name: "new item", column_values: {status: "Search Active"}) {id}}

And this query fails with 500 status code and message “We’re currently experiencing some technical issues which our developers are working hard to resolve” (but the status page shows there are no incidents…)

So, the question is how I can set the correct value for columns for a new task?

Thank you!

So, more I work with this API more I hate it :frowning:.

Here is the example for people who will also be stuck trying to create a new item with PYthon:

headers = {'Content-Type': 'application/json',
           'Authorization': token}

url = 'https://api.monday.com/v2/'

create_item = """mutation {create_item (board_id: 377902169, group_id: "new_group18793", item_name: "new item",
               column_values: "{\\"status\\": {\\"label\\": \\"Search Active\\"},
                                \\"numbers\\": \\"1\\",
                                \\"text4\\": \\"Test\\"
                                }") {id}}
            """

get_columns_data = """query {boards (ids: 377902169) {owner {id} columns {id title type}}}"""

# Get columns types / ids:
body = {'query': get_columns_data}
res = requests.post(url=url, json=body, headers=headers)

# Create item with one status column, one numeric column and one text column:
body = {'query': create_item}
res = requests.post(url=url, json=body, headers=headers)

Hey @xwizard – sorry to hear that you’ve found it difficult to get started with our API.

You can certainly use escape characters to make the column value string, but I recommend using GraphQL variables for this instead. It will let you send the column values as a normal JSON object and not worry about string interpolation.

Here’s a guide to help you get started in Python!

Cheers,
Dipro