/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.
Kräver behörighet: documents:write
Headers
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.
Förfrågan multipart/form-data
ownerEmailstringobligatoriskWhere the receipt and the signed PDF are sent. Must contain an @.
post@firma.no
filesbinaryobligatoriskThe 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
Svar 200Document
The uploaded document
iduuidobligatoriskPass this as
documentIdwhen you create the signature request.filenamestringobligatoriskName of the first uploaded file.
avtale.pdf
sizeBytesintegerobligatoriskTotal size across every uploaded file.
184320
attachmentsobject[]obligatoriskOne entry per uploaded PDF.
positionintegerobligatorisk0-based. Also the order the PDFs are merged in.
filenamestringobligatoriskvedlegg.pdf
sizeBytesintegerobligatorisk92160
Felsvar
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.se/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"Svar
{
"id": "3f7c1e42-9b0a-4d7e-8c31-2a5f6b9d0e11",
"filename": "avtale.pdf",
"sizeBytes": 184320,
"attachments": [
{
"position": 0,
"filename": "vedlegg.pdf",
"sizeBytes": 92160
}
]
}