diff --git a/docs/api/csharp.md b/docs/api/csharp.md index 8df5aeb5..2d4d56a7 100644 --- a/docs/api/csharp.md +++ b/docs/api/csharp.md @@ -523,6 +523,15 @@ var response = client.Execute(request); "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -598,14 +607,45 @@ var response = client.Execute(request); "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1025,10 +1065,6 @@ var response = client.Execute(request); "type": "string", "description": "Specify Reply-To address to use in the notification emails." }, - "completed_redirect_url": { - "type": "string", - "description": "Submitter specific URL to redirect to after the submission completion." - }, "completed": { "type": "boolean", "description": "Pass `true` to mark submitter as completed and auto-signed via API." @@ -1038,6 +1074,15 @@ var response = client.Execute(request); "description": "Metadata object with additional submitter information.", "example": "{ \"customField\": \"value\" }" }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -1105,14 +1150,45 @@ var response = client.Execute(request); "type": "boolean", "description": "Set `true` to make the field required." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1775,6 +1851,46 @@ var response = client.Execute(request); "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -2253,7 +2369,7 @@ var response = client.Execute(request); ### Create a submission from PDF -The API endpoint provides the functionality to create one-off submission request from a PDF or DOCX file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form +The API endpoint provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form ```csharp @@ -2531,6 +2647,15 @@ var response = client.Execute(request); "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -2593,14 +2718,45 @@ var response = client.Execute(request); "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -2946,6 +3102,15 @@ var response = client.Execute(request); "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -3008,14 +3173,45 @@ var response = client.Execute(request); "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3323,6 +3519,46 @@ var response = client.Execute(request); "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -3439,3 +3675,433 @@ var response = client.Execute(request); } ``` +### Create a submission from DOCX + +The API endpoint provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and list. You can also use the {{signature}} fillable field syntax to define fillable fields, as in a PDF.
Related Guides
Use embedded text field tags to create a fillable form + +```csharp +var client = new RestClient("https://api.docuseal.com/submissions/docx"); +var request = new RestRequest("", Method.Post); +request.AddHeader("X-Auth-Token", "API_KEY"); +request.AddHeader("content-type", "application/json"); +request.AddParameter("application/json", "{\"name\":\"Test Submission Document\",\"variables\":{\"variable_name\":\"value\"},\"documents\":[{\"name\":\"string\",\"file\":\"base64\"}],\"submitters\":[{\"role\":\"First Party\",\"email\":\"john.doe@example.com\"}]}", ParameterType.RequestBody); +var response = client.Execute(request); +``` + +```json +{ + "security": [ + { + "AuthToken": [] + } + ], + "tags": [ + "Submissions" + ], + "summary": "Create a submission from DOCX", + "operationId": "createSubmissionFromDocx", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "documents", + "submitters" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document submission.", + "example": "Test Submission Document" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "variables": { + "type": "object", + "description": "Dynamic content variables object", + "example": { + "variable_name": "value" + } + }, + "order": { + "type": "string", + "description": "Pass 'random' to send signature request emails to all parties right away. The order is 'preserved' by default so the second party will receive a signature request email only after the document is signed by the first party.", + "default": "preserved", + "enum": [ + "preserved", + "random" + ] + }, + "completed_redirect_url": { + "type": "string", + "description": "Specify URL to redirect to after the submission completion." + }, + "bcc_completed": { + "type": "string", + "description": "Specify BCC address to send signed documents to after the completion." + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails." + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "template_ids": { + "type": "array", + "description": "An optional array of template IDs to use in the submission along with the provided documents. This can be used to create multi-document submissions when some of the required documents exist within templates.", + "items": { + "type": "integer", + "description": "The ID of the template to use for the submission." + } + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "file" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document." + }, + "file": { + "example": "base64", + "type": "string", + "format": "base64", + "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + }, + "position": { + "type": "integer", + "description": "Document position in the submission. If not specified, the document will be added in the order it appears in the documents array." + } + } + } + }, + "submitters": { + "type": "array", + "description": "The list of submitters for the submission.", + "items": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the submitter." + }, + "role": { + "type": "string", + "description": "The role name or title of the submitter.", + "example": "First Party" + }, + "email": { + "type": "string", + "description": "The email address of the submitter.", + "format": "email", + "example": "john.doe@example.com" + }, + "phone": { + "type": "string", + "description": "The phone number of the submitter, formatted according to the E.164 standard.", + "example": "+1234567890" + }, + "values": { + "type": "object", + "description": "An object with pre-filled values for the submission. Use field names for keys of the object. For more configurations see `fields` param." + }, + "external_id": { + "type": "string", + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "completed": { + "type": "boolean", + "description": "Pass `true` to mark submitter as completed and auto-signed via API." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information.", + "example": "{ \"customField\": \"value\" }" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending only for this submitter.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails for this submitter." + }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, + "fields": { + "type": "array", + "description": "A list of configurations for document form fields.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Document field name.", + "example": "First Name" + }, + "default_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ], + "description": "Default value of the field. Use base64 encoded file or a public URL to the image file to set default signature or image fields.", + "example": "Acme" + }, + "readonly": { + "type": "boolean", + "description": "Set `true` to make it impossible for the submitter to edit predefined field value.", + "default": false + }, + "required": { + "type": "boolean", + "description": "Set `true` to make the field required." + }, + "title": { + "type": "string", + "description": "Field title displayed to the user instead of the name, shown on the signing form. Supports Markdown." + }, + "description": { + "type": "string", + "description": "Field description displayed on the signing form. Supports Markdown." + }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels.", + "example": 12 + }, + "font_type": { + "type": "string", + "description": "Font type of the field value.", + "enum": [ + "bold", + "italic", + "bold_italic" + ] + }, + "font": { + "type": "string", + "description": "Font family of the field value.", + "enum": [ + "Times", + "Helvetica", + "Courier" + ] + }, + "color": { + "type": "string", + "description": "Font color of the field value.", + "enum": [ + "black", + "white", + "blue" + ], + "default": "black" + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value.", + "enum": [ + "left", + "center", + "right" + ], + "default": "left" + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value.", + "enum": [ + "top", + "center", + "bottom" + ], + "default": "center" + }, + "format": { + "type": "string", + "description": "The data format for different field types.
- Date field: accepts formats such as DD/MM/YYYY (default: MM/DD/YYYY).
- Signature field: accepts drawn, typed, drawn_or_typed (default), or upload.
- Number field: accepts currency formats such as usd, eur, gbp.", + "example": "DD/MM/YYYY" + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields.", + "example": 99.99 + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields.", + "enum": [ + "USD", + "EUR", + "GBP", + "CAD", + "AUD" + ], + "default": "USD" + }, + "mask": { + "description": "Set `true` to make sensitive data masked on the document.", + "oneOf": [ + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": false + } + } + } + } + } + }, + "roles": { + "type": "array", + "description": "A list of roles for the submitter. Use this param to merge multiple roles into one submitter.", + "items": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Custom signature request email subject." + }, + "body": { + "type": "string", + "description": "Custom signature request email body. Can include the following variables: {{submission.name}}, {{submitter.link}}, {{account.name}}." + } + } + }, + "merge_documents": { + "type": "boolean", + "description": "Set `true` to merge the documents into a single PDF file.", + "default": false + }, + "remove_tags": { + "type": "boolean", + "description": "Pass `false` to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.", + "default": true + } + } + } + } + } + } +} +``` + diff --git a/docs/api/go.md b/docs/api/go.md index 83db964f..c0622ea8 100644 --- a/docs/api/go.md +++ b/docs/api/go.md @@ -653,6 +653,15 @@ func main() { "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -728,14 +737,45 @@ func main() { "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1285,10 +1325,6 @@ func main() { "type": "string", "description": "Specify Reply-To address to use in the notification emails." }, - "completed_redirect_url": { - "type": "string", - "description": "Submitter specific URL to redirect to after the submission completion." - }, "completed": { "type": "boolean", "description": "Pass `true` to mark submitter as completed and auto-signed via API." @@ -1298,6 +1334,15 @@ func main() { "description": "Metadata object with additional submitter information.", "example": "{ \"customField\": \"value\" }" }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -1365,14 +1410,45 @@ func main() { "type": "boolean", "description": "Set `true` to make the field required." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -2148,6 +2224,46 @@ func main() { "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -2672,7 +2788,7 @@ func main() { ### Create a submission from PDF -The API endpoint provides the functionality to create one-off submission request from a PDF or DOCX file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form +The API endpoint provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form ```go @@ -2973,6 +3089,15 @@ func main() { "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -3035,14 +3160,45 @@ func main() { "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3411,6 +3567,15 @@ func main() { "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -3473,14 +3638,45 @@ func main() { "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3811,6 +4007,46 @@ func main() { "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -3927,3 +4163,456 @@ func main() { } ``` +### Create a submission from DOCX + +The API endpoint provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and list. You can also use the {{signature}} fillable field syntax to define fillable fields, as in a PDF.
Related Guides
Use embedded text field tags to create a fillable form + +```go +package main + +import ( + "fmt" + "strings" + "net/http" + "io" +) + +func main() { + + url := "https://api.docuseal.com/submissions/docx" + + payload := strings.NewReader("{\"name\":\"Test Submission Document\",\"variables\":{\"variable_name\":\"value\"},\"documents\":[{\"name\":\"string\",\"file\":\"base64\"}],\"submitters\":[{\"role\":\"First Party\",\"email\":\"john.doe@example.com\"}]}") + + req, _ := http.NewRequest("POST", url, payload) + + req.Header.Add("X-Auth-Token", "API_KEY") + req.Header.Add("content-type", "application/json") + + res, _ := http.DefaultClient.Do(req) + + defer res.Body.Close() + body, _ := io.ReadAll(res.Body) + + fmt.Println(res) + fmt.Println(string(body)) + +} +``` + +```json +{ + "security": [ + { + "AuthToken": [] + } + ], + "tags": [ + "Submissions" + ], + "summary": "Create a submission from DOCX", + "operationId": "createSubmissionFromDocx", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "documents", + "submitters" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document submission.", + "example": "Test Submission Document" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "variables": { + "type": "object", + "description": "Dynamic content variables object", + "example": { + "variable_name": "value" + } + }, + "order": { + "type": "string", + "description": "Pass 'random' to send signature request emails to all parties right away. The order is 'preserved' by default so the second party will receive a signature request email only after the document is signed by the first party.", + "default": "preserved", + "enum": [ + "preserved", + "random" + ] + }, + "completed_redirect_url": { + "type": "string", + "description": "Specify URL to redirect to after the submission completion." + }, + "bcc_completed": { + "type": "string", + "description": "Specify BCC address to send signed documents to after the completion." + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails." + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "template_ids": { + "type": "array", + "description": "An optional array of template IDs to use in the submission along with the provided documents. This can be used to create multi-document submissions when some of the required documents exist within templates.", + "items": { + "type": "integer", + "description": "The ID of the template to use for the submission." + } + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "file" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document." + }, + "file": { + "example": "base64", + "type": "string", + "format": "base64", + "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + }, + "position": { + "type": "integer", + "description": "Document position in the submission. If not specified, the document will be added in the order it appears in the documents array." + } + } + } + }, + "submitters": { + "type": "array", + "description": "The list of submitters for the submission.", + "items": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the submitter." + }, + "role": { + "type": "string", + "description": "The role name or title of the submitter.", + "example": "First Party" + }, + "email": { + "type": "string", + "description": "The email address of the submitter.", + "format": "email", + "example": "john.doe@example.com" + }, + "phone": { + "type": "string", + "description": "The phone number of the submitter, formatted according to the E.164 standard.", + "example": "+1234567890" + }, + "values": { + "type": "object", + "description": "An object with pre-filled values for the submission. Use field names for keys of the object. For more configurations see `fields` param." + }, + "external_id": { + "type": "string", + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "completed": { + "type": "boolean", + "description": "Pass `true` to mark submitter as completed and auto-signed via API." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information.", + "example": "{ \"customField\": \"value\" }" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending only for this submitter.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails for this submitter." + }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, + "fields": { + "type": "array", + "description": "A list of configurations for document form fields.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Document field name.", + "example": "First Name" + }, + "default_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ], + "description": "Default value of the field. Use base64 encoded file or a public URL to the image file to set default signature or image fields.", + "example": "Acme" + }, + "readonly": { + "type": "boolean", + "description": "Set `true` to make it impossible for the submitter to edit predefined field value.", + "default": false + }, + "required": { + "type": "boolean", + "description": "Set `true` to make the field required." + }, + "title": { + "type": "string", + "description": "Field title displayed to the user instead of the name, shown on the signing form. Supports Markdown." + }, + "description": { + "type": "string", + "description": "Field description displayed on the signing form. Supports Markdown." + }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels.", + "example": 12 + }, + "font_type": { + "type": "string", + "description": "Font type of the field value.", + "enum": [ + "bold", + "italic", + "bold_italic" + ] + }, + "font": { + "type": "string", + "description": "Font family of the field value.", + "enum": [ + "Times", + "Helvetica", + "Courier" + ] + }, + "color": { + "type": "string", + "description": "Font color of the field value.", + "enum": [ + "black", + "white", + "blue" + ], + "default": "black" + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value.", + "enum": [ + "left", + "center", + "right" + ], + "default": "left" + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value.", + "enum": [ + "top", + "center", + "bottom" + ], + "default": "center" + }, + "format": { + "type": "string", + "description": "The data format for different field types.
- Date field: accepts formats such as DD/MM/YYYY (default: MM/DD/YYYY).
- Signature field: accepts drawn, typed, drawn_or_typed (default), or upload.
- Number field: accepts currency formats such as usd, eur, gbp.", + "example": "DD/MM/YYYY" + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields.", + "example": 99.99 + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields.", + "enum": [ + "USD", + "EUR", + "GBP", + "CAD", + "AUD" + ], + "default": "USD" + }, + "mask": { + "description": "Set `true` to make sensitive data masked on the document.", + "oneOf": [ + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": false + } + } + } + } + } + }, + "roles": { + "type": "array", + "description": "A list of roles for the submitter. Use this param to merge multiple roles into one submitter.", + "items": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Custom signature request email subject." + }, + "body": { + "type": "string", + "description": "Custom signature request email body. Can include the following variables: {{submission.name}}, {{submitter.link}}, {{account.name}}." + } + } + }, + "merge_documents": { + "type": "boolean", + "description": "Set `true` to merge the documents into a single PDF file.", + "default": false + }, + "remove_tags": { + "type": "boolean", + "description": "Pass `false` to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.", + "default": true + } + } + } + } + } + } +} +``` + diff --git a/docs/api/java.md b/docs/api/java.md index ca3df371..83375022 100644 --- a/docs/api/java.md +++ b/docs/api/java.md @@ -517,6 +517,15 @@ HttpResponse response = Unirest.post("https://api.docuseal.com/submissio "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -592,14 +601,45 @@ HttpResponse response = Unirest.post("https://api.docuseal.com/submissio "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1013,10 +1053,6 @@ HttpResponse response = Unirest.put("https://api.docuseal.com/submitters "type": "string", "description": "Specify Reply-To address to use in the notification emails." }, - "completed_redirect_url": { - "type": "string", - "description": "Submitter specific URL to redirect to after the submission completion." - }, "completed": { "type": "boolean", "description": "Pass `true` to mark submitter as completed and auto-signed via API." @@ -1026,6 +1062,15 @@ HttpResponse response = Unirest.put("https://api.docuseal.com/submitters "description": "Metadata object with additional submitter information.", "example": "{ \"customField\": \"value\" }" }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -1093,14 +1138,45 @@ HttpResponse response = Unirest.put("https://api.docuseal.com/submitters "type": "boolean", "description": "Set `true` to make the field required." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1758,6 +1834,46 @@ HttpResponse response = Unirest.post("https://api.docuseal.com/templates "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -2234,7 +2350,7 @@ HttpResponse response = Unirest.post("https://api.docuseal.com/templates ### Create a submission from PDF -The API endpoint provides the functionality to create one-off submission request from a PDF or DOCX file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form +The API endpoint provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form ```java @@ -2511,6 +2627,15 @@ HttpResponse response = Unirest.post("https://api.docuseal.com/submissio "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -2573,14 +2698,45 @@ HttpResponse response = Unirest.post("https://api.docuseal.com/submissio "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -2925,6 +3081,15 @@ HttpResponse response = Unirest.post("https://api.docuseal.com/submissio "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -2987,14 +3152,45 @@ HttpResponse response = Unirest.post("https://api.docuseal.com/submissio "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3301,6 +3497,46 @@ HttpResponse response = Unirest.post("https://api.docuseal.com/templates "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -3417,3 +3653,432 @@ HttpResponse response = Unirest.post("https://api.docuseal.com/templates } ``` +### Create a submission from DOCX + +The API endpoint provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and list. You can also use the {{signature}} fillable field syntax to define fillable fields, as in a PDF.
Related Guides
Use embedded text field tags to create a fillable form + +```java +HttpResponse response = Unirest.post("https://api.docuseal.com/submissions/docx") + .header("X-Auth-Token", "API_KEY") + .header("content-type", "application/json") + .body("{\"name\":\"Test Submission Document\",\"variables\":{\"variable_name\":\"value\"},\"documents\":[{\"name\":\"string\",\"file\":\"base64\"}],\"submitters\":[{\"role\":\"First Party\",\"email\":\"john.doe@example.com\"}]}") + .asString(); +``` + +```json +{ + "security": [ + { + "AuthToken": [] + } + ], + "tags": [ + "Submissions" + ], + "summary": "Create a submission from DOCX", + "operationId": "createSubmissionFromDocx", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "documents", + "submitters" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document submission.", + "example": "Test Submission Document" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "variables": { + "type": "object", + "description": "Dynamic content variables object", + "example": { + "variable_name": "value" + } + }, + "order": { + "type": "string", + "description": "Pass 'random' to send signature request emails to all parties right away. The order is 'preserved' by default so the second party will receive a signature request email only after the document is signed by the first party.", + "default": "preserved", + "enum": [ + "preserved", + "random" + ] + }, + "completed_redirect_url": { + "type": "string", + "description": "Specify URL to redirect to after the submission completion." + }, + "bcc_completed": { + "type": "string", + "description": "Specify BCC address to send signed documents to after the completion." + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails." + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "template_ids": { + "type": "array", + "description": "An optional array of template IDs to use in the submission along with the provided documents. This can be used to create multi-document submissions when some of the required documents exist within templates.", + "items": { + "type": "integer", + "description": "The ID of the template to use for the submission." + } + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "file" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document." + }, + "file": { + "example": "base64", + "type": "string", + "format": "base64", + "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + }, + "position": { + "type": "integer", + "description": "Document position in the submission. If not specified, the document will be added in the order it appears in the documents array." + } + } + } + }, + "submitters": { + "type": "array", + "description": "The list of submitters for the submission.", + "items": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the submitter." + }, + "role": { + "type": "string", + "description": "The role name or title of the submitter.", + "example": "First Party" + }, + "email": { + "type": "string", + "description": "The email address of the submitter.", + "format": "email", + "example": "john.doe@example.com" + }, + "phone": { + "type": "string", + "description": "The phone number of the submitter, formatted according to the E.164 standard.", + "example": "+1234567890" + }, + "values": { + "type": "object", + "description": "An object with pre-filled values for the submission. Use field names for keys of the object. For more configurations see `fields` param." + }, + "external_id": { + "type": "string", + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "completed": { + "type": "boolean", + "description": "Pass `true` to mark submitter as completed and auto-signed via API." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information.", + "example": "{ \"customField\": \"value\" }" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending only for this submitter.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails for this submitter." + }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, + "fields": { + "type": "array", + "description": "A list of configurations for document form fields.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Document field name.", + "example": "First Name" + }, + "default_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ], + "description": "Default value of the field. Use base64 encoded file or a public URL to the image file to set default signature or image fields.", + "example": "Acme" + }, + "readonly": { + "type": "boolean", + "description": "Set `true` to make it impossible for the submitter to edit predefined field value.", + "default": false + }, + "required": { + "type": "boolean", + "description": "Set `true` to make the field required." + }, + "title": { + "type": "string", + "description": "Field title displayed to the user instead of the name, shown on the signing form. Supports Markdown." + }, + "description": { + "type": "string", + "description": "Field description displayed on the signing form. Supports Markdown." + }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels.", + "example": 12 + }, + "font_type": { + "type": "string", + "description": "Font type of the field value.", + "enum": [ + "bold", + "italic", + "bold_italic" + ] + }, + "font": { + "type": "string", + "description": "Font family of the field value.", + "enum": [ + "Times", + "Helvetica", + "Courier" + ] + }, + "color": { + "type": "string", + "description": "Font color of the field value.", + "enum": [ + "black", + "white", + "blue" + ], + "default": "black" + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value.", + "enum": [ + "left", + "center", + "right" + ], + "default": "left" + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value.", + "enum": [ + "top", + "center", + "bottom" + ], + "default": "center" + }, + "format": { + "type": "string", + "description": "The data format for different field types.
- Date field: accepts formats such as DD/MM/YYYY (default: MM/DD/YYYY).
- Signature field: accepts drawn, typed, drawn_or_typed (default), or upload.
- Number field: accepts currency formats such as usd, eur, gbp.", + "example": "DD/MM/YYYY" + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields.", + "example": 99.99 + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields.", + "enum": [ + "USD", + "EUR", + "GBP", + "CAD", + "AUD" + ], + "default": "USD" + }, + "mask": { + "description": "Set `true` to make sensitive data masked on the document.", + "oneOf": [ + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": false + } + } + } + } + } + }, + "roles": { + "type": "array", + "description": "A list of roles for the submitter. Use this param to merge multiple roles into one submitter.", + "items": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Custom signature request email subject." + }, + "body": { + "type": "string", + "description": "Custom signature request email body. Can include the following variables: {{submission.name}}, {{submitter.link}}, {{account.name}}." + } + } + }, + "merge_documents": { + "type": "boolean", + "description": "Set `true` to merge the documents into a single PDF file.", + "default": false + }, + "remove_tags": { + "type": "boolean", + "description": "Pass `false` to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.", + "default": true + } + } + } + } + } + } +} +``` + diff --git a/docs/api/javascript.md b/docs/api/javascript.md index 0fea7231..c0635531 100644 --- a/docs/api/javascript.md +++ b/docs/api/javascript.md @@ -537,6 +537,15 @@ const submission = await docuseal.createSubmission({ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -612,14 +621,45 @@ const submission = await docuseal.createSubmission({ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1052,10 +1092,6 @@ const submitter = await docuseal.updateSubmitter(500001, { "type": "string", "description": "Specify Reply-To address to use in the notification emails." }, - "completed_redirect_url": { - "type": "string", - "description": "Submitter specific URL to redirect to after the submission completion." - }, "completed": { "type": "boolean", "description": "Pass `true` to mark submitter as completed and auto-signed via API." @@ -1065,6 +1101,15 @@ const submitter = await docuseal.updateSubmitter(500001, { "description": "Metadata object with additional submitter information.", "example": "{ \"customField\": \"value\" }" }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -1132,14 +1177,45 @@ const submitter = await docuseal.updateSubmitter(500001, { "type": "boolean", "description": "Set `true` to make the field required." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1826,6 +1902,46 @@ const template = await docuseal.createTemplateFromDocx({ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -2330,7 +2446,7 @@ const template = await docuseal.mergeTemplates({ ### Create a submission from PDF -The API endpoint provides the functionality to create one-off submission request from a PDF or DOCX file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form +The API endpoint provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form ```javascript @@ -2635,6 +2751,15 @@ const submission = await docuseal.createSubmissionFromPdf({ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -2697,14 +2822,45 @@ const submission = await docuseal.createSubmissionFromPdf({ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3071,6 +3227,15 @@ and typesetting industry

"type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -3133,14 +3298,45 @@ and typesetting industry

"type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3469,6 +3665,46 @@ const template = await docuseal.createTemplateFromPdf({ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -3585,3 +3821,449 @@ const template = await docuseal.createTemplateFromPdf({ } ``` +### Create a submission from DOCX + +The API endpoint provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and list. You can also use the {{signature}} fillable field syntax to define fillable fields, as in a PDF.
Related Guides
Use embedded text field tags to create a fillable form + +```javascript +const docuseal = require("@docuseal/api"); + +docuseal.configure({ key: "API_KEY", url: "https://api.docuseal.com" }); + +const submission = await docuseal.createSubmissionFromDocx({ + name: "Test Submission Document", + variables: { + variable_name: "value" + }, + documents: [ + { + name: "string", + file: "base64" + } + ], + submitters: [ + { + role: "First Party", + email: "john.doe@example.com" + } + ] +}); +``` + +```json +{ + "security": [ + { + "AuthToken": [] + } + ], + "tags": [ + "Submissions" + ], + "summary": "Create a submission from DOCX", + "operationId": "createSubmissionFromDocx", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "documents", + "submitters" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document submission.", + "example": "Test Submission Document" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "variables": { + "type": "object", + "description": "Dynamic content variables object", + "example": { + "variable_name": "value" + } + }, + "order": { + "type": "string", + "description": "Pass 'random' to send signature request emails to all parties right away. The order is 'preserved' by default so the second party will receive a signature request email only after the document is signed by the first party.", + "default": "preserved", + "enum": [ + "preserved", + "random" + ] + }, + "completed_redirect_url": { + "type": "string", + "description": "Specify URL to redirect to after the submission completion." + }, + "bcc_completed": { + "type": "string", + "description": "Specify BCC address to send signed documents to after the completion." + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails." + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "template_ids": { + "type": "array", + "description": "An optional array of template IDs to use in the submission along with the provided documents. This can be used to create multi-document submissions when some of the required documents exist within templates.", + "items": { + "type": "integer", + "description": "The ID of the template to use for the submission." + } + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "file" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document." + }, + "file": { + "example": "base64", + "type": "string", + "format": "base64", + "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + }, + "position": { + "type": "integer", + "description": "Document position in the submission. If not specified, the document will be added in the order it appears in the documents array." + } + } + } + }, + "submitters": { + "type": "array", + "description": "The list of submitters for the submission.", + "items": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the submitter." + }, + "role": { + "type": "string", + "description": "The role name or title of the submitter.", + "example": "First Party" + }, + "email": { + "type": "string", + "description": "The email address of the submitter.", + "format": "email", + "example": "john.doe@example.com" + }, + "phone": { + "type": "string", + "description": "The phone number of the submitter, formatted according to the E.164 standard.", + "example": "+1234567890" + }, + "values": { + "type": "object", + "description": "An object with pre-filled values for the submission. Use field names for keys of the object. For more configurations see `fields` param." + }, + "external_id": { + "type": "string", + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "completed": { + "type": "boolean", + "description": "Pass `true` to mark submitter as completed and auto-signed via API." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information.", + "example": "{ \"customField\": \"value\" }" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending only for this submitter.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails for this submitter." + }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, + "fields": { + "type": "array", + "description": "A list of configurations for document form fields.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Document field name.", + "example": "First Name" + }, + "default_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ], + "description": "Default value of the field. Use base64 encoded file or a public URL to the image file to set default signature or image fields.", + "example": "Acme" + }, + "readonly": { + "type": "boolean", + "description": "Set `true` to make it impossible for the submitter to edit predefined field value.", + "default": false + }, + "required": { + "type": "boolean", + "description": "Set `true` to make the field required." + }, + "title": { + "type": "string", + "description": "Field title displayed to the user instead of the name, shown on the signing form. Supports Markdown." + }, + "description": { + "type": "string", + "description": "Field description displayed on the signing form. Supports Markdown." + }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels.", + "example": 12 + }, + "font_type": { + "type": "string", + "description": "Font type of the field value.", + "enum": [ + "bold", + "italic", + "bold_italic" + ] + }, + "font": { + "type": "string", + "description": "Font family of the field value.", + "enum": [ + "Times", + "Helvetica", + "Courier" + ] + }, + "color": { + "type": "string", + "description": "Font color of the field value.", + "enum": [ + "black", + "white", + "blue" + ], + "default": "black" + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value.", + "enum": [ + "left", + "center", + "right" + ], + "default": "left" + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value.", + "enum": [ + "top", + "center", + "bottom" + ], + "default": "center" + }, + "format": { + "type": "string", + "description": "The data format for different field types.
- Date field: accepts formats such as DD/MM/YYYY (default: MM/DD/YYYY).
- Signature field: accepts drawn, typed, drawn_or_typed (default), or upload.
- Number field: accepts currency formats such as usd, eur, gbp.", + "example": "DD/MM/YYYY" + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields.", + "example": 99.99 + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields.", + "enum": [ + "USD", + "EUR", + "GBP", + "CAD", + "AUD" + ], + "default": "USD" + }, + "mask": { + "description": "Set `true` to make sensitive data masked on the document.", + "oneOf": [ + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": false + } + } + } + } + } + }, + "roles": { + "type": "array", + "description": "A list of roles for the submitter. Use this param to merge multiple roles into one submitter.", + "items": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Custom signature request email subject." + }, + "body": { + "type": "string", + "description": "Custom signature request email body. Can include the following variables: {{submission.name}}, {{submitter.link}}, {{account.name}}." + } + } + }, + "merge_documents": { + "type": "boolean", + "description": "Set `true` to merge the documents into a single PDF file.", + "default": false + }, + "remove_tags": { + "type": "boolean", + "description": "Pass `false` to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.", + "default": true + } + } + } + } + } + } +} +``` + diff --git a/docs/api/nodejs.md b/docs/api/nodejs.md index 3b099a3a..d5865715 100644 --- a/docs/api/nodejs.md +++ b/docs/api/nodejs.md @@ -569,6 +569,15 @@ const submitters = await resp.json(); "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -644,14 +653,45 @@ const submitters = await resp.json(); "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1116,10 +1156,6 @@ const submitter = await resp.json(); "type": "string", "description": "Specify Reply-To address to use in the notification emails." }, - "completed_redirect_url": { - "type": "string", - "description": "Submitter specific URL to redirect to after the submission completion." - }, "completed": { "type": "boolean", "description": "Pass `true` to mark submitter as completed and auto-signed via API." @@ -1129,6 +1165,15 @@ const submitter = await resp.json(); "description": "Metadata object with additional submitter information.", "example": "{ \"customField\": \"value\" }" }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -1196,14 +1241,45 @@ const submitter = await resp.json(); "type": "boolean", "description": "Set `true` to make the field required." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1919,6 +1995,46 @@ const template = await resp.json(); "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -2435,7 +2551,7 @@ const template = await resp.json(); ### Create a submission from PDF -The API endpoint provides the functionality to create one-off submission request from a PDF or DOCX file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form +The API endpoint provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form ```nodejs @@ -2746,6 +2862,15 @@ const submission = await resp.json(); "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -2808,14 +2933,45 @@ const submission = await resp.json(); "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3188,6 +3344,15 @@ const submission = await resp.json(); "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -3250,14 +3415,45 @@ const submission = await resp.json(); "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3592,6 +3788,46 @@ const template = await resp.json(); "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -3708,3 +3944,455 @@ const template = await resp.json(); } ``` +### Create a submission from DOCX + +The API endpoint provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and list. You can also use the {{signature}} fillable field syntax to define fillable fields, as in a PDF.
Related Guides
Use embedded text field tags to create a fillable form + +```nodejs +const fetch = require("node-fetch"); + +const resp = await fetch("https://api.docuseal.com/submissions/docx", { + method: "POST", + headers: { + "X-Auth-Token": "API_KEY" + }, + body: JSON.stringify({ + name: "Test Submission Document", + variables: { + variable_name: "value" + }, + documents: [ + { + name: "string", + file: "base64" + } + ], + submitters: [ + { + role: "First Party", + email: "john.doe@example.com" + } + ] + }) +}); + +const submitters = await resp.json(); +``` + +```json +{ + "security": [ + { + "AuthToken": [] + } + ], + "tags": [ + "Submissions" + ], + "summary": "Create a submission from DOCX", + "operationId": "createSubmissionFromDocx", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "documents", + "submitters" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document submission.", + "example": "Test Submission Document" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "variables": { + "type": "object", + "description": "Dynamic content variables object", + "example": { + "variable_name": "value" + } + }, + "order": { + "type": "string", + "description": "Pass 'random' to send signature request emails to all parties right away. The order is 'preserved' by default so the second party will receive a signature request email only after the document is signed by the first party.", + "default": "preserved", + "enum": [ + "preserved", + "random" + ] + }, + "completed_redirect_url": { + "type": "string", + "description": "Specify URL to redirect to after the submission completion." + }, + "bcc_completed": { + "type": "string", + "description": "Specify BCC address to send signed documents to after the completion." + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails." + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "template_ids": { + "type": "array", + "description": "An optional array of template IDs to use in the submission along with the provided documents. This can be used to create multi-document submissions when some of the required documents exist within templates.", + "items": { + "type": "integer", + "description": "The ID of the template to use for the submission." + } + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "file" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document." + }, + "file": { + "example": "base64", + "type": "string", + "format": "base64", + "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + }, + "position": { + "type": "integer", + "description": "Document position in the submission. If not specified, the document will be added in the order it appears in the documents array." + } + } + } + }, + "submitters": { + "type": "array", + "description": "The list of submitters for the submission.", + "items": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the submitter." + }, + "role": { + "type": "string", + "description": "The role name or title of the submitter.", + "example": "First Party" + }, + "email": { + "type": "string", + "description": "The email address of the submitter.", + "format": "email", + "example": "john.doe@example.com" + }, + "phone": { + "type": "string", + "description": "The phone number of the submitter, formatted according to the E.164 standard.", + "example": "+1234567890" + }, + "values": { + "type": "object", + "description": "An object with pre-filled values for the submission. Use field names for keys of the object. For more configurations see `fields` param." + }, + "external_id": { + "type": "string", + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "completed": { + "type": "boolean", + "description": "Pass `true` to mark submitter as completed and auto-signed via API." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information.", + "example": "{ \"customField\": \"value\" }" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending only for this submitter.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails for this submitter." + }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, + "fields": { + "type": "array", + "description": "A list of configurations for document form fields.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Document field name.", + "example": "First Name" + }, + "default_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ], + "description": "Default value of the field. Use base64 encoded file or a public URL to the image file to set default signature or image fields.", + "example": "Acme" + }, + "readonly": { + "type": "boolean", + "description": "Set `true` to make it impossible for the submitter to edit predefined field value.", + "default": false + }, + "required": { + "type": "boolean", + "description": "Set `true` to make the field required." + }, + "title": { + "type": "string", + "description": "Field title displayed to the user instead of the name, shown on the signing form. Supports Markdown." + }, + "description": { + "type": "string", + "description": "Field description displayed on the signing form. Supports Markdown." + }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels.", + "example": 12 + }, + "font_type": { + "type": "string", + "description": "Font type of the field value.", + "enum": [ + "bold", + "italic", + "bold_italic" + ] + }, + "font": { + "type": "string", + "description": "Font family of the field value.", + "enum": [ + "Times", + "Helvetica", + "Courier" + ] + }, + "color": { + "type": "string", + "description": "Font color of the field value.", + "enum": [ + "black", + "white", + "blue" + ], + "default": "black" + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value.", + "enum": [ + "left", + "center", + "right" + ], + "default": "left" + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value.", + "enum": [ + "top", + "center", + "bottom" + ], + "default": "center" + }, + "format": { + "type": "string", + "description": "The data format for different field types.
- Date field: accepts formats such as DD/MM/YYYY (default: MM/DD/YYYY).
- Signature field: accepts drawn, typed, drawn_or_typed (default), or upload.
- Number field: accepts currency formats such as usd, eur, gbp.", + "example": "DD/MM/YYYY" + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields.", + "example": 99.99 + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields.", + "enum": [ + "USD", + "EUR", + "GBP", + "CAD", + "AUD" + ], + "default": "USD" + }, + "mask": { + "description": "Set `true` to make sensitive data masked on the document.", + "oneOf": [ + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": false + } + } + } + } + } + }, + "roles": { + "type": "array", + "description": "A list of roles for the submitter. Use this param to merge multiple roles into one submitter.", + "items": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Custom signature request email subject." + }, + "body": { + "type": "string", + "description": "Custom signature request email body. Can include the following variables: {{submission.name}}, {{submitter.link}}, {{account.name}}." + } + } + }, + "merge_documents": { + "type": "boolean", + "description": "Set `true` to merge the documents into a single PDF file.", + "default": false + }, + "remove_tags": { + "type": "boolean", + "description": "Pass `false` to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.", + "default": true + } + } + } + } + } + } +} +``` + diff --git a/docs/api/php.md b/docs/api/php.md index ff02eb85..81c10af2 100644 --- a/docs/api/php.md +++ b/docs/api/php.md @@ -525,6 +525,15 @@ $docuseal->createSubmission([ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -600,14 +609,45 @@ $docuseal->createSubmission([ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1028,10 +1068,6 @@ $docuseal->updateSubmitter(500001, [ "type": "string", "description": "Specify Reply-To address to use in the notification emails." }, - "completed_redirect_url": { - "type": "string", - "description": "Submitter specific URL to redirect to after the submission completion." - }, "completed": { "type": "boolean", "description": "Pass `true` to mark submitter as completed and auto-signed via API." @@ -1041,6 +1077,15 @@ $docuseal->updateSubmitter(500001, [ "description": "Metadata object with additional submitter information.", "example": "{ \"customField\": \"value\" }" }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -1108,14 +1153,45 @@ $docuseal->updateSubmitter(500001, [ "type": "boolean", "description": "Set `true` to make the field required." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1792,6 +1868,46 @@ $docuseal->createTemplateFromDocx([ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -2292,7 +2408,7 @@ $docuseal->mergeTemplates([ ### Create a submission from PDF -The API endpoint provides the functionality to create one-off submission request from a PDF or DOCX file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form +The API endpoint provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form ```php @@ -2595,6 +2711,15 @@ $docuseal->createSubmissionFromPdf([ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -2657,14 +2782,45 @@ $docuseal->createSubmissionFromPdf([ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3029,6 +3185,15 @@ and typesetting industry

"type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -3091,14 +3256,45 @@ and typesetting industry

"type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3425,6 +3621,46 @@ $docuseal->createTemplateFromPdf([ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -3541,3 +3777,447 @@ $docuseal->createTemplateFromPdf([ } ``` +### Create a submission from DOCX + +The API endpoint provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and list. You can also use the {{signature}} fillable field syntax to define fillable fields, as in a PDF.
Related Guides
Use embedded text field tags to create a fillable form + +```php +$docuseal = new \Docuseal\Api('API_KEY', 'https://api.docuseal.com'); + +$docuseal->createSubmissionFromDocx([ + 'name' => 'Test Submission Document', + 'variables' => [ + 'variable_name' => 'value' + ], + 'documents' => [ + [ + 'name' => 'string', + 'file' => 'base64' + ] + ], + 'submitters' => [ + [ + 'role' => 'First Party', + 'email' => 'john.doe@example.com' + ] + ] +]); +``` + +```json +{ + "security": [ + { + "AuthToken": [] + } + ], + "tags": [ + "Submissions" + ], + "summary": "Create a submission from DOCX", + "operationId": "createSubmissionFromDocx", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "documents", + "submitters" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document submission.", + "example": "Test Submission Document" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "variables": { + "type": "object", + "description": "Dynamic content variables object", + "example": { + "variable_name": "value" + } + }, + "order": { + "type": "string", + "description": "Pass 'random' to send signature request emails to all parties right away. The order is 'preserved' by default so the second party will receive a signature request email only after the document is signed by the first party.", + "default": "preserved", + "enum": [ + "preserved", + "random" + ] + }, + "completed_redirect_url": { + "type": "string", + "description": "Specify URL to redirect to after the submission completion." + }, + "bcc_completed": { + "type": "string", + "description": "Specify BCC address to send signed documents to after the completion." + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails." + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "template_ids": { + "type": "array", + "description": "An optional array of template IDs to use in the submission along with the provided documents. This can be used to create multi-document submissions when some of the required documents exist within templates.", + "items": { + "type": "integer", + "description": "The ID of the template to use for the submission." + } + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "file" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document." + }, + "file": { + "example": "base64", + "type": "string", + "format": "base64", + "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + }, + "position": { + "type": "integer", + "description": "Document position in the submission. If not specified, the document will be added in the order it appears in the documents array." + } + } + } + }, + "submitters": { + "type": "array", + "description": "The list of submitters for the submission.", + "items": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the submitter." + }, + "role": { + "type": "string", + "description": "The role name or title of the submitter.", + "example": "First Party" + }, + "email": { + "type": "string", + "description": "The email address of the submitter.", + "format": "email", + "example": "john.doe@example.com" + }, + "phone": { + "type": "string", + "description": "The phone number of the submitter, formatted according to the E.164 standard.", + "example": "+1234567890" + }, + "values": { + "type": "object", + "description": "An object with pre-filled values for the submission. Use field names for keys of the object. For more configurations see `fields` param." + }, + "external_id": { + "type": "string", + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "completed": { + "type": "boolean", + "description": "Pass `true` to mark submitter as completed and auto-signed via API." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information.", + "example": "{ \"customField\": \"value\" }" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending only for this submitter.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails for this submitter." + }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, + "fields": { + "type": "array", + "description": "A list of configurations for document form fields.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Document field name.", + "example": "First Name" + }, + "default_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ], + "description": "Default value of the field. Use base64 encoded file or a public URL to the image file to set default signature or image fields.", + "example": "Acme" + }, + "readonly": { + "type": "boolean", + "description": "Set `true` to make it impossible for the submitter to edit predefined field value.", + "default": false + }, + "required": { + "type": "boolean", + "description": "Set `true` to make the field required." + }, + "title": { + "type": "string", + "description": "Field title displayed to the user instead of the name, shown on the signing form. Supports Markdown." + }, + "description": { + "type": "string", + "description": "Field description displayed on the signing form. Supports Markdown." + }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels.", + "example": 12 + }, + "font_type": { + "type": "string", + "description": "Font type of the field value.", + "enum": [ + "bold", + "italic", + "bold_italic" + ] + }, + "font": { + "type": "string", + "description": "Font family of the field value.", + "enum": [ + "Times", + "Helvetica", + "Courier" + ] + }, + "color": { + "type": "string", + "description": "Font color of the field value.", + "enum": [ + "black", + "white", + "blue" + ], + "default": "black" + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value.", + "enum": [ + "left", + "center", + "right" + ], + "default": "left" + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value.", + "enum": [ + "top", + "center", + "bottom" + ], + "default": "center" + }, + "format": { + "type": "string", + "description": "The data format for different field types.
- Date field: accepts formats such as DD/MM/YYYY (default: MM/DD/YYYY).
- Signature field: accepts drawn, typed, drawn_or_typed (default), or upload.
- Number field: accepts currency formats such as usd, eur, gbp.", + "example": "DD/MM/YYYY" + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields.", + "example": 99.99 + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields.", + "enum": [ + "USD", + "EUR", + "GBP", + "CAD", + "AUD" + ], + "default": "USD" + }, + "mask": { + "description": "Set `true` to make sensitive data masked on the document.", + "oneOf": [ + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": false + } + } + } + } + } + }, + "roles": { + "type": "array", + "description": "A list of roles for the submitter. Use this param to merge multiple roles into one submitter.", + "items": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Custom signature request email subject." + }, + "body": { + "type": "string", + "description": "Custom signature request email body. Can include the following variables: {{submission.name}}, {{submitter.link}}, {{account.name}}." + } + } + }, + "merge_documents": { + "type": "boolean", + "description": "Set `true` to merge the documents into a single PDF file.", + "default": false + }, + "remove_tags": { + "type": "boolean", + "description": "Pass `false` to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.", + "default": true + } + } + } + } + } + } +} +``` + diff --git a/docs/api/python.md b/docs/api/python.md index 50edcd4e..07dc3bbd 100644 --- a/docs/api/python.md +++ b/docs/api/python.md @@ -543,6 +543,15 @@ docuseal.create_submission({ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -618,14 +627,45 @@ docuseal.create_submission({ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1064,10 +1104,6 @@ docuseal.update_submitter(500001, { "type": "string", "description": "Specify Reply-To address to use in the notification emails." }, - "completed_redirect_url": { - "type": "string", - "description": "Submitter specific URL to redirect to after the submission completion." - }, "completed": { "type": "boolean", "description": "Pass `true` to mark submitter as completed and auto-signed via API." @@ -1077,6 +1113,15 @@ docuseal.update_submitter(500001, { "description": "Metadata object with additional submitter information.", "example": "{ \"customField\": \"value\" }" }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -1144,14 +1189,45 @@ docuseal.update_submitter(500001, { "type": "boolean", "description": "Set `true` to make the field required." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1843,6 +1919,46 @@ docuseal.create_template_from_docx({ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -2349,7 +2465,7 @@ docuseal.merge_templates({ ### Create a submission from PDF -The API endpoint provides the functionality to create one-off submission request from a PDF or DOCX file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form +The API endpoint provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form ```python @@ -2655,6 +2771,15 @@ docuseal.create_submission_from_pdf({ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -2717,14 +2842,45 @@ docuseal.create_submission_from_pdf({ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3092,6 +3248,15 @@ and typesetting industry

"type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -3154,14 +3319,45 @@ and typesetting industry

"type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3491,6 +3687,46 @@ docuseal.create_template_from_pdf({ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -3607,3 +3843,450 @@ docuseal.create_template_from_pdf({ } ``` +### Create a submission from DOCX + +The API endpoint provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and list. You can also use the {{signature}} fillable field syntax to define fillable fields, as in a PDF.
Related Guides
Use embedded text field tags to create a fillable form + +```python +from docuseal import docuseal + +docuseal.key = "API_KEY" +docuseal.url = "https://api.docuseal.com" + +docuseal.create_submission_from_docx({ + "name": "Test Submission Document", + "variables": { + "variable_name": "value" + }, + "documents": [ + { + "name": "string", + "file": "base64" + } + ], + "submitters": [ + { + "role": "First Party", + "email": "john.doe@example.com" + } + ] +}) +``` + +```json +{ + "security": [ + { + "AuthToken": [] + } + ], + "tags": [ + "Submissions" + ], + "summary": "Create a submission from DOCX", + "operationId": "createSubmissionFromDocx", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "documents", + "submitters" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document submission.", + "example": "Test Submission Document" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "variables": { + "type": "object", + "description": "Dynamic content variables object", + "example": { + "variable_name": "value" + } + }, + "order": { + "type": "string", + "description": "Pass 'random' to send signature request emails to all parties right away. The order is 'preserved' by default so the second party will receive a signature request email only after the document is signed by the first party.", + "default": "preserved", + "enum": [ + "preserved", + "random" + ] + }, + "completed_redirect_url": { + "type": "string", + "description": "Specify URL to redirect to after the submission completion." + }, + "bcc_completed": { + "type": "string", + "description": "Specify BCC address to send signed documents to after the completion." + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails." + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "template_ids": { + "type": "array", + "description": "An optional array of template IDs to use in the submission along with the provided documents. This can be used to create multi-document submissions when some of the required documents exist within templates.", + "items": { + "type": "integer", + "description": "The ID of the template to use for the submission." + } + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "file" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document." + }, + "file": { + "example": "base64", + "type": "string", + "format": "base64", + "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + }, + "position": { + "type": "integer", + "description": "Document position in the submission. If not specified, the document will be added in the order it appears in the documents array." + } + } + } + }, + "submitters": { + "type": "array", + "description": "The list of submitters for the submission.", + "items": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the submitter." + }, + "role": { + "type": "string", + "description": "The role name or title of the submitter.", + "example": "First Party" + }, + "email": { + "type": "string", + "description": "The email address of the submitter.", + "format": "email", + "example": "john.doe@example.com" + }, + "phone": { + "type": "string", + "description": "The phone number of the submitter, formatted according to the E.164 standard.", + "example": "+1234567890" + }, + "values": { + "type": "object", + "description": "An object with pre-filled values for the submission. Use field names for keys of the object. For more configurations see `fields` param." + }, + "external_id": { + "type": "string", + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "completed": { + "type": "boolean", + "description": "Pass `true` to mark submitter as completed and auto-signed via API." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information.", + "example": "{ \"customField\": \"value\" }" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending only for this submitter.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails for this submitter." + }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, + "fields": { + "type": "array", + "description": "A list of configurations for document form fields.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Document field name.", + "example": "First Name" + }, + "default_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ], + "description": "Default value of the field. Use base64 encoded file or a public URL to the image file to set default signature or image fields.", + "example": "Acme" + }, + "readonly": { + "type": "boolean", + "description": "Set `true` to make it impossible for the submitter to edit predefined field value.", + "default": false + }, + "required": { + "type": "boolean", + "description": "Set `true` to make the field required." + }, + "title": { + "type": "string", + "description": "Field title displayed to the user instead of the name, shown on the signing form. Supports Markdown." + }, + "description": { + "type": "string", + "description": "Field description displayed on the signing form. Supports Markdown." + }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels.", + "example": 12 + }, + "font_type": { + "type": "string", + "description": "Font type of the field value.", + "enum": [ + "bold", + "italic", + "bold_italic" + ] + }, + "font": { + "type": "string", + "description": "Font family of the field value.", + "enum": [ + "Times", + "Helvetica", + "Courier" + ] + }, + "color": { + "type": "string", + "description": "Font color of the field value.", + "enum": [ + "black", + "white", + "blue" + ], + "default": "black" + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value.", + "enum": [ + "left", + "center", + "right" + ], + "default": "left" + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value.", + "enum": [ + "top", + "center", + "bottom" + ], + "default": "center" + }, + "format": { + "type": "string", + "description": "The data format for different field types.
- Date field: accepts formats such as DD/MM/YYYY (default: MM/DD/YYYY).
- Signature field: accepts drawn, typed, drawn_or_typed (default), or upload.
- Number field: accepts currency formats such as usd, eur, gbp.", + "example": "DD/MM/YYYY" + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields.", + "example": 99.99 + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields.", + "enum": [ + "USD", + "EUR", + "GBP", + "CAD", + "AUD" + ], + "default": "USD" + }, + "mask": { + "description": "Set `true` to make sensitive data masked on the document.", + "oneOf": [ + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": false + } + } + } + } + } + }, + "roles": { + "type": "array", + "description": "A list of roles for the submitter. Use this param to merge multiple roles into one submitter.", + "items": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Custom signature request email subject." + }, + "body": { + "type": "string", + "description": "Custom signature request email body. Can include the following variables: {{submission.name}}, {{submitter.link}}, {{account.name}}." + } + } + }, + "merge_documents": { + "type": "boolean", + "description": "Set `true` to merge the documents into a single PDF file.", + "default": false + }, + "remove_tags": { + "type": "boolean", + "description": "Pass `false` to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.", + "default": true + } + } + } + } + } + } +} +``` + diff --git a/docs/api/ruby.md b/docs/api/ruby.md index cf2cd9fe..45be27ae 100644 --- a/docs/api/ruby.md +++ b/docs/api/ruby.md @@ -543,6 +543,15 @@ Docuseal.create_submission({ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -618,14 +627,45 @@ Docuseal.create_submission({ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1064,10 +1104,6 @@ Docuseal.update_submitter(500001, { "type": "string", "description": "Specify Reply-To address to use in the notification emails." }, - "completed_redirect_url": { - "type": "string", - "description": "Submitter specific URL to redirect to after the submission completion." - }, "completed": { "type": "boolean", "description": "Pass `true` to mark submitter as completed and auto-signed via API." @@ -1077,6 +1113,15 @@ Docuseal.update_submitter(500001, { "description": "Metadata object with additional submitter information.", "example": "{ \"customField\": \"value\" }" }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -1144,14 +1189,45 @@ Docuseal.update_submitter(500001, { "type": "boolean", "description": "Set `true` to make the field required." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1843,6 +1919,46 @@ Docuseal.create_template_from_docx({ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -2349,7 +2465,7 @@ Docuseal.merge_templates({ ### Create a submission from PDF -The API endpoint provides the functionality to create one-off submission request from a PDF or DOCX file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form +The API endpoint provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form ```ruby @@ -2655,6 +2771,15 @@ Docuseal.create_submission_from_pdf({ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -2717,14 +2842,45 @@ Docuseal.create_submission_from_pdf({ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3092,6 +3248,15 @@ and typesetting industry

"type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -3154,14 +3319,45 @@ and typesetting industry

"type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3491,6 +3687,46 @@ Docuseal.create_template_from_pdf({ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -3607,3 +3843,450 @@ Docuseal.create_template_from_pdf({ } ``` +### Create a submission from DOCX + +The API endpoint provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and list. You can also use the {{signature}} fillable field syntax to define fillable fields, as in a PDF.
Related Guides
Use embedded text field tags to create a fillable form + +```ruby +require "docuseal" + +Docuseal.key = ENV["DOCUSEAL_API_KEY"] +Docuseal.url = "https://api.docuseal.com" + +Docuseal.create_submission_from_docx({ + name: "Test Submission Document", + variables: { + variable_name: "value" + }, + documents: [ + { + name: "string", + file: "base64" + } + ], + submitters: [ + { + role: "First Party", + email: "john.doe@example.com" + } + ] +}) +``` + +```json +{ + "security": [ + { + "AuthToken": [] + } + ], + "tags": [ + "Submissions" + ], + "summary": "Create a submission from DOCX", + "operationId": "createSubmissionFromDocx", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "documents", + "submitters" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document submission.", + "example": "Test Submission Document" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "variables": { + "type": "object", + "description": "Dynamic content variables object", + "example": { + "variable_name": "value" + } + }, + "order": { + "type": "string", + "description": "Pass 'random' to send signature request emails to all parties right away. The order is 'preserved' by default so the second party will receive a signature request email only after the document is signed by the first party.", + "default": "preserved", + "enum": [ + "preserved", + "random" + ] + }, + "completed_redirect_url": { + "type": "string", + "description": "Specify URL to redirect to after the submission completion." + }, + "bcc_completed": { + "type": "string", + "description": "Specify BCC address to send signed documents to after the completion." + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails." + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "template_ids": { + "type": "array", + "description": "An optional array of template IDs to use in the submission along with the provided documents. This can be used to create multi-document submissions when some of the required documents exist within templates.", + "items": { + "type": "integer", + "description": "The ID of the template to use for the submission." + } + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "file" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document." + }, + "file": { + "example": "base64", + "type": "string", + "format": "base64", + "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + }, + "position": { + "type": "integer", + "description": "Document position in the submission. If not specified, the document will be added in the order it appears in the documents array." + } + } + } + }, + "submitters": { + "type": "array", + "description": "The list of submitters for the submission.", + "items": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the submitter." + }, + "role": { + "type": "string", + "description": "The role name or title of the submitter.", + "example": "First Party" + }, + "email": { + "type": "string", + "description": "The email address of the submitter.", + "format": "email", + "example": "john.doe@example.com" + }, + "phone": { + "type": "string", + "description": "The phone number of the submitter, formatted according to the E.164 standard.", + "example": "+1234567890" + }, + "values": { + "type": "object", + "description": "An object with pre-filled values for the submission. Use field names for keys of the object. For more configurations see `fields` param." + }, + "external_id": { + "type": "string", + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "completed": { + "type": "boolean", + "description": "Pass `true` to mark submitter as completed and auto-signed via API." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information.", + "example": "{ \"customField\": \"value\" }" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending only for this submitter.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails for this submitter." + }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, + "fields": { + "type": "array", + "description": "A list of configurations for document form fields.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Document field name.", + "example": "First Name" + }, + "default_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ], + "description": "Default value of the field. Use base64 encoded file or a public URL to the image file to set default signature or image fields.", + "example": "Acme" + }, + "readonly": { + "type": "boolean", + "description": "Set `true` to make it impossible for the submitter to edit predefined field value.", + "default": false + }, + "required": { + "type": "boolean", + "description": "Set `true` to make the field required." + }, + "title": { + "type": "string", + "description": "Field title displayed to the user instead of the name, shown on the signing form. Supports Markdown." + }, + "description": { + "type": "string", + "description": "Field description displayed on the signing form. Supports Markdown." + }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels.", + "example": 12 + }, + "font_type": { + "type": "string", + "description": "Font type of the field value.", + "enum": [ + "bold", + "italic", + "bold_italic" + ] + }, + "font": { + "type": "string", + "description": "Font family of the field value.", + "enum": [ + "Times", + "Helvetica", + "Courier" + ] + }, + "color": { + "type": "string", + "description": "Font color of the field value.", + "enum": [ + "black", + "white", + "blue" + ], + "default": "black" + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value.", + "enum": [ + "left", + "center", + "right" + ], + "default": "left" + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value.", + "enum": [ + "top", + "center", + "bottom" + ], + "default": "center" + }, + "format": { + "type": "string", + "description": "The data format for different field types.
- Date field: accepts formats such as DD/MM/YYYY (default: MM/DD/YYYY).
- Signature field: accepts drawn, typed, drawn_or_typed (default), or upload.
- Number field: accepts currency formats such as usd, eur, gbp.", + "example": "DD/MM/YYYY" + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields.", + "example": 99.99 + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields.", + "enum": [ + "USD", + "EUR", + "GBP", + "CAD", + "AUD" + ], + "default": "USD" + }, + "mask": { + "description": "Set `true` to make sensitive data masked on the document.", + "oneOf": [ + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": false + } + } + } + } + } + }, + "roles": { + "type": "array", + "description": "A list of roles for the submitter. Use this param to merge multiple roles into one submitter.", + "items": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Custom signature request email subject." + }, + "body": { + "type": "string", + "description": "Custom signature request email body. Can include the following variables: {{submission.name}}, {{submitter.link}}, {{account.name}}." + } + } + }, + "merge_documents": { + "type": "boolean", + "description": "Set `true` to merge the documents into a single PDF file.", + "default": false + }, + "remove_tags": { + "type": "boolean", + "description": "Pass `false` to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.", + "default": true + } + } + } + } + } + } +} +``` + diff --git a/docs/api/shell.md b/docs/api/shell.md index 02016519..f5132490 100644 --- a/docs/api/shell.md +++ b/docs/api/shell.md @@ -517,6 +517,15 @@ curl --request POST \ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -592,14 +601,45 @@ curl --request POST \ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1013,10 +1053,6 @@ curl --request PUT \ "type": "string", "description": "Specify Reply-To address to use in the notification emails." }, - "completed_redirect_url": { - "type": "string", - "description": "Submitter specific URL to redirect to after the submission completion." - }, "completed": { "type": "boolean", "description": "Pass `true` to mark submitter as completed and auto-signed via API." @@ -1026,6 +1062,15 @@ curl --request PUT \ "description": "Metadata object with additional submitter information.", "example": "{ \"customField\": \"value\" }" }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -1093,14 +1138,45 @@ curl --request PUT \ "type": "boolean", "description": "Set `true` to make the field required." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1758,6 +1834,46 @@ curl --request POST \ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -2234,7 +2350,7 @@ curl --request POST \ ### Create a submission from PDF -The API endpoint provides the functionality to create one-off submission request from a PDF or DOCX file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form +The API endpoint provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form ```shell @@ -2511,6 +2627,15 @@ curl --request POST \ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -2573,14 +2698,45 @@ curl --request POST \ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -2925,6 +3081,15 @@ curl --request POST \ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -2987,14 +3152,45 @@ curl --request POST \ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3301,6 +3497,46 @@ curl --request POST \ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -3417,3 +3653,432 @@ curl --request POST \ } ``` +### Create a submission from DOCX + +The API endpoint provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and list. You can also use the {{signature}} fillable field syntax to define fillable fields, as in a PDF.
Related Guides
Use embedded text field tags to create a fillable form + +```shell +curl --request POST \ + --url https://api.docuseal.com/submissions/docx \ + --header 'X-Auth-Token: API_KEY' \ + --header 'content-type: application/json' \ + --data '{"name":"Test Submission Document","variables":{"variable_name":"value"},"documents":[{"name":"string","file":"base64"}],"submitters":[{"role":"First Party","email":"john.doe@example.com"}]}' +``` + +```json +{ + "security": [ + { + "AuthToken": [] + } + ], + "tags": [ + "Submissions" + ], + "summary": "Create a submission from DOCX", + "operationId": "createSubmissionFromDocx", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "documents", + "submitters" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document submission.", + "example": "Test Submission Document" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "variables": { + "type": "object", + "description": "Dynamic content variables object", + "example": { + "variable_name": "value" + } + }, + "order": { + "type": "string", + "description": "Pass 'random' to send signature request emails to all parties right away. The order is 'preserved' by default so the second party will receive a signature request email only after the document is signed by the first party.", + "default": "preserved", + "enum": [ + "preserved", + "random" + ] + }, + "completed_redirect_url": { + "type": "string", + "description": "Specify URL to redirect to after the submission completion." + }, + "bcc_completed": { + "type": "string", + "description": "Specify BCC address to send signed documents to after the completion." + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails." + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "template_ids": { + "type": "array", + "description": "An optional array of template IDs to use in the submission along with the provided documents. This can be used to create multi-document submissions when some of the required documents exist within templates.", + "items": { + "type": "integer", + "description": "The ID of the template to use for the submission." + } + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "file" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document." + }, + "file": { + "example": "base64", + "type": "string", + "format": "base64", + "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + }, + "position": { + "type": "integer", + "description": "Document position in the submission. If not specified, the document will be added in the order it appears in the documents array." + } + } + } + }, + "submitters": { + "type": "array", + "description": "The list of submitters for the submission.", + "items": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the submitter." + }, + "role": { + "type": "string", + "description": "The role name or title of the submitter.", + "example": "First Party" + }, + "email": { + "type": "string", + "description": "The email address of the submitter.", + "format": "email", + "example": "john.doe@example.com" + }, + "phone": { + "type": "string", + "description": "The phone number of the submitter, formatted according to the E.164 standard.", + "example": "+1234567890" + }, + "values": { + "type": "object", + "description": "An object with pre-filled values for the submission. Use field names for keys of the object. For more configurations see `fields` param." + }, + "external_id": { + "type": "string", + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "completed": { + "type": "boolean", + "description": "Pass `true` to mark submitter as completed and auto-signed via API." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information.", + "example": "{ \"customField\": \"value\" }" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending only for this submitter.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails for this submitter." + }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, + "fields": { + "type": "array", + "description": "A list of configurations for document form fields.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Document field name.", + "example": "First Name" + }, + "default_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ], + "description": "Default value of the field. Use base64 encoded file or a public URL to the image file to set default signature or image fields.", + "example": "Acme" + }, + "readonly": { + "type": "boolean", + "description": "Set `true` to make it impossible for the submitter to edit predefined field value.", + "default": false + }, + "required": { + "type": "boolean", + "description": "Set `true` to make the field required." + }, + "title": { + "type": "string", + "description": "Field title displayed to the user instead of the name, shown on the signing form. Supports Markdown." + }, + "description": { + "type": "string", + "description": "Field description displayed on the signing form. Supports Markdown." + }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels.", + "example": 12 + }, + "font_type": { + "type": "string", + "description": "Font type of the field value.", + "enum": [ + "bold", + "italic", + "bold_italic" + ] + }, + "font": { + "type": "string", + "description": "Font family of the field value.", + "enum": [ + "Times", + "Helvetica", + "Courier" + ] + }, + "color": { + "type": "string", + "description": "Font color of the field value.", + "enum": [ + "black", + "white", + "blue" + ], + "default": "black" + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value.", + "enum": [ + "left", + "center", + "right" + ], + "default": "left" + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value.", + "enum": [ + "top", + "center", + "bottom" + ], + "default": "center" + }, + "format": { + "type": "string", + "description": "The data format for different field types.
- Date field: accepts formats such as DD/MM/YYYY (default: MM/DD/YYYY).
- Signature field: accepts drawn, typed, drawn_or_typed (default), or upload.
- Number field: accepts currency formats such as usd, eur, gbp.", + "example": "DD/MM/YYYY" + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields.", + "example": 99.99 + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields.", + "enum": [ + "USD", + "EUR", + "GBP", + "CAD", + "AUD" + ], + "default": "USD" + }, + "mask": { + "description": "Set `true` to make sensitive data masked on the document.", + "oneOf": [ + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": false + } + } + } + } + } + }, + "roles": { + "type": "array", + "description": "A list of roles for the submitter. Use this param to merge multiple roles into one submitter.", + "items": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Custom signature request email subject." + }, + "body": { + "type": "string", + "description": "Custom signature request email body. Can include the following variables: {{submission.name}}, {{submitter.link}}, {{account.name}}." + } + } + }, + "merge_documents": { + "type": "boolean", + "description": "Set `true` to merge the documents into a single PDF file.", + "default": false + }, + "remove_tags": { + "type": "boolean", + "description": "Pass `false` to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.", + "default": true + } + } + } + } + } + } +} +``` + diff --git a/docs/api/typescript.md b/docs/api/typescript.md index d2bd2a7e..65d4b084 100644 --- a/docs/api/typescript.md +++ b/docs/api/typescript.md @@ -537,6 +537,15 @@ const submission = await docuseal.createSubmission({ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -612,14 +621,45 @@ const submission = await docuseal.createSubmission({ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1052,10 +1092,6 @@ const submitter = await docuseal.updateSubmitter(500001, { "type": "string", "description": "Specify Reply-To address to use in the notification emails." }, - "completed_redirect_url": { - "type": "string", - "description": "Submitter specific URL to redirect to after the submission completion." - }, "completed": { "type": "boolean", "description": "Pass `true` to mark submitter as completed and auto-signed via API." @@ -1065,6 +1101,15 @@ const submitter = await docuseal.updateSubmitter(500001, { "description": "Metadata object with additional submitter information.", "example": "{ \"customField\": \"value\" }" }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "message": { "type": "object", "properties": { @@ -1132,14 +1177,45 @@ const submitter = await docuseal.updateSubmitter(500001, { "type": "boolean", "description": "Set `true` to make the field required." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -1826,6 +1902,46 @@ const template = await docuseal.createTemplateFromDocx({ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -2330,7 +2446,7 @@ const template = await docuseal.mergeTemplates({ ### Create a submission from PDF -The API endpoint provides the functionality to create one-off submission request from a PDF or DOCX file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form +The API endpoint provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form ```typescript @@ -2635,6 +2751,15 @@ const submission = await docuseal.createSubmissionFromPdf({ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -2697,14 +2822,45 @@ const submission = await docuseal.createSubmissionFromPdf({ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3071,6 +3227,15 @@ and typesetting industry

"type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, "fields": { "type": "array", "description": "A list of configurations for document form fields.", @@ -3133,14 +3298,45 @@ and typesetting industry

"type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3469,6 +3665,46 @@ const template = await docuseal.createTemplateFromPdf({ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -3585,3 +3821,449 @@ const template = await docuseal.createTemplateFromPdf({ } ``` +### Create a submission from DOCX + +The API endpoint provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and list. You can also use the {{signature}} fillable field syntax to define fillable fields, as in a PDF.
Related Guides
Use embedded text field tags to create a fillable form + +```typescript +import docuseal from "@docuseal/api"; + +docuseal.configure({ key: "API_KEY", url: "https://api.docuseal.com" }); + +const submission = await docuseal.createSubmissionFromDocx({ + name: "Test Submission Document", + variables: { + variable_name: "value" + }, + documents: [ + { + name: "string", + file: "base64" + } + ], + submitters: [ + { + role: "First Party", + email: "john.doe@example.com" + } + ] +}); +``` + +```json +{ + "security": [ + { + "AuthToken": [] + } + ], + "tags": [ + "Submissions" + ], + "summary": "Create a submission from DOCX", + "operationId": "createSubmissionFromDocx", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "documents", + "submitters" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document submission.", + "example": "Test Submission Document" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "variables": { + "type": "object", + "description": "Dynamic content variables object", + "example": { + "variable_name": "value" + } + }, + "order": { + "type": "string", + "description": "Pass 'random' to send signature request emails to all parties right away. The order is 'preserved' by default so the second party will receive a signature request email only after the document is signed by the first party.", + "default": "preserved", + "enum": [ + "preserved", + "random" + ] + }, + "completed_redirect_url": { + "type": "string", + "description": "Specify URL to redirect to after the submission completion." + }, + "bcc_completed": { + "type": "string", + "description": "Specify BCC address to send signed documents to after the completion." + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails." + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "template_ids": { + "type": "array", + "description": "An optional array of template IDs to use in the submission along with the provided documents. This can be used to create multi-document submissions when some of the required documents exist within templates.", + "items": { + "type": "integer", + "description": "The ID of the template to use for the submission." + } + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "file" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document." + }, + "file": { + "example": "base64", + "type": "string", + "format": "base64", + "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + }, + "position": { + "type": "integer", + "description": "Document position in the submission. If not specified, the document will be added in the order it appears in the documents array." + } + } + } + }, + "submitters": { + "type": "array", + "description": "The list of submitters for the submission.", + "items": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the submitter." + }, + "role": { + "type": "string", + "description": "The role name or title of the submitter.", + "example": "First Party" + }, + "email": { + "type": "string", + "description": "The email address of the submitter.", + "format": "email", + "example": "john.doe@example.com" + }, + "phone": { + "type": "string", + "description": "The phone number of the submitter, formatted according to the E.164 standard.", + "example": "+1234567890" + }, + "values": { + "type": "object", + "description": "An object with pre-filled values for the submission. Use field names for keys of the object. For more configurations see `fields` param." + }, + "external_id": { + "type": "string", + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "completed": { + "type": "boolean", + "description": "Pass `true` to mark submitter as completed and auto-signed via API." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information.", + "example": "{ \"customField\": \"value\" }" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending only for this submitter.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails for this submitter." + }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, + "fields": { + "type": "array", + "description": "A list of configurations for document form fields.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Document field name.", + "example": "First Name" + }, + "default_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ], + "description": "Default value of the field. Use base64 encoded file or a public URL to the image file to set default signature or image fields.", + "example": "Acme" + }, + "readonly": { + "type": "boolean", + "description": "Set `true` to make it impossible for the submitter to edit predefined field value.", + "default": false + }, + "required": { + "type": "boolean", + "description": "Set `true` to make the field required." + }, + "title": { + "type": "string", + "description": "Field title displayed to the user instead of the name, shown on the signing form. Supports Markdown." + }, + "description": { + "type": "string", + "description": "Field description displayed on the signing form. Supports Markdown." + }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels.", + "example": 12 + }, + "font_type": { + "type": "string", + "description": "Font type of the field value.", + "enum": [ + "bold", + "italic", + "bold_italic" + ] + }, + "font": { + "type": "string", + "description": "Font family of the field value.", + "enum": [ + "Times", + "Helvetica", + "Courier" + ] + }, + "color": { + "type": "string", + "description": "Font color of the field value.", + "enum": [ + "black", + "white", + "blue" + ], + "default": "black" + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value.", + "enum": [ + "left", + "center", + "right" + ], + "default": "left" + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value.", + "enum": [ + "top", + "center", + "bottom" + ], + "default": "center" + }, + "format": { + "type": "string", + "description": "The data format for different field types.
- Date field: accepts formats such as DD/MM/YYYY (default: MM/DD/YYYY).
- Signature field: accepts drawn, typed, drawn_or_typed (default), or upload.
- Number field: accepts currency formats such as usd, eur, gbp.", + "example": "DD/MM/YYYY" + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields.", + "example": 99.99 + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields.", + "enum": [ + "USD", + "EUR", + "GBP", + "CAD", + "AUD" + ], + "default": "USD" + }, + "mask": { + "description": "Set `true` to make sensitive data masked on the document.", + "oneOf": [ + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": false + } + } + } + } + } + }, + "roles": { + "type": "array", + "description": "A list of roles for the submitter. Use this param to merge multiple roles into one submitter.", + "items": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Custom signature request email subject." + }, + "body": { + "type": "string", + "description": "Custom signature request email body. Can include the following variables: {{submission.name}}, {{submitter.link}}, {{account.name}}." + } + } + }, + "merge_documents": { + "type": "boolean", + "description": "Set `true` to merge the documents into a single PDF file.", + "default": false + }, + "remove_tags": { + "type": "boolean", + "description": "Pass `false` to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.", + "default": true + } + } + } + } + } + } +} +``` + diff --git a/docs/embedding/form-builder-angular.md b/docs/embedding/form-builder-angular.md index 89eb9c65..b78fafd2 100644 --- a/docs/embedding/form-builder-angular.md +++ b/docs/embedding/form-builder-angular.md @@ -450,6 +450,11 @@ const token = jwt.sign({ "default": false, "description": "Set `true` to display field name placeholders instead of the field type icons." }, + "withSignatureId": { + "type": "boolean", + "required": false, + "description": "Set to `true` to enable Signature ID by default for newly added fields. If set to `false`, the Signature ID toggle will be displayed under field settings, with the Signature ID turned off by default." + }, "onlyDefinedFields": { "type": "boolean", "required": false, @@ -462,6 +467,12 @@ const token = jwt.sign({ "default": false, "description": "Show template in preview mode without ability to edit it." }, + "inputMode": { + "type": "boolean", + "required": false, + "default": false, + "description": "Open template in data input mode to prefill fields with default values." + }, "autosave": { "type": "boolean", "required": false, diff --git a/docs/embedding/form-builder-javascript.md b/docs/embedding/form-builder-javascript.md index 64cb8eaf..4953b54f 100644 --- a/docs/embedding/form-builder-javascript.md +++ b/docs/embedding/form-builder-javascript.md @@ -414,12 +414,23 @@ "default": false, "description": "Set `true` to display field name placeholders instead of the field type icons." }, + "data-with-signature-id": { + "type": "boolean", + "required": false, + "description": "Set to `true` to enable Signature ID by default for newly added fields. If set to `false`, the Signature ID toggle will be displayed under field settings, with the Signature ID turned off by default." + }, "data-preview": { "type": "boolean", "required": false, "default": false, "description": "Show template in preview mode without ability to edit it." }, + "data-input-mode": { + "type": "boolean", + "required": false, + "default": false, + "description": "Open template in data input mode to prefill fields with default values." + }, "data-only-defined-fields": { "type": "boolean", "required": false, diff --git a/docs/embedding/form-builder-react.md b/docs/embedding/form-builder-react.md index e38a146a..894f684a 100644 --- a/docs/embedding/form-builder-react.md +++ b/docs/embedding/form-builder-react.md @@ -441,6 +441,11 @@ const token = jwt.sign({ "default": false, "description": "Set `true` to display field name placeholders instead of the field type icons." }, + "withSignatureId": { + "type": "boolean", + "required": false, + "description": "Set to `true` to enable Signature ID by default for newly added fields. If set to `false`, the Signature ID toggle will be displayed under field settings, with the Signature ID turned off by default." + }, "onlyDefinedFields": { "type": "boolean", "required": false, @@ -453,6 +458,12 @@ const token = jwt.sign({ "default": false, "description": "Show template in preview mode without ability to edit it." }, + "inputMode": { + "type": "boolean", + "required": false, + "default": false, + "description": "Open template in data input mode to prefill fields with default values." + }, "autosave": { "type": "boolean", "required": false, diff --git a/docs/embedding/form-builder-vue.md b/docs/embedding/form-builder-vue.md index 698360aa..f745be19 100644 --- a/docs/embedding/form-builder-vue.md +++ b/docs/embedding/form-builder-vue.md @@ -456,6 +456,11 @@ const token = jwt.sign({ "default": false, "description": "Set `true` to display field name placeholders instead of the field type icons." }, + "with-signature-id": { + "type": "boolean", + "required": false, + "description": "Set to `true` to enable Signature ID by default for newly added fields. If set to `false`, the Signature ID toggle will be displayed under field settings, with the Signature ID turned off by default." + }, "autosave": { "type": "boolean", "required": false, @@ -468,6 +473,12 @@ const token = jwt.sign({ "default": false, "description": "Show template in preview mode without ability to edit it." }, + "input-mode": { + "type": "boolean", + "required": false, + "default": false, + "description": "Open template in data input mode to prefill fields with default values." + }, "language": { "type": "string", "required": false, diff --git a/docs/embedding/signing-form-javascript.md b/docs/embedding/signing-form-javascript.md index 9674bb35..935153b5 100644 --- a/docs/embedding/signing-form-javascript.md +++ b/docs/embedding/signing-form-javascript.md @@ -7,12 +7,14 @@ + data-src="https://docuseal.com/d/{{ template_slug }}" + data-email="{{ signer_email }}"> ``` diff --git a/docs/openapi.json b/docs/openapi.json index bb9fa35d..84f95deb 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -1773,6 +1773,10 @@ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, "require_phone_2fa": { "type": "boolean", "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", @@ -1853,14 +1857,45 @@ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3171,7 +3206,7 @@ "Submissions" ], "summary": "Create a submission from PDF", - "description": "The API endpoint provides the functionality to create one-off submission request from a PDF or DOCX file. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form\n", + "description": "The API endpoint provides the functionality to create one-off submission request from a PDF. Use {{Field Name;role=Signer1;type=date}} text tags to define fillable fields in the document. See https://www.docuseal.com/examples/fieldtags.pdf for more text tag formats. Or specify the exact pixel coordinates of the document fields using `fields` param.
Related Guides
Use embedded text field tags to create a fillable form\n", "operationId": "createSubmissionFromPdf", "parameters": [], "requestBody": { @@ -3251,7 +3286,7 @@ "example": "base64", "type": "string", "format": "base64", - "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + "description": "Base64-encoded content of the PDF file or downloadable file URL." }, "fields": { "type": "array", @@ -3427,6 +3462,866 @@ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, + "require_phone_2fa": { + "type": "boolean", + "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", + "default": false + }, + "fields": { + "type": "array", + "description": "A list of configurations for document form fields.", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Document field name.", + "example": "First Name" + }, + "default_value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ], + "description": "Default value of the field. Use base64 encoded file or a public URL to the image file to set default signature or image fields.", + "example": "Acme" + }, + "readonly": { + "type": "boolean", + "description": "Set `true` to make it impossible for the submitter to edit predefined field value.", + "default": false + }, + "required": { + "type": "boolean", + "description": "Set `true` to make the field required." + }, + "title": { + "type": "string", + "description": "Field title displayed to the user instead of the name, shown on the signing form. Supports Markdown." + }, + "description": { + "type": "string", + "description": "Field description displayed on the signing form. Supports Markdown." + }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels.", + "example": 12 + }, + "font_type": { + "type": "string", + "description": "Font type of the field value.", + "enum": [ + "bold", + "italic", + "bold_italic" + ] + }, + "font": { + "type": "string", + "description": "Font family of the field value.", + "enum": [ + "Times", + "Helvetica", + "Courier" + ] + }, + "color": { + "type": "string", + "description": "Font color of the field value.", + "enum": [ + "black", + "white", + "blue" + ], + "default": "black" + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value.", + "enum": [ + "left", + "center", + "right" + ], + "default": "left" + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value.", + "enum": [ + "top", + "center", + "bottom" + ], + "default": "center" + }, + "format": { + "type": "string", + "description": "The data format for different field types.
- Date field: accepts formats such as DD/MM/YYYY (default: MM/DD/YYYY).
- Signature field: accepts drawn, typed, drawn_or_typed (default), or upload.
- Number field: accepts currency formats such as usd, eur, gbp.", + "example": "DD/MM/YYYY" + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields.", + "example": 99.99 + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields.", + "enum": [ + "USD", + "EUR", + "GBP", + "CAD", + "AUD" + ], + "default": "USD" + }, + "mask": { + "description": "Set `true` to make sensitive data masked on the document.", + "oneOf": [ + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": false + } + } + } + } + } + }, + "roles": { + "type": "array", + "description": "A list of roles for the submitter. Use this param to merge multiple roles into one submitter.", + "items": { + "type": "string" + } + } + } + } + }, + "message": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Custom signature request email subject." + }, + "body": { + "type": "string", + "description": "Custom signature request email body. Can include the following variables: {{submission.name}}, {{submitter.link}}, {{account.name}}." + } + } + }, + "flatten": { + "type": "boolean", + "description": "Remove PDF form fields from the documents.", + "default": false + }, + "merge_documents": { + "type": "boolean", + "description": "Set `true` to merge the documents into a single PDF file.", + "default": false + }, + "remove_tags": { + "type": "boolean", + "description": "Pass `false` to disable the removal of {{text}} tags from the PDF. This can be used along with transparent text tags for faster and more robust PDF processing.", + "default": true + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "submitters", + "source", + "submitters_order", + "status", + "documents", + "expire_at", + "created_at" + ], + "properties": { + "id": { + "type": "integer", + "description": "Submission unique ID number." + }, + "name": { + "type": "string", + "description": "Submission name." + }, + "submitters": { + "type": "array", + "description": "The list of submitters.", + "items": { + "type": "object", + "required": [ + "id", + "submission_id", + "uuid", + "email", + "slug", + "sent_at", + "opened_at", + "completed_at", + "declined_at", + "created_at", + "updated_at", + "name", + "phone", + "status", + "role", + "metadata", + "preferences" + ], + "properties": { + "id": { + "type": "integer", + "description": "Submission unique ID number." + }, + "uuid": { + "type": "string", + "description": "Submitter UUID." + }, + "email": { + "type": "string", + "nullable": true, + "description": "The email address of the submitter." + }, + "slug": { + "type": "string", + "description": "Unique key to be used in the form signing link and embedded form." + }, + "sent_at": { + "type": "string", + "nullable": true, + "description": "The date and time when the signing request was sent to the submitter." + }, + "opened_at": { + "type": "string", + "nullable": true, + "description": "The date and time when the submitter opened the signing form." + }, + "completed_at": { + "type": "string", + "nullable": true, + "description": "The date and time when the submitter completed the signing form." + }, + "declined_at": { + "type": "string", + "nullable": true, + "description": "The date and time when the submitter declined to complete the signing form." + }, + "created_at": { + "type": "string", + "description": "The date and time when the submitter was created." + }, + "updated_at": { + "type": "string", + "description": "The date and time when the submitter was last updated." + }, + "name": { + "type": "string", + "nullable": true, + "description": "Submitter name." + }, + "phone": { + "type": "string", + "nullable": true, + "description": "Submitter phone number." + }, + "external_id": { + "type": "string", + "nullable": true, + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "status": { + "type": "string", + "description": "The status of signing request for the submitter.", + "enum": [ + "completed", + "declined", + "opened", + "sent", + "awaiting" + ] + }, + "role": { + "type": "string", + "description": "The role of the submitter." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information." + }, + "preferences": { + "type": "object", + "description": "Object with submitter preferences." + }, + "embed_src": { + "type": "string", + "description": "The `src` URL value to embed the signing form or sign via a link." + } + } + } + }, + "source": { + "type": "string", + "description": "The source of the submission.", + "enum": [ + "invite", + "bulk", + "api", + "embed", + "link" + ] + }, + "submitters_order": { + "type": "string", + "description": "The order of submitters.", + "enum": [ + "random", + "preserved" + ] + }, + "status": { + "type": "string", + "description": "The status of the submission.", + "enum": [ + "completed", + "declined", + "expired", + "pending" + ] + }, + "schema": { + "type": "array", + "description": "The one-off submission document files.", + "items": { + "type": "object", + "properties": { + "attachment_uuid": { + "type": "string", + "description": "The attachment UUID." + }, + "name": { + "type": "string", + "description": "The attachment name." + } + } + } + }, + "fields": { + "type": "array", + "description": "List of fields to be filled in the one-off submission.", + "items": { + "type": "object", + "required": [ + "uuid", + "submitter_uuid", + "name", + "type", + "required", + "areas" + ], + "properties": { + "uuid": { + "type": "string", + "description": "Unique identifier of the field." + }, + "submitter_uuid": { + "type": "string", + "description": "Unique identifier of the submitter that filled the field." + }, + "name": { + "type": "string", + "description": "Field name." + }, + "type": { + "type": "string", + "description": "Type of the field (e.g., text, signature, date, initials).", + "enum": [ + "heading", + "text", + "signature", + "initials", + "date", + "number", + "image", + "checkbox", + "multiple", + "file", + "radio", + "select", + "cells", + "stamp", + "payment", + "phone", + "verification" + ] + }, + "required": { + "type": "boolean", + "description": "Indicates if the field is required." + }, + "preferences": { + "type": "object", + "properties": { + "font_size": { + "type": "integer", + "description": "Font size of the field value in pixels." + }, + "font_type": { + "type": "string", + "description": "Font type of the field value." + }, + "font": { + "type": "string", + "description": "Font family of the field value." + }, + "color": { + "type": "string", + "description": "Font color of the field value." + }, + "align": { + "type": "string", + "description": "Horizontal alignment of the field text value." + }, + "valign": { + "type": "string", + "description": "Vertical alignment of the field text value." + }, + "format": { + "type": "string", + "description": "The data format for different field types." + }, + "price": { + "type": "number", + "description": "Price value of the payment field. Only for payment fields." + }, + "currency": { + "type": "string", + "description": "Currency value of the payment field. Only for payment fields." + }, + "mask": { + "type": "boolean", + "description": "Indicates if the field is masked on the document." + } + } + }, + "areas": { + "type": "array", + "description": "List of areas where the field is located in the document.", + "items": { + "type": "object", + "required": [ + "x", + "y", + "w", + "h", + "attachment_uuid", + "page" + ], + "properties": { + "x": { + "type": "number", + "description": "X coordinate of the area where the field is located in the document." + }, + "y": { + "type": "number", + "description": "Y coordinate of the area where the field is located in the document." + }, + "w": { + "type": "number", + "description": "Width of the area where the field is located in the document." + }, + "h": { + "type": "number", + "description": "Height of the area where the field is located in the document." + }, + "attachment_uuid": { + "type": "string", + "description": "Unique identifier of the attached document where the field is located." + }, + "page": { + "type": "integer", + "description": "Page number of the attached document where the field is located." + } + } + } + } + } + } + }, + "documents": { + "type": "array", + "description": "List of documents attached to the one-off submission.", + "items": { + "type": "object", + "required": [ + "attachment_uuid", + "name" + ], + "properties": { + "attachment_uuid": { + "type": "string", + "description": "Unique indentifier of attached document to the one-off submission." + }, + "name": { + "type": "string", + "description": "Name of the attached document to the one-off submission." + } + } + } + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "created_at": { + "type": "string", + "description": "The date and time when the submission was created." + } + } + }, + "example": { + "id": 5, + "name": "Test Submission", + "submitters": [ + { + "id": 1, + "uuid": "884d545b-3396-49f1-8c07-05b8b2a78755", + "email": "john.doe@example.com", + "slug": "pAMimKcyrLjqVt", + "sent_at": "2025-06-02T15:55:51.310Z", + "opened_at": null, + "completed_at": null, + "declined_at": null, + "created_at": "2025-06-02T15:55:50.320Z", + "updated_at": "2025-06-02T15:55:50.320Z", + "name": "string", + "phone": "+1234567890", + "external_id": "2321", + "metadata": { + "customData": "custom value" + }, + "status": "sent", + "values": [ + { + "field": "Full Name", + "value": "John Doe" + } + ], + "preferences": { + "send_email": true, + "send_sms": false, + "reply_to": "reply@example.com", + "completed_redirect_url": "https://example.com/" + }, + "role": "First Party", + "embed_src": "https://docuseal.com/s/pAMimKcyrLjqVt" + } + ], + "source": "api", + "submitters_order": "preserved", + "status": "pending", + "schema": [ + { + "name": "Demo PDF", + "attachment_uuid": "48d2998f-266b-47e4-beb2-250ab7ccebdf" + } + ], + "fields": [ + { + "name": "Name", + "type": "text", + "required": true, + "uuid": "d0bf3c0c-1928-40c8-80f9-d9f3c6ad4eff", + "submitter_uuid": "0b0bff58-bc9a-475d-b4a9-2f3e5323faf7", + "areas": [ + { + "page": 1, + "attachment_uuid": "48d2998f-266b-47e4-beb2-250ab7ccebdf", + "x": 0.403158189124654, + "y": 0.04211750189825361, + "w": 0.100684625476058, + "h": 0.01423690205011389 + } + ] + } + ], + "expire_at": null, + "created_at": "2025-06-02T15:55:50.270Z" + } + } + } + } + } + } + }, + "/submissions/docx": { + "post": { + "security": [ + { + "AuthToken": [] + } + ], + "tags": [ + "Submissions" + ], + "summary": "Create a submission from DOCX", + "description": "The API endpoint provides functionality to create a one-off submission request from a DOCX file with dynamic content variables. Use [[variable_name]] text tags to define dynamic content variables in the document. See https://www.docuseal.com/examples/demo_template.docx for the specific text variable syntax, including dynamic content tables and list. You can also use the {{signature}} fillable field syntax to define fillable fields, as in a PDF.
Related Guides
Use embedded text field tags to create a fillable form", + "operationId": "createSubmissionFromDocx", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "documents", + "submitters" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document submission.", + "example": "Test Submission Document" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "variables": { + "type": "object", + "description": "Dynamic content variables object", + "example": { + "variable_name": "value" + } + }, + "order": { + "type": "string", + "description": "Pass 'random' to send signature request emails to all parties right away. The order is 'preserved' by default so the second party will receive a signature request email only after the document is signed by the first party.", + "default": "preserved", + "enum": [ + "preserved", + "random" + ] + }, + "completed_redirect_url": { + "type": "string", + "description": "Specify URL to redirect to after the submission completion." + }, + "bcc_completed": { + "type": "string", + "description": "Specify BCC address to send signed documents to after the completion." + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails." + }, + "expire_at": { + "type": "string", + "description": "Specify the expiration date and time after which the submission becomes unavailable for signature.", + "example": "2024-09-01 12:00:00 UTC" + }, + "template_ids": { + "type": "array", + "description": "An optional array of template IDs to use in the submission along with the provided documents. This can be used to create multi-document submissions when some of the required documents exist within templates.", + "items": { + "type": "integer", + "description": "The ID of the template to use for the submission." + } + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "file" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the document." + }, + "file": { + "example": "base64", + "type": "string", + "format": "base64", + "description": "Base64-encoded content of the PDF or DOCX file or downloadable file URL." + }, + "position": { + "type": "integer", + "description": "Document position in the submission. If not specified, the document will be added in the order it appears in the documents array." + } + } + } + }, + "submitters": { + "type": "array", + "description": "The list of submitters for the submission.", + "items": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the submitter." + }, + "role": { + "type": "string", + "description": "The role name or title of the submitter.", + "example": "First Party" + }, + "email": { + "type": "string", + "description": "The email address of the submitter.", + "format": "email", + "example": "john.doe@example.com" + }, + "phone": { + "type": "string", + "description": "The phone number of the submitter, formatted according to the E.164 standard.", + "example": "+1234567890" + }, + "values": { + "type": "object", + "description": "An object with pre-filled values for the submission. Use field names for keys of the object. For more configurations see `fields` param." + }, + "external_id": { + "type": "string", + "description": "Your application-specific unique string key to identify this submitter within your app." + }, + "completed": { + "type": "boolean", + "description": "Pass `true` to mark submitter as completed and auto-signed via API." + }, + "metadata": { + "type": "object", + "description": "Metadata object with additional submitter information.", + "example": "{ \"customField\": \"value\" }" + }, + "send_email": { + "type": "boolean", + "description": "Set `false` to disable signature request emails sending only for this submitter.", + "default": true + }, + "send_sms": { + "type": "boolean", + "description": "Set `true` to send signature request via phone number and SMS.", + "default": false + }, + "reply_to": { + "type": "string", + "description": "Specify Reply-To address to use in the notification emails for this submitter." + }, + "completed_redirect_url": { + "type": "string", + "description": "Submitter specific URL to redirect to after the submission completion." + }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, "require_phone_2fa": { "type": "boolean", "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", @@ -3494,14 +4389,45 @@ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -3621,11 +4547,6 @@ } } }, - "flatten": { - "type": "boolean", - "description": "Remove PDF form fields from the documents.", - "default": false - }, "merge_documents": { "type": "boolean", "description": "Set `true` to merge the documents into a single PDF file.", @@ -4268,6 +5189,10 @@ "type": "string", "description": "Submitter specific URL to redirect to after the submission completion." }, + "order": { + "type": "integer", + "description": "The order of the submitter in the workflow (e.g., 0 for the first signer, 1 for the second, etc.). Use the same order number to create order groups. By default, submitters are ordered as in the submitters array." + }, "require_phone_2fa": { "type": "boolean", "description": "Set to `true` to require phone 2FA verification via a one-time code sent to the phone number in order to access the documents.", @@ -4335,14 +5260,45 @@ "type": "string", "description": "Field description displayed on the signing form. Supports Markdown." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -5403,14 +6359,45 @@ "type": "boolean", "description": "Set `true` to make the field required." }, - "validation_pattern": { - "type": "string", - "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", - "example": "[A-Z]{4}" - }, - "invalid_message": { - "type": "string", - "description": "A custom message to display on pattern validation failure." + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } }, "preferences": { "type": "object", @@ -7749,6 +8736,46 @@ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { @@ -8412,6 +9439,46 @@ "Option B" ] }, + "validation": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "HTML field validation pattern string based on https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern specification.", + "example": "[A-Z]{4}" + }, + "message": { + "type": "string", + "description": "A custom error message to display on validation failure." + }, + "min": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Minimum allowed number value or date depending on field type." + }, + "max": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ], + "description": "Maximum allowed number value or date depending on field type." + }, + "step": { + "type": "number", + "description": "Increment step for number field. Pass 1 to accept only integers, or 0.01 to accept decimal currency." + } + } + }, "preferences": { "type": "object", "properties": { diff --git a/docs/webhooks/form-webhook.md b/docs/webhooks/form-webhook.md index 439eb924..32c0eb19 100644 --- a/docs/webhooks/form-webhook.md +++ b/docs/webhooks/form-webhook.md @@ -146,6 +146,10 @@ During the form filling and signing process, 3 types of events may occur and are "type": "string", "description": "The submission URL." }, + "variables": { + "type": "object", + "description": "Dynamic content variables object." + }, "created_at": { "type": "string", "description": "The submission creation date.", diff --git a/docs/webhooks/submission-webhook.md b/docs/webhooks/submission-webhook.md index 0ebf659c..15e1bcbd 100644 --- a/docs/webhooks/submission-webhook.md +++ b/docs/webhooks/submission-webhook.md @@ -216,6 +216,10 @@ Get submission creation, completion, expiration, and archiving notifications usi } } }, + "variables": { + "type": "object", + "description": "Dynamic content variables object." + }, "created_by_user": { "type": "object", "properties": {