Skip to main content
Docs

Evidence

Evidence is a file with typed metadata attached to a stage. It is fingerprinted with SHA-256 when it is uploaded, never edited, and replaced by newer versions. Uploads take exactly one file per request (PDF, JPEG, PNG, WebP, HEIC or HEIF, up to 20 MB). Downloads are never direct: you get a presigned link that is valid for 300 seconds. See Evidence and evidence packs.

The base is https://holdyn-fb2e34c7cbae.herokuapp.com/api/v1/b2b. Every endpoint below lists who may call it.

At a glance#

Objects

Evidence

Evidence (example values)
{
  "id": "evd_6543a1b2c3d4e5f6a7b8cd40",
  "object": "evidence",
  "livemode": false,
  "mandate": "man_6543a1b2c3d4e5f6a7b8cc00",
  "stage": "stg_6543a1b2c3d4e5f6a7b8cd01",
  "dispute": null,
  "purpose": "stage",
  "kind": "file",
  "type": "delivery_note",
  "label": null,
  "lineage_id": "evd_6543a1b2c3d4e5f6a7b8cd40",
  "supersedes": null,
  "status": "submitted",
  "file": { "name": "delivery-note-1142.pdf", "content_type": "application/pdf", "size_bytes": 182311, "sha256": "9b1c…64 hex" },
  "typed": { "document_reference": "DN-1142", "invoice_number": null, "invoice_date": null, "amount": null, "note": "Shingles and underlayment" },
  "uploaded_by": { "type": "party", "id": "pty_6543a1b2c3d4e5f6a7b8cb00", "role": "payee", "member": null },
  "review": null,
  "duplicate_of": [],
  "scan": { "status": "not_scanned" },
  "created_at": "2026-11-20T15:58:00.000Z",
  "updated_at": "2026-11-20T15:58:00.000Z"
}

Endpoints

POST/stages/:id/evidence

Credential
Member session or API key
Permission
evidence.upload
API key scope
evidence:write
Mode
scoped
Idempotency
honoured (the file digest is hashed)

Request

multipart/form-data with ONE file; type required (evidence vocabulary); optional document_reference (≤ 100), invoice_number (≤ 100), invoice_date (YYYY-MM-DD), amount (integer minor units), note (≤ 1000), supersedes (evd_ of the same stage).

Response

201 Evidence (status: submitted, uploaded_by: {type: member|api_key, member}).

Errors

upload errors; 409 duplicate_file (+ existing_evidence), invalid_state_transition (stage not open/submitted; or supersedes not submitted/accepted/rejected).

Record and events

evidence.uploaded (sha256, type, size; data.windowReset: true when the stage was submitted), evidence.superseded, risk_flag.raised (reuse/duplicate) · Events: evidence.uploaded.

Notes

computed before storage; key b2b/<tenant>/<mode>/mandates/<m>/stages/<s>/evidence/<e>/<sha256>.<ext> in the B2B evidence bucket. Uploading to a submitted stage resets its auto-approval window. Same hash, invoice number or document reference elsewhere for this tenant+mode → duplicate_of + flag evidence_reused / duplicate_document_reference (hard inputs to C15).

GET/stages/:id/evidence

Credential
Member session or API key
Permission
evidence.read
API key scope
evidence:read
Mode
scoped
Pagination
cursor

Request

status (multi; default all except withdrawn), type.

Response

200 ListResponse<Evidence>.

GET/evidence/:id

Credential
Member session or API key
Permission
evidence.read
API key scope
evidence:read
Mode
scoped

GET/evidence/:id/download

Credential
Member session or API key
Permission
evidence.read
API key scope
evidence:read
Mode
scoped

Response

200 Download (300 s).

Notes

downloads are logged (actor, evidence id), not recorded on the chain.

POST/evidence/:id/accept

Credential
Member session
Permission
evidence.review
Mode
scoped
Idempotency
honoured

Request

note string optional (≤ 1000).

Response

200 Evidence (accepted, review.via: member).

Errors

409 invalid_state_transition (not submitted, or the requirement's reviewer is the payer: current_state: "payer_review"), same_member_not_allowed (the caller uploaded it, or created the API key that did).

Record and events

evidence.accepted (via: member) (+ stage.approved with via: member_review when this completes the requirements of a stage without payer approval) · Events: evidence.accepted (+ stage.approved). - Notes: a stage approved by member review ALWAYS gets C17 on its release: approval by a different member with releases.approve who is neither the reviewer nor the uploader. Operators may review evidence but never complete an approval alone.

POST/evidence/:id/reject

Credential
Member session
Permission
evidence.review
Mode
scoped
Idempotency
honoured

Request

reason string required (10–1000; kept on the evidence row; the record carries its party-salted digest).

Response

200 Evidence (rejected).

Errors

409 invalid_state_transition (as accept), same_member_not_allowed.

Record and events

evidence.rejected (+ stage.changes_requested when the stage was submitted) · Events: evidence.rejected (+ stage.changes_requested).

POST/evidence/:id/withdraw

Credential
Member session or API key
Permission
evidence.upload
API key scope
evidence:write
Mode
scoped
Idempotency
honoured

Response

200 Evidence (withdrawn; the file is kept).

Errors

409 invalid_state_transition (reviewed, or uploaded by a party: only the uploader's side may withdraw).

Record and events

evidence.withdrawn.

Evidence · Holdyn Business docs