Add images to monday doc using API

I found a way to add images into Monday docs that actually works:

mutation {
  create_doc_block(
    doc_id: "123456789",
    type: image,
    content: {
      publicUrl: "https://test.test/test.png",
      width: 900,
      alignment: "center"
    }
  ) {
    id
  }
}

The important thing is that type has to be the enum image (not "image" as shown in the docs).
Right now, there’s no way to upload or attach a file directly it only works with a publicly accessible URL.
I tried url, asset_id, and local file paths, but none of them work.

My code is a little bit different since I use php but hope this helps :slight_smile:

1 Like

Hello,
That’s a great discovery for working with Monday docs! It’s very helpful to know that the type parameter for create_doc_block needs to be the enum image rather than a string “image” to successfully insert an image block. The current limitation to using only a publicUrl is a key constraint, and it’s valuable information that attempts with url, asset_id, or local file paths do not function at this time. This insight, especially about the required enum format, can save others a lot of troubleshooting time!

Best regards,
Mary
kaiser member services