Skip to content

Upload a document to the collection

Step 3.1: Upload a document to the collection

To upload a document to a collection, you will need to send the base64 encoded contents to the file to the collection_id mentioned in the POST body. Aiida will classify the document and automatically move it to correct workflow in your collection.

POST /items

Mandatory Body parameters

Parameter Comment
name Name of the file to upload
mime_type MIME Type of the file to upload (e.g: application/pdf)
file_content_base64 Base64 Encoded contents for the file
collection_id Collection ID to upload to.

Example

{
  "file_content_base64": <YOUR BASE64 ENCODED DATA>,
  "mime_type": "application/pdf",
  "name": <YOUR FILE NAME>,
  "collection_id": <YOUR COLLECTION ID>
}