Skip to content

Create a new document from an existing template

POST
/api/v1/templates/{templateId}/generate-document
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.

templateId
required
string

Body

Media typeapplication/json
object
title
string
>= 1 characters
externalId
string
nullable
recipients
Array<object>
object
name
required
string
>= 1 characters
email
required
string format: email
>= 1 characters
role
string
default: SIGNER
Allowed values: CC SIGNER VIEWER APPROVER ASSISTANT
signingOrder
number
nullable
meta
object
subject
string
message
string
timezone

The timezone of the date. Must be one of the options listed in the list below.

string
default: Etc/UTC
Allowed values: Etc/UTC
dateFormat

The format of the date. Must be one of the options listed in the list below.

string
default: yyyy-MM-dd hh:mm a
redirectUrl
string
signingOrder
string
Allowed values: PARALLEL SEQUENTIAL
allowDictateNextSigner
boolean
language
string
Allowed values: es en
typedSignatureEnabled
boolean
default: true
uploadSignatureEnabled
boolean
default: true
drawSignatureEnabled
boolean
default: true
distributionMethod
string
Allowed values: EMAIL NONE
emailSettings
object
authOptions

Authentication options for the document.

object
globalAccessAuth

The type of authentication required for the recipient to access the document.

string
Allowed values: ACCOUNT
globalActionAuth

The type of authentication required for the recipient to sign the document.

string
Allowed values: ACCOUNT PASSKEY TWO_FACTOR_AUTH CLAVE_UNICA
formValues
object
key
additional properties
One of:
string

200

Media typeapplication/json
object
documentId
required
number
externalId
string
nullable
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"
}