Create a new document from an existing template
POST
/api/v1/templates/{templateId}/generate-document
const url = 'https://app.legaldoc.io/api/v1/templates/example/generate-document';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"title":"example","externalId":"example","recipients":[{"name":"example","email":"[email protected]","role":"CC","signingOrder":1}],"meta":{},"authOptions":{"globalAccessAuth":"ACCOUNT","globalActionAuth":"ACCOUNT"},"formValues":{"additionalProperty":"example"}}'};
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://app.legaldoc.io/api/v1/templates/example/generate-document \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "title": "example", "externalId": "example", "recipients": [ { "name": "example", "email": "[email protected]", "role": "CC", "signingOrder": 1 } ], "meta": {}, "authOptions": { "globalAccessAuth": "ACCOUNT", "globalActionAuth": "ACCOUNT" }, "formValues": { "additionalProperty": "example" } }'Create a new document from an existing template. Passing in values for title and meta will override the original values defined in the template. If you do not pass in values for recipients, it will use the values defined in the template.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”templateId
required
string
Request Body
Section titled “Request Body”Body
Media typeapplication/json
object
title
string
externalId
string
recipients
Array<object>
object
name
required
string
email
required
string format: email
role
string
signingOrder
number
meta
object
subject
string
message
string
timezone
The timezone of the date. Must be one of the options listed in the list below.
string
dateFormat
The format of the date. Must be one of the options listed in the list below.
string
redirectUrl
string
signingOrder
string
allowDictateNextSigner
boolean
language
string
typedSignatureEnabled
boolean
uploadSignatureEnabled
boolean
drawSignatureEnabled
boolean
distributionMethod
string
emailSettings
object
authOptions
Authentication options for the document.
object
globalAccessAuth
The type of authentication required for the recipient to access the document.
string
globalActionAuth
The type of authentication required for the recipient to sign the document.
string
Responses
Section titled “Responses”200
Media typeapplication/json
object
documentId
required
number
externalId
string
recipients
required
Array<object>
object
id
required
number
name
required
string
email
required
string
Examplegenerated
{ "documentId": 1, "externalId": "example", "recipients": [ { "id": 1, "name": "example", "email": "example" } ]}401
Media typeapplication/json
object
message
required
string
Examplegenerated
{ "message": "example"}404
Media typeapplication/json
object
message
required
string
Examplegenerated
{ "message": "example"}