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

  1. Request the URL โ€” this POST returns 201 with attributes.upload_url (short-lived, 15-minute TTL) + expires_at, and a pending attachment. The after-response script on this request stores the new id and URL as the att_id / att_upload_url collection variables so the next steps can chain off them.
  2. Upload the bytes โ€” PUT the raw file to {{att_upload_url}} with Content-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.
  3. Storage finalises โ€” when the object is written, an OBJECT_FINALIZE event triggers an internal webhook that flips the row to status: "stored" and stamps confirmed_at. No further client call is needed โ€” there is no confirm endpoint.
  4. Poll โ€” GET Get Attachment (or List Attachments) on {{att_id}} until status is stored.

Just like the Ingest Assets signed-URL flow, Bruno's request sandbox can't PUT bytes to a signed URL โ€” so steps 2โ€“4 can't run end-to-end inside the runner. Use scripts/smoke-attachment-upload.sh to exercise the real byte round-trip (choose a file โ†’ mint โ†’ PUT โ†’ poll to stored) against the local emulator stack.

Request body

FieldTypeRequiredNotes
categoryenumyessupporting_document, certificate, due_diligence_statement, legality_evidence, geolocation_evidence, correspondence, map, other
sourceenumyesoperator, supplier, third_party, verifier
filenamestringyesSanitised; extension must be allowlisted (below)
descriptionstringnoFree-text describing what the evidence is; trimmed, โ‰ค 2000 chars (blank โ†’ omitted). Editable later via PATCH (see Update Attachment)
plot_idsuuid[]noRecord plots this doc justifies; unique; โ‰ค 5000. Omitted/empty = record-level
verification_statusenumnoapproved (default), awaiting_verification, rejected
checksum_sha256stringno64 hex chars; client-computed SHA-256
metadataobjectnoFree-form; __proto__ keys rejected

Only category, source, and filename are required.

content_type and size_bytes are 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 with 400. They appear on the attachment resource โ€” null while pending, filled once the object is stored.

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_ids must reference plots that belong to the record โ€” an unknown plot returns 422 PlotNotInRecord.

Errors

StatusWhen
400Body failed validation; disallowed extension; an unknown field such as content_type / size_bytes (server-resolved); metadata.__proto__
404Record not visible to the caller's org
422Per-record cap exceeded, or a plot_id not in the record

Required scope: eudr:write