/api/v1/documentsUpload the PDF(s) to be signed
Step one of every integration. Upload as multipart/form-data; the id you get back is what POST /signature_requests takes. An sk_test_ key produces a test-mode document, and a test document can only ever be signed by a test key.
Vaatii oikeuden: documents:write
Otsakkeet
Idempotency-KeystringMakes the write retry-safe: a retry with the same key replays the original response instead of creating a second signature request. Same key + a different body is a 422.
Pyyntö multipart/form-data
ownerEmailstringpakollinenWhere the receipt and the signed PDF are sent. Must contain an @.
post@firma.no
filesbinarypakollinenThe document. Repeat the field to upload several — they are merged in the order sent. PDF and Word (.docx) are accepted; a Word file is converted to PDF on upload. Older .doc, .odt and .rtf must be saved as .docx or PDF first. Per-file and per-request limits apply (25 MB per file, 10 files, by default).
templateSlugstringOptional. The /maler template the document was filled from — echoed on the completion surfaces.
leieavtale
Vastaus 200Document
The uploaded document
iduuidpakollinenPass this as
documentIdwhen you create the signature request.filenamestringpakollinenName of the first uploaded file.
avtale.pdf
sizeBytesintegerpakollinenTotal size across every uploaded file.
184320
attachmentsobject[]pakollinenOne entry per uploaded PDF.
positionintegerpakollinen0-based. Also the order the PDFs are merged in.
filenamestringpakollinenvedlegg.pdf
sizeBytesintegerpakollinen92160
Virhevastaukset
400The upload failed validation —errorcarries the sentence, e.g.pdf or word (.docx) files only,<name> must be saved as .docx or pdf first,ownerEmail required.401unauthorized— no API key, or it has been revoked.403insufficient_scope— the key is valid but was not granted the scope this endpoint declares.409idempotency_key_in_progress— the first request with this Idempotency-Key is still running. Retry.413A file exceeded the per-file size limit, or converting it to PDF produced a file that does.422A Word file could not be converted to PDF — it is damaged or password-protected.429too_many_requests— rate limited. Retry after theRetry-Afterheader.503Maintenance. New uploads and signature requests are paused; existing ones keep running.
curl https://esigner.fi/api/v1/documents \
-X POST \
-H "Authorization: Bearer $ESIGNER_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-F "ownerEmail=post@firma.no" \
-F "files=@avtale.pdf;type=application/pdf"Vastaus
{
"id": "3f7c1e42-9b0a-4d7e-8c31-2a5f6b9d0e11",
"filename": "avtale.pdf",
"sizeBytes": 184320,
"attachments": [
{
"position": 0,
"filename": "vedlegg.pdf",
"sizeBytes": 92160
}
]
}