The venture launched. The documents delivered. Word spread fast. World Industries is going global — same contracts, same agreements, but now across twelve time zones and eight languages at a volume that breaks any manual process. Loading the engine by hand worked for one run. It won't survive an empire.
To scale without breaking, you'll need to master the two pillars of reusable automation:
Your job is to build the infrastructure behind the empire. Pipelines that run without human hands, at any volume, without breaking a sweat. World Industries didn't grow by doing things twice. Neither will you.
Objective: Build a Document Solution configured for the German market, generate the contract through a Document Request, then turn it into an Envelope Template and send an envelope from it.
This mission uses the same contract as Mission 1: Command and Conquer Your Document Empire, prepared for the German market. Take a look at the two raw materials before you start:
Customer.EffectiveDate. It's the same contract data as Mission 1, with the date formatted for German locale parsing.| Resource | What it holds | Created in |
|---|---|---|
| Data Source | A named, reusable definition of where data comes from: a file in Storage or on a drive, or your own API via GraphQL. | Step 2 |
| Document Template | A named reference to a template file in Storage, OneDrive or Google Drive. The file itself is uploaded separately. | Step 4 |
| Document Solution | Ties templates and data sources together with one or more configurations: output format, delivery, locale and time zone. | Step 5 |
| Document Request | One generation run of a template with a data source, optionally under a configuration. Runs in the background. | Step 6 |
| Document record | Metadata about a generated document, including the urn of the file. | Generated by Step 6, read in Step 8 |
| Envelope Template | A reusable envelope with placeholder recipients identified by templateRole. | Step 9 |
Open the Doctavian Postman collection and navigate to the Mission 3 — Scale the Empire folder. Run the steps in order. Each step saves its IDs automatically, scoped to this collection. Every request below carries the usual Authorization: Bearer <token> and x-api-key: <api-key> headers; they're omitted for brevity.
Open Step 1 — Upload the data, attach mission-3-data-de.json, and send it to POST /documents/data/upload as multipart/form-data, exactly as in Mission 1. A 201 Created confirms the upload, with result.data.files[0].id saved as {{mission3.dataId}}.
Open Step 2 — Create the Data Source and send the request. The Data Source uses loadMethod: "Storage" with {{mission3.dataId}} as its urn, so the uploaded data is used exactly as it is:
POST https://api.doctavian.com/v1/documents/datasource/create
Content-Type: application/json
{
"dataSource": {
"name": "Mission 3 - German Contract Data",
"description": "Customer data for the German World Industries contract.",
"urn": "{{mission3.dataId}}",
"loadMethod": "Storage"
}
}A 201 Created confirms it, with result.data.dataSource.id saved as {{mission3.dataSourceId}}.
Open Step 3 — Upload the template, attach mission-3-agreement-de.docx, and send it to POST /documents/template/upload. A 201 Created confirms the upload, with result.data.files[0].id saved as {{mission3.templateFileId}}.
Open Step 4 — Create the Document Template and send the request. This registers the uploaded file as a Document Template, so the Document Solution and Document Request can refer to it by ID:
POST https://api.doctavian.com/v1/documents/template/create
Content-Type: application/json
{
"documentTemplate": {
"name": "Mission 3 - World Industries Contract (DE)",
"description": "German contract template for World Industries.",
"urn": "{{mission3.templateFileId}}",
"fileFormat": "docx",
"loadMethod": "Storage"
}
}A 201 Created confirms it, with result.data.documentTemplate.id saved as {{mission3.documentTemplateId}}.
Open Step 5 — Create the Document Solution. The Document Solution ties the Document Template and Data Source together, and creates a configuration for the German market in the same call through configurationDetails:
World-Industries-Contract-DE, which names the generated file when a Document Request doesn't set its own titlepdfStorage, with path rootdeEurope/Berlintrue, marking it as the solution's default configurationPOST https://api.doctavian.com/v1/documents/solution/create
Content-Type: application/json
{
"documentSolution": {
"name": "Mission 3 - World Industries Contract Solution (DE)",
"description": "Ties the German contract template to its data, with a German configuration.",
"templates": [
{
"id": "{{mission3.documentTemplateId}}"
}
],
"dataSources": [
{
"id": "{{mission3.dataSourceId}}"
}
],
"configurationDetails": [
{
"name": "German contract - PDF to Storage",
"title": "World-Industries-Contract-DE",
"fileFormat": "pdf",
"deliveryMethod": "Storage",
"path": "root",
"locale": "de",
"timeZone": "Europe/Berlin",
"isDefault": true
}
]
}
}Send the request. A 201 Created confirms the solution. The collection saves result.data.documentSolution.id as {{mission3.documentSolutionId}} and the new configuration's id, result.data.documentSolution.configurationDetails[0].id, as {{mission3.configurationId}}.
Want to try a different market? Change
localeandtimeZonehere and in Step 6 to any pair from Locales and Timezones — the rest of the pipeline stays exactly the same.
As covered in Multi-locale Output,
date()parsing is locale-dependent, so the same date string can resolve differently under a new locale. That's why this mission uses a German copy of the data file.
Open Step 6 — Create the Document Request and send the request. It references the Document Template, Data Source, and configuration from the previous steps, and carries the format, delivery, locale, and time zone values:
POST https://api.doctavian.com/v1/documents/request/create
Content-Type: application/json
{
"documentRequest": {
"name": "World Industries Contract - DE",
"title": "World-Industries-Contract-DE",
"documentTemplateId": "{{mission3.documentTemplateId}}",
"dataSourceId": "{{mission3.dataSourceId}}",
"documentSolutionConfigurationId": "{{mission3.configurationId}}",
"fileFormat": "pdf",
"deliveryMethod": "Storage",
"path": "root",
"locale": "de",
"timeZone": "Europe/Berlin"
}
}The configuration supplies any output values the request leaves out; values sent on the request win. A solution's default configuration is not applied automatically, so pass documentSolutionConfigurationId when you want it.
Unlike the synchronous generate call in Mission 1, a Document Request runs in the background. The 201 Created response comes back straight away with result.data.documentRequest.status New, and generation carries on after it. The collection saves result.data.documentRequest.id as {{mission3.documentRequestId}}.
Open Step 7 — Check the Document Request and send it:
GET https://api.doctavian.com/v1/documents/request/{{mission3.documentRequestId}}/getstatus moves from New through Processing to Completed or Failed. Repeat every few seconds until it is one of the last two. On Failed, errorMessage explains why; a failed request is not retried, so fix the cause and create a new one.
Once the request is Completed, documentId names the document record generation produced. The collection saves it as {{mission3.documentId}}.
A Storage file feeds one generation only, so a second request on the same template and data source ends
FailedwithFILE_MISSING_FROM_STORAGE. To generate again, upload fresh files (Steps 1 and 3) and point the existing Data Source and Document Template at the new ids with their update calls. A template on OneDrive or Google Drive, with data from GraphQL, is fetched on every run and needs no re-uploads. See Storage and File IDs.
Open Step 8 — Get the generated document and send the request:
GET https://api.doctavian.com/v1/documents/document/{{mission3.documentId}}/getThe response is the document record. Note result.data.document.urn: it is the storage id of the generated PDF, saved as {{mission3.germanDocumentId}} — ready for the Envelope Template in the next step, with no download or re-upload needed.
Keep the two ids apart. The record's
id(documentId) is what/documents/document/{documentId}/gettakes. Theurnaddresses the file: it is what/documents/document/{documentId}/downloadand the Envelope Template take. Swapping them fails.
Open Step 9 — Create the Envelope Template. This defines the reusable signing structure once — document, recipient role, and signature field — using templateRole: "Customer" in place of a real name and email. The document is referenced directly by {{mission3.germanDocumentId}}:
POST https://api.doctavian.com/v1/signatures/template/create
Content-Type: application/json
{
"template": {
"templateName": "World Industries Contract DE Template",
"templateDescription": "Reusable contract signing template, one customer at a time.",
"subject": "Please sign: World Industries Contract",
"message": "Please review and sign the attached contract.",
"isSignOrder": false,
"expireInDays": 7,
"alertDaysBeforeExpiry": 1,
"firstReminderDays": null,
"repeatingReminderDays": null,
"notifyWhenOpened": true,
"notifyWhenSigned": true,
"locale": "en-GB",
"timeZone": "Europe/Zagreb"
},
"documents": [
{
"referenceDocumentId": 1,
"name": "World-Industries-Contract-DE",
"loadMethod": "Storage",
"urn": "{{mission3.germanDocumentId}}"
}
],
"recipients": [
{
"referenceSignerId": 1,
"role": "signer",
"signOrder": 1,
"mandatory": true,
"templateRole": "Customer",
"isMfaEnabled": false
}
],
"fields": [
{
"name": "signature_customer",
"type": "signature",
"referenceDocumentId": 1,
"referenceSignerId": 1,
"page": 1, "positionX": 90, "positionY": 630, "width": 200, "height": 60,
"isRequired": true
}
]
}The envelopes expire after 7 days, with an alert a day before; null reminder settings mean no reminders are sent. The notification emails are in English (en-GB) and dates are shown to the customer in Central European time. Settings in template apply to every envelope created from it.
Send the request. A 201 Created confirms the template, with result.data.template.id saved as {{mission3.envelopeTemplateId}}.
Creating the template moves the generated file into it, so
{{mission3.germanDocumentId}}stops resolving once this step succeeds. To run Step 9 again, repeat Steps 6–8 first for a fresh document. The PDF stays available inside every envelope created from the template.
Before sending, set two collection variables — mission3.customerAName and mission3.customerAEmail — to a real name and an email address you have access to. This is the recipient who receives the signing invitation.
Open Step 10 — Instantiate for Customer A. This is the payoff: a single call supplies just the recipient's name and email, matched to the template by templateRole, and Doctavian assembles the full envelope from the template:
POST https://api.doctavian.com/v1/signatures/template/{{mission3.envelopeTemplateId}}/envelope/create
Content-Type: application/json
{
"template": {
"subject": "Please sign: World Industries Contract — Customer A"
},
"recipients": [
{
"templateRole": "Customer",
"name": "{{mission3.customerAName}}",
"email": "{{mission3.customerAEmail}}"
}
]
}There are no documents in this request; they come from the template. Only the email subject and message can be overridden per envelope, under template; everything else comes from the template. This request overrides just the subject, tailoring it to this customer.
Send the request. A 201 Created confirms a new envelope in Draft, with result.data.envelope.id saved as {{mission3.envelopeIdCustomerA}}. That is an envelope id, not a template id; the template is unchanged.
Run the same request again with a different name and email — Customer B, Customer C, anyone — and you get a brand new, independent envelope every time. No structure rebuilt, no fields repositioned, no documents re-uploaded.
The envelope from Step 10 stays in Draft until you send it — no notification has gone out yet. Open Step 11 — Send the envelope and send the request:
POST https://api.doctavian.com/v1/signatures/envelope/{{mission3.envelopeIdCustomerA}}/sendThis is the same send call used in Mission 2, whether the envelope was built by hand or instantiated from a template. A 200 OK confirms the envelope is sent and In Progress. Customer A receives an email notification with a personalised signing link.
CompletedThe empire runs itself now. Same templates, same pipelines, any language, any customer, any volume — World Industries didn't grow by doing things twice, and neither did you.