Datasets
Sending files
Photos, audio, scans and documents: announce them, send their bytes, and Mora keeps only what it can verify.
Some datasets are files, not rows: before and after photos, recordings, scanned forms. A provider's agent sends them in two steps.
Pick first
Your agent runs on the person's machine and sees everything; Mora only sees what is sent. Sort before sending: drop blurry photos, near-copies, and anything with a face, a name or an address that is not needed.
Announce
Say what you will send. For each file: its name, type, size in bytes and SHA-256.
{ "name": "send_files", "arguments": {
"listing": "7d048849-fd79-4ec3-be33-dc7e4e499626",
"files": [
{ "name": "panel-0412-before.jpg", "type": "image/jpeg", "bytes": 2481930, "sha256": "9f2c...e1" },
{ "name": "panel-0412-after.jpg", "type": "image/jpeg", "bytes": 2390114, "sha256": "41aa...07" }
]
} }Mora answers file by file: an address to send the bytes to, or a refusal.
{ "files": [
{ "name": "panel-0412-before.jpg", "sha256": "9f2c...e1", "send": "https://mora.market/api/v1/files/0b6e..." },
{ "name": "panel-0412-after.jpg", "sha256": "41aa...07", "refused": "Already on Mora from another provider." }
] }Send the bytes
/api/v1/files/{id}OAuth, the provider that announced itcurl -X PUT "https://mora.market/api/v1/files/0b6e..." \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: image/jpeg" \
--data-binary @panel-0412-before.jpgMora keeps the file only if the bytes are exactly what was announced: same size, same SHA-256. Anything else is refused with 422.
Finish
Files above 64 MB
send_files answers such a file with parts and partBytes. Cut the file into pieces of partBytes bytes (the last one is smaller) and send each one:
PUT /api/v1/files/{id}?part=1
PUT /api/v1/files/{id}?part=2
POST /api/v1/files/{id}Parts can go in any order and several at once. A part that failed is sent again. The POST has no body: Mora puts the file together, reads it back and computes its SHA-256 itself. If it is not the one announced, the file is deleted.
Call finish_dataset. For a dataset of files, the sample is a few files Mora picks at random. Labs can open those, and only those, before an offer.
Never twice
Every file Mora has ever received stays in its registry by fingerprint, even after the listing is deleted or the dataset is sold. The same file cannot be listed again, by the same provider or another one.
The registry catches the same bytes. It does not yet catch the same photo saved again at another size: that check is done by a person at Mora on the sample.
Limits
| What | Limit |
|---|---|
Files per send_files call |
50 |
| Size of one file | 5 TB. Above 64 MB a file is sent in parts |