Tutorial: Your first API call

Friday, June 09, 2023 by jakub.misilo Tutorial: Your first API call


In this tutorial you will learn how to use to retrieve and mutate your workplace and improve your team's experience!

Soโ€ฆ without any further ado, letโ€™s dive in! is a work operating system (Work OS) that enables organizations to build custom workflow apps in a code-free environment - to run projects, processes and everyday work. Teams shape workflows and projects, code-free, with an adaptive platform that automates manual work and connects teams in a digital workspace. The platform offers a variety of features, including customizable workflow templates, time tracking, automations, data dashboards, integrations with popular tools and apps.

Recently the team released a beta version of AI assistant for their software! This is great news for all users. It will empower the productivity of their users and on top of that, it will encourage new users to try this great platform.

monday API & API Key

[]( allows you to build your own apps and insert them into their marketplace. This is great because it allows users to build applications tailored to their needs and also share them with others.

Building such applications requires the use of monday API. It allows you to integrate external applications into your monday workspace. To access this API you need to retrieve the API Key, this process is outlined in the monday documentation and I will not cover it here.



Let's start with design preparation. I will create a directory.

mkdir monday-first-api-call

cd monday-first-api-call

Now it is time for the virtual environment.

python3 -m venv venv

# Linux/MacOS
source venv/bin/activate

# Windows

And necessary libraries.

pip install requests python-dotenv

Let's now import the libraries into the file.

import os
from datetime import datetime

import requests
from dotenv import load_dotenv


Prepare our workplace

For the purposes of our project, I will prepare a simple workspace that will contain the boards we will use for our integrations. For more information check out

monday board before integrations

Monday API Integrations

OK, now we can start building our integrations. Our aim will be to extract the necessary data and then insert the item into our board.. I'll start by defining a couple of constants - API_KEY, API_URL. Also, I'll define the header that we'll use for request authorization.

API_KEY = os.getenv("MONDAY_API_KEY") # I will use .env file to store my API key
API_URL = ""

authorization_header = {"Authorization": API_KEY}

When working with the monday API, we need to bear in mind that it is a GraphQL API. It is a lot of fun to work with and thanks to a good job from the Monday team - the documentation is very clear.

I will now execute the query to get our board.

query_all_boards = "query { boards (limit:1) {id name} }"
data = {"query": query_all_boards}

r =, json=data, headers=authorization_header)
result = r.json()


{'data': {'boards': [{'id': '1206985347', 'name': 'TEST BOARD'}]}}

Now I have to extract the group. I will use the following query for this.

query_board = f"""query {{
                    boards (ids: {BOARD_ID}) {{
                        groups {{

data = {"query": query_board}

r =, json=data, headers=authorization_header)
result = r.json()


{'data': {'boards': [{'id': '1206985347', 'name': 'TEST BOARD', 'groups': [{'id': 'nowa_grupa', 'title': 'TEST GROUP'}]}]}, 'account_id': 17276871}

The last missing element is the columns, which we also need to extract.

columns_query = f"""query {{
                        boards (ids: {BOARD_ID}) {{
                            columns {{

data = {"query": columns_query}

r =, json=data, headers=authorization_header)
result = r.json()


{'data': {'boards': [{'columns': [{'id': 'name', 'title': 'Name'}, {'id': 'liczby', 'title': 'Numbers'}, {'id': 'tekst', 'title': 'Text'}]}]}, 'account_id': 17276871}

Great, now it is time to insert the new data into the board. Take a close look at the query, as it differs significantly.

add_item_query = f"""
            mutation {{
                create_item (
                    board_id: {BOARD_ID},
                    item_name: "TEST VALUE",
                    column_values: "{{
                        \\"tekst\\": \\"TEST TEXT\\",
                        \\"liczby\\": 13
                ) {{
data = {"query": add_item_query}

r =, json=data, headers=authorization_header)
result = r.json()


{'data': {'create_item': {'id': '1207322707'}}, 'account_id': 17276871}

Well, let's check out our result!

monday board after integrations

Well done! We managed to put the data to the monday board together!!!


As you can see, working with the API is not difficult. It is a bit different from working with the REST API, but everything is well described here. If you want to use the API in practice I invite you to our AI app hackathon! You certainly won't regret it!

Thank you for your time! - Jakub Misiล‚o @newnative

Discover tutorials with similar technologies

Upcoming AI Hackathons and Events