PrimaryCheck

Files

A file is a customer document stored with its sha256 and attached, when you say so, to a subject and/or a verification. Uploads are multipart, up to 25 MB; the response carries a signed url good for about 15 minutes, and GET /v1/files/{id} mints a fresh one any time.

Upload

POST /v1/files            (multipart)
file=@nm-board-letter.pdf  purpose=credential_document  subjectId=sub_…  description="NM board letter"  metadata={"boardRef":"NMB-22"}
201 { "object": "file", "id": "file_…", "filename": "nm-board-letter.pdf", "contentType": "application/pdf", "size": 48213,
      "sha256": "…", "purpose": "credential_document", "subjectId": "sub_…", "verificationId": null,
      "description": "NM board letter", "metadata": { "boardRef": "NMB-22" }, "uploadedBy": "ana@example.com",
      "createdAt": "2026-11-08T22:40:11+00:00", "url": "https://api.primarycheck.com/v1/files/file_…/content?exp=…&sig=…",
      "urlExpiresAt": "2026-11-08T22:55:11+00:00", "deletedAt": null, "deletedBy": null }

purpose is one of credential_document, attestation, roster, letter or other (the default). Links are checked on your account. Scripted types such as HTML or SVG are stored and served as application/octet-stream, so a file never executes in a browser.

List, re-label, download, delete

GET    /v1/files?subjectId=sub_…&purpose=credential_document        newest first, keyset-paged
GET    /v1/subjects/sub_…/files
PATCH  /v1/files/file_…   { "purpose": "attestation", "subjectId": null }   null clears a link
GET    /v1/files/file_…/content                                        with your key, or through the signed url without one
DELETE /v1/files/file_…                                                bytes removed; the row stays with deletedAt (includeDeleted=true)

Deletes are hard for the bytes and soft for the row, so the audit trail keeps who uploaded what and when; a deleted file's link answers 410. Documents attached in match review (POST /v1/matches/{id}/documents) and credentialing packets are separate objects that belong to the match or request.

pc.files.upload("nm-board-letter.pdf", open("letter.pdf", "rb").read(), "application/pdf",
                purpose="credential_document", subject_id="sub_…", metadata={"boardRef": "NMB-22"})
for f in pc.files.list(subject_id="sub_…").auto_paging_iter(): print(f["filename"], f["sha256"])
pdf = pc.files.download("file_…")