Post an agreement to be signed
const url = 'https://sender.api.kivra.com/v1/tenant/example/agreement';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"subject":"Employment agreement","type":"agreement","vat_number":"SE556840226601","expiration_days":60,"original":{"name":"agreement1025.pdf","content_type":"application/pdf","data":"REVBREJFRUY="},"parties":[{"ssn":"197701032380","name":"Jan-Erik Karlsson","email":"je.karlsson@email.nu","role":"signer"},{"ssn":"198112172385","name":"Gustav Larsson","email":"gustav123@mymail.com","role":"delegate"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://sender.api.kivra.com/v1/tenant/example/agreement \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "subject": "Employment agreement", "type": "agreement", "vat_number": "SE556840226601", "expiration_days": 60, "original": { "name": "agreement1025.pdf", "content_type": "application/pdf", "data": "REVBREJFRUY=" }, "parties": [ { "ssn": "197701032380", "name": "Jan-Erik Karlsson", "email": "je.karlsson@email.nu", "role": "signer" }, { "ssn": "198112172385", "name": "Gustav Larsson", "email": "gustav123@mymail.com", "role": "delegate" } ] }'This resource is used to post an agreement to be signed by the recipients listed in the metadata. An Agreement ID will be returned. Note that the size of the agreement file cannot exceed 1MB.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The unique Key for a Tenant
Request Body
Section titled “Request Body”object
Name of the agreement
Example
Employment agreementThe type of content, for agreements always use ‘agreement’
Example
agreementA valid VAT-identifier, Swedish format: SE[xxxxxxxxxx]01
Example
SE556840226601Number of days an agreement will be available for signing, before expiring. The expiration_days must be between 7 and 180 days
Example
60object
Name of the document file
Example
agreement1025.pdfBase64-encoded data for the agreement PDF
Example
REVBREJFRUY=List of signers and delegates that are requested to sign the agreement
object
User’s unique SSN, format: YYYYMMDDnnnn
Example
197701032380Name of the user
Example
Jan-Erik KarlssonEmail to be used to contact the user
Example
je.karlsson.hem@email.nuThe role of the user in this signature flow
Example
signerExample
[ { "ssn": "197701032380", "name": "Jan-Erik Karlsson", "email": "je.karlsson@email.nu", "role": "signer" }, { "ssn": "198112172385", "name": "Gustav Larsson", "email": "gustav123@mymail.com", "role": "delegate" }]Responses
Section titled “Responses”Agreement created succesfully
Example
15544700816b7d63c83d6e476493879b5043ec9d7bAgreement PDF was invalid
object
The 5-digits error code
A short message explaining the error
A text message explaining the error
Example
{ "code": 40045, "short_message": "PDF was invalid", "long_message": "The supplied agreement PDF was invalid. Please check that the file is a valid PDF"}