file_id. All three steps are covered by the documents:write scope.
From a file to a document in flight
Step 1. Reserve the file
POST /developer/v1/files creates the record and returns the upload form.
size_bytes is the exact byte count. The signed policy rejects an object larger
than that, and _confirm compares what storage holds against what you declared.Step 2. Send the bytes to storage
Submit the form asmultipart/form-data: every entry of fields verbatim
first, the file last as the file part.
204 with no body. Do not send X-API-Key here — the
signature in the form already authorizes the request. The form is valid until
expires_at; after that, reserve the file again.
Step 3. Confirm the upload
Until the upload is confirmed, the file cannot be attached to a document.200, so
retrying after a timeout is safe.
Step 4. Create the document from the file
Passfile_id to POST /documents instead of template_id. The file becomes
the document’s PDF — exactly what approvers see and signers sign.
Limits
Nothing is converted: a DOCX or an image is rejected, and the file goes to
signing exactly as you sent it. Produce the PDF on your side.
Errors
A document created from a file gets no number automatically — numbering is tied
to templates. Pass
number in POST /documents if you need one.