You can now access files that are on your board via our API, and also upload them. Here’s the documentation.

Reading Files using the API

The assets field represents a file that is uploaded to monday.com. You can query the title of the file, the URL, and also generate a public URL that can be used to download the file. Learn more here.

Uploading Files using the API

Our API also supports uploading files to a file column or update. To do this, you need to send your data as a multipart request (Content-Type: multipart/form-data) with the file in a variable. Here’s more info.

Do note that we have a separate endpoint for files (api.monday.com/v2/file). This endpoint has a higher size limit for requests (20MB, which will be increased to 500MB in the coming weeks).

Great stuff, I was able to upload a file to the file column using the Postman example. The next step for me is to upload a file to a file column from my WordPress website using php. I do make successful API V2 call from php for normal queries and mutations but I am wondering how to use FILE! variable as shown in the Postman example.

Great update! We were waiting a long time for this. I already did a test with the curl command, I had no problems and it return the id of the asset , but I tried to do it with python, but I had the next error:

I experienced the same kind of errors Carlos is mentioning. Depending on the language / environment you are using you really need to find out how to exactly send a multipart request. I am using WordPress/PHP and sending a multipart request can only be done when you build the body of the request by concatenating strings. This is because you need to define a boundary in the header and use the boundary (preceded by ‘–’) in the body. The boundary in my case is a WordPress generated password, but it can be any unique string. Make sure it is really unique because you will run into problems when this string is part of the file contents.

In this piece of code (WordPress/PHP) you see how I use “normal queries” - here to create a new item with the name of the file as it’s item name. When I have the item_id I will then upload the file to the file column and as you can see the body needs to be build by concatenating the correct strings.
Don’t forget to determine the MIME type as monday’s file viewer needs to know. Also you need to make sure that there is an empty line in the body before the actual query and the contents of the file to be uploaded. If you omit these you will get a 500 error returned. See also the comments in the code.

In my WordPress environment MONDAY_TEAM and MONDAY_URL are constants defined in my wp-config file. My secret monday key is stored in the user’s profile field and retrieved by get_field(‘mondaykey’, ‘user_42’). You need to replace those variables with your own to be able to test this yourself.

The code is just the beginning of a larger project, so the full path of the file (on my WordPress server) and the board_id are fixed values for now.

//the board id will be derived from another piece of code, just for now it is fixed
$boardid = ‘515108235’;

//full filepath will be derived from another piece of code, just for now it is fixed
$filepath = ‘/var/www/vhosts/101/292674/webspace/siteapps/WordPress-515402/htdocs/wp-content/uploads/monday/How to use Excellent Monday - 0.8.pdf’;

Thank you for this update. At the moment we have a problem with uploading bigger files than 2MB, but if we try to upload files using the web app those files are upload without problems. The error which the server returns when we are using the API is: 413 Request Entity Too Large. Do you have in plan to change the limit for uploading files?

Allow files as binary data:@abasappa, this is a great point. It isn’t possible at the moment but I’ll pass this along as feedback.

Increase file upload limit:@zeljko-romanovic-mst, at the moment we don’t have plans for this, but I’ll pass this along as feedback as well! If you have larger files than 2MB, you will need to upload them through the web UI.

Hi @basdebruin, I tried this method in my wordpress environment, I am getting error “No query string was present”. I am using the same code as yours…only mine is to upload file to an item. Can you help? Also, I would like to know what the constant 'MONDAY_TEAM ’ is?

Hi @moumitapaul, the constant MONDAY_TEAM is just the name of my organization as known in monday.com. Later I recognized this is rdeundant information in the header, so you can leave it out completely.

I tested the below code and it uploads my file to the update. Don’t forget that the update_id is the id of an existing update, you can found the id by clicking the upper right circle down arrow in any update and do “Copy link to update”, the last value in the URL copied is the update_id (in my case 708406624).

All “No query string was present” messages I got in the past (quite a few ) were related to the contents of the body. This is kind of strict.

Should be the same for image file (I think). Hard for me to test because I filter on file type in another piece of code and do not allow images. Did you recognize the $upload in my code is an array, this is a dump of the array