Attachments

Finalize an upload

POST/v1/attachments/{id}/finalize

Admits the uploaded object once scanned. Idempotent.

API key · or dashboard session.

Request

Shell
curl -fsS -X POST "$API/v1/attachments/att_0198f80c-…/finalize" \
  -H "Authorization: Bearer $PAYDAY_API_KEY"

Response

200 OK
{
  "id": "att_0198f80c-8d2f-7dc1-a369-90556a64f700",
  "filename": "INV-1042.pdf",
  "mime_type": "application/pdf",
  "byte_length": "48211",
  "sha256": "0x9f…"
}

Payday hashes the stored bytes and pins the admitted object version. Client-supplied MIME types, extensions, and digests are ignored. Rejected objects are deleted. Unattached uploads are deleted after seven days.

Path parameters

idatt_ idrequired

Response

idatt_ id
Use as attachment_id.
filename, mime_typestring
mime_type is application/pdf.
byte_lengthstring
Decimal. 1 to 5,242,880.
sha256string
0x hex.

Status codes

  • 200
  • 409attachment_scan_pending Scan not reported. Retry with backoff.
  • 409attachment_not_ready No object at upload_url.
  • 422attachment_rejected Not application/pdf, outside 1 B–5 MiB, missing %PDF- header, or flagged. Object deleted.