Mint Attachment
Mint a signed upload URL and create a pending attachment row on the
record. This is the same signed-URL flow as
Ingest Assets โ this call
does not carry the file bytes.
โถHow it works
- Request the URL โ this
POSTreturns201withattributes.upload_url(short-lived, 15-minute TTL) +expires_at, and apendingattachment. Theafter-responsescript on this request stores the new id and URL as theatt_id/att_upload_urlcollection variables so the next steps can chain off them. - Upload the bytes โ
PUTthe raw file to{{att_upload_url}}withContent-Type: application/octet-stream(what the URL pins). The size ceiling and content-type are bound into the signature, so an over-size body is rejected by storage. The URL is single-object, single-shot. - Storage finalises โ when the object is written, an
OBJECT_FINALIZEevent triggers an internal webhook that flips the row tostatus: "stored"and stampsconfirmed_at. No further client call is needed โ there is no confirm endpoint. - Poll โ
GETGet Attachment (or List Attachments) on{{att_id}}untilstatusisstored.
Just like the Ingest Assets signed-URL flow, Bruno's request sandbox can't
PUTbytes to a signed URL โ so steps 2โ4 can't run end-to-end inside the runner. Usescripts/smoke-attachment-upload.shto exercise the real byte round-trip (choose a file โ mint โ PUT โ poll tostored) against the local emulator stack.
โถRequest body
| Field | Type | Required | Notes |
|---|---|---|---|
category | enum | yes | supporting_document, certificate, due_diligence_statement, legality_evidence, geolocation_evidence, correspondence, map, other |
source | enum | yes | operator, supplier, third_party, verifier |
filename | string | yes | Sanitised; extension must be allowlisted (below) |
description | string | no | Free-text describing what the evidence is; trimmed, โค 2000 chars (blank โ omitted). Editable later via PATCH (see Update Attachment) |
plot_ids | uuid[] | no | Record plots this doc justifies; unique; โค 5000. Omitted/empty = record-level |
verification_status | enum | no | approved (default), awaiting_verification, rejected |
checksum_sha256 | string | no | 64 hex chars; client-computed SHA-256 |
metadata | object | no | Free-form; __proto__ keys rejected |
Only category, source, and filename are required.
content_typeandsize_bytesare not accepted here โ they are resolved server-side at finalize (size from the stored object, MIME from the filename extension), the same way Ingest Assets resolves them. Supplying either is rejected with400. They appear on the attachment resource โnullwhilepending, filled once the object isstored.
โถAllowed file types
.pdf, .doc, .docx, .xls, .xlsx, .csv, .txt, .png, .jpg,
.jpeg, .tif, .tiff, .zip. Active-content types (.html, .svg,
.js, executables) are rejected. The content_type served on download
is derived from this extension.
โถLimits
- Per-record cap: 100 non-archived attachments (a 101st returns
422). - Upload URL TTL: 15 minutes.
plot_idsmust reference plots that belong to the record โ an unknown plot returns422 PlotNotInRecord.
โถErrors
| Status | When |
|---|---|
| 400 | Body failed validation; disallowed extension; an unknown field such as content_type / size_bytes (server-resolved); metadata.__proto__ |
| 404 | Record not visible to the caller's org |
| 422 | Per-record cap exceeded, or a plot_id not in the record |
Required scope:
eudr:write