Depositing a BagIt bag
Use case: your content arrives as a BagIt bag — a payload under data/, with tag files and a checksum manifest in the root — and you would like to upload it as it is rather than take it apart first.
The BagIt Deposit template exists for exactly this. It gives you the same layout as RootLevel, one level down — and nothing else:
/ data/ objects/ metadata/ ad-hoc/ mets.xmlThe tag files and the manifest come from your bag, not from the template, so once you have uploaded it the workspace looks like this:
/ bagit.txt <- yours bag-info.txt <- yours manifest-sha256.txt <- yours, and the platform reads it for digests tagmanifest-sha256.txt <- yours data/ objects/ <- your payload goes in or below here metadata/ ad-hoc/ mets.xmlTwo things follow from that, and they are what this page is about.
The bag is how the content travelled, not part of the content. The tag files in the root are above data/, and they are not preserved. The Archival Group you end up with is indistinguishable from one deposited in the RootLevel layout.
The data/ prefix is invisible to the API. Wherever you give a path to the Preservation API — adding files to the METS, deleting items — you give it as it appears below data/: objects/image_001.tif, not data/objects/image_001.tif. The one place the prefix does appear is the origin of a Binary in an Import Job, because that is where the bytes actually are.
-
Create a Deposit from the
Section titled “Create a Deposit from the BagIt template”BagIttemplatePOST /deposits{"type": "Deposit","template": "BagIt","archivalGroup": "https://preservation-api.example/repository/library/born-digital/accession-2025-112","archivalGroupName": "Accession 2025/112"} -
Upload the unpacked bag
Section titled “Upload the unpacked bag”Copy the whole bag into the location given by
files, keeping its structure: tag files in the root, payload underdata/.s3://working-bucket/deposits/e56fb7yg/bagit.txts3://working-bucket/deposits/e56fb7yg/manifest-sha256.txts3://working-bucket/deposits/e56fb7yg/data/objects/…The platform works out that a Deposit is in BagIt layout by looking for a
data/directory in the workspace, not from thetemplateyou asked for. Finding the METS is a separate question, and it is answered root-first: the root of the workspace is searched beforedata/. So a bag uploaded into aRootLeveldeposit is a mixture — adata/-rooted file tree paired with themets.xmlthe template already put at the root. Upload a bag into a deposit made withtemplate: NoneorBagIt, not into aRootLevelone. -
Work on it as usual
Section titled “Work on it as usual”From here everything is as in the other workflows, with paths written as if
data/were the root:POST /deposits/e56fb7yg/mets["objects/nyc/DSCF0981.JPG","metadata/brunnhilde/siegfried.csv"]You can run the pipeline over a BagIt deposit exactly as over any other; it reads and writes below
data/. -
Generate the Import Job and look at it
Section titled “Generate the Import Job and look at it”GET /deposits/e56fb7yg/importjobs/diffThe
idpaths carry nodata/; theoriginURIs do:{"source": "s3://working-bucket/deposits/e56fb7yg/","binariesToAdd": [{"id": "https://preservation-api.example/repository/library/born-digital/accession-2025-112/objects/nyc/DSCF0981.JPG","type": "Binary","name": "DSCF0981.JPG","origin": "s3://working-bucket/deposits/e56fb7yg/data/objects/nyc/DSCF0981.JPG","contentType": "image/jpeg","size": 3183477,"digest": "4675c73e6fd66d2ea9a684ec79e4e6559bb4d44a35e8234794b0691472b0385d"}]}Note what is not there: no
bagit.txt, nomanifest-sha256.txt. They sit abovedata/and are never part of the object. -
Run it, and poll the result
Section titled “Run it, and poll the result”As in every other workflow.
What comes back out
Section titled “What comes back out”An Archival Group that went in as a bag does not come out as one. Export always produces the RootLevel layout, matching the Archival Group: objects/, metadata/ and the METS in the root of the workspace, with no data/ and no tag files. This is consistent — the bag was packaging, and packaging is not what was preserved — but it does mean the round trip is not byte-for-byte, and a workflow that expects to get its bag back will be disappointed.