Create items in bulk using file from device

📘

Note

You cannot try out this API from the developer portal at the moment. We are working on fixing the known limitations. Feel free to try out the API in a tool of your choice. The API request and response information are provided in this document.

Resource URL

HTTP Method: POST

URL: https://api.miro.com/v2-experimental/boards/{board_id}/items/bulk

Content-Type header: multipart/form-data

Request

Request Type: Form-data

Request

Request Type: Form-data

Key nameValue
resource
(required)
The document or image files from the device. For example, foo.pdf, foo1.pdf, image1.jpg,image2.jpg. The maximum file size supported is 6 MB as the sum of all files.
data
(required)
Text file containing JSON object data.

📘

  • The order of the file upload must match the order provided in the JSON object data.
  • The maximum file size supported is 6 MB as the sum of all files.

The JSON object data must contain the following:

[
  {
    "title": "image1",
    "type": "image",
    "geometry": {
      "width" : 500
    }
  },
  {
    "title": "image2",
    "type": "image",
    "geometry": {
      "height" : 500
    }
  },
  {
  "title":"document1",
   "type": "document",
  "position": {
    "origin": "center",
    "x": 500,
    "y": 500
    }
  },
  {
  "title":"document2",
  "type": "document",
  "position": {
    "origin": "center",
    "x": 1000,
    "y": 1000
    }
  }
]

Where:

  • title is the title for the document or image.

  • type is the type of item that you want to create.
    Possible values: image, document

  • x is the X-axis coordinate of the location of the center of the item on the board. By default, all items have absolute positioning to the board, not the current viewport. The center point of the board has x: 0 and y: 0
    coordinates.
    Default: 0

  • y is the Y-axis coordinate of the location of the center of the item on the board. By default, all items have absolute positioning to the board, not the current viewport. The center point of the board has x: 0 and y: 0
    coordinates.
    Default: 0

📘

  • The order of the file upload must match the order provided in the JSON object data.
  • The maximum file size supported is 6 MB as the sum of all files.

Response

HTTP 201 Created

{
  "data": [
    {
      "id": "3458764556863677593",
      "type": "image",
      "data": {
        "imageUrl": "https://api.miro.com/v2/boards/uXjVM_xgjps=/resources/images/3458764514869561564?format=preview&redirect=false",
        "title": "image1"
      },
      "geometry": {
        "width": 500.0,
        "height": 281.25
      },
      "position": {
        "x": 0.0,
        "y": 0.0,
        "origin": "center",
        "relativeTo": "canvas_center"
      },
      "links": {
        "self": "https://api.miro.com/v2/boards/uXjVM_xgjps=/images/3458764556863677593"
      },
      "createdAt": "2023-06-12T12:42:16Z",
      "createdBy": {
        "id": "3458764537887297564",
        "type": "user"
      },
      "modifiedAt": "2023-06-12T12:42:16Z",
      "modifiedBy": {
        "id": "3458764537887297564",
        "type": "user"
      }
    },
    {
      "id": "3458764556863677594",
      "type": "image",
      "data": {
        "imageUrl": "https://api.miro.com/v2/boards/uXjVM_xgjps=/resources/images/3458764514869528891?format=preview&redirect=false",
        "title": "image2"
      },
      "geometry": {
        "width": 888.8888888888889,
        "height": 500.0
      },
      "position": {
        "x": 0.0,
        "y": 0.0,
        "origin": "center",
        "relativeTo": "canvas_center"
      },
      "links": {
        "self": "https://api.miro.com/v2/boards/uXjVM_xgjps=/images/3458764556863677594"
      },
      "createdAt": "2023-06-12T12:42:16Z",
      "createdBy": {
        "id": "3458764537887297564",
        "type": "user"
      },
      "modifiedAt": "2023-06-12T12:42:16Z",
      "modifiedBy": {
        "id": "3458764537887297564",
        "type": "user"
      }
    },
    {
      "id": "3458764556863677595",
      "type": "document",
      "data": {
        "documentUrl": "https://api.miro.com/v2/boards/uXjVM_xgjps=/resources/documents/3458764514869533511?redirect=false",
        "title": "document1"
      },
      "geometry": {
        "width": 595.0,
        "height": 842.0
      },
      "position": {
        "x": 500.0,
        "y": 500.0,
        "origin": "center",
        "relativeTo": "canvas_center"
      },
      "links": {
        "self": "https://api.miro.com/v2/boards/uXjVM_xgjps=/documents/3458764556863677595"
      },
      "createdAt": "2023-06-12T12:42:16Z",
      "createdBy": {
        "id": "3458764537887297564",
        "type": "user"
      },
      "modifiedAt": "2023-06-12T12:42:16Z",
      "modifiedBy": {
        "id": "3458764537887297564",
        "type": "user"
      }
    },
    {
      "id": "3458764556863677596",
      "type": "document",
      "data": {
        "documentUrl": "https://api.miro.com/v2/boards/uXjVM_xgjps=/resources/documents/3458764514869526361?redirect=false",
        "title": "document2"
      },
      "geometry": {
        "width": 595.0,
        "height": 842.0
      },
      "position": {
        "x": 1000.0,
        "y": 1000.0,
        "origin": "center",
        "relativeTo": "canvas_center"
      },
      "links": {
        "self": "https://api.miro.com/v2/boards/uXjVM_xgjps=/documents/3458764556863677596"
      },
      "createdAt": "2023-06-12T12:42:16Z",
      "createdBy": {
        "id": "3458764537887297564",
        "type": "user"
      },
      "modifiedAt": "2023-06-12T12:42:16Z",
      "modifiedBy": {
        "id": "3458764537887297564",
        "type": "user"
      }
    }
  ],
  "type": "bulk-list"
}

Required scope

Rate limiting

Level 2 per item. For example, if you want to create two images and two document items in one call, the rate limiting applicable will be 400 credits. This is because the create item in bulk call takes Level 2 rate limiting of 100 credits each, 100 for each image item and we are creating two image items, so that accounts for 200 credits, and then 100 for each document item, and we are creating two document items so that accounts for 200 credits, and the total is 400 credits.

—