Create Envelope from Template
POST/openapi/v1/envelopes/create-from-template
Creates and sends an envelope from an enabled template in one step: the system clones the template's documents, signing roles, and tab layout, replaces signers with actual names/emails, prefills tab values, and immediately sends signing invitations.
vs. Quick Create
- Quick create: upload documents, define signers and tabs via API — flexible but requires the full structure on every call
- Template create: documents and tab layout are pre-configured in the console; the API only needs template ID + signers + prefill values — ideal for fixed-structure volume scenarios
Matching rules
Signers[].TemplateRecipientIdmust map one-to-one to the template's signer roles (exact set match; missing/extra/duplicate rejected); array order is irrelevant- Signing order is defined by the template; no order field is accepted
Tabs[].TemplateTabIdmust exist in the template and be prefillable; a matched value overrides the template's default; omitted tabs keep the template's default
Required Scope: envelope:create
Request Parameters
Header Parameters
AuthorizationRequiredstring
Bearer <access_token>
X-Operator-User-IdOptionalstring
Operator user ID. Not required in authorization_code mode (uses authorized user automatically); required in client_credentials mode, must be a valid member of the current space, this user will be the envelope sender.
Request Body
application/jsonTemplateIdRequiredstring
Template ID
BasicInfoOptionalobject
Envelope basic info
Sub-properties
EnvelopeTitleOptionalstring
Envelope title. Defaults to the template title (or the system default title if the template has none)
EnvelopeDescriptionOptionalstring
Envelope description/remark
ExpirationOptionalobject
Expiration settings. If omitted: uses the template's default expiration (converted from relative days) when configured; otherwise the request is rejected
ExpiresAtOptionalstring
Signing deadline, RFC3339. The envelope is automatically voided after this time
WarnBeforeDaysOptionalinteger
Reminder days before expiry: X days before the envelope expires, one reminder email is sent to signers who have not completed signing.
- Omitted: uses the template preset (or 3 days if the template has none)
- 0: sends the reminder immediately
- N (1 ≤ N): reminds N days before expiry; if N equals the remaining days, sends immediately
- Negative: returns a parameter error; N greater than the remaining days does not return an error — the reminder is sent immediately
EmailNotificationOptionalobject
Email notification settings (optional). If omitted, the template's preset subject/body are used; provided values override the preset
EmailSubjectOptionalstring
Signing invitation email subject (optional, overrides the template preset)
EmailMessageOptionalstring
Signing invitation email body (optional, overrides the template preset)
SignersRequiredarray<object>
Signer list: each item maps to one signer role of the template (matched by TemplateRecipientId, see sub-fields)
Sub-properties
TemplateRecipientIdRequiredstring
Template signer role ID (returned by describe); must map one-to-one to the template's signer roles
NameRequiredstring
Signer name
EmailRequiredstring
Signer email
AuthenticationOptionalobject
Signer authentication settings (same as quick create); defaults to the template role's preset if omitted
Sub-properties
AuthMethodsOptionalarray<string>
Auth methods, e.g. email / access_code / ekyc
AccessCodeOptionalstring
Access code - required when AuthMethods includes access_code
EkycCertTypeOptionalstring
eKYC certificate type - required when AuthMethods includes ekyc
NotificationLanguageOptionalstring
Notification language; defaults to the template role's preset if omitted (empty preset = follow the sender language). zh-CN = Simplified Chinese; zh-TW = Traditional Chinese; en = English; th = Thai; vi = Vietnamese; ms = Malay; id = Indonesian
zh-CNzh-TWenthvimsid
SignerSigningSettingsOptionalobject
Signer signing settings (optional; omitted = use the template role preset)
Sub-properties
AllowedSignatureStylesOptionalarray<string>
Signature styles available to the signer (optional; omitted = all three styles open). Values: "system" (generated text signature) | "handwritten" | "upload" (uploaded signature image)
SignatureReuseDisabledOptionalboolean
Whether to disable reusing this signature on other unsigned tabs of the same envelope (optional, default false = allow reuse)
StampReuseDisabledOptionalboolean
Whether to disable reusing this stamp on other unsigned tabs of the same envelope (optional, default false = allow reuse)
AllowDragOptionalboolean
Whether the signer may drag to add tabs during signing (optional, default false). When true, AllowedDragSigningTabTypes is required
AllowedDragSigningTabTypesOptionalarray<string>
Tab types the signer may drag to add (optional, strictly consistent with AllowDrag). Allowed values: signing tabs signHere(signature) | stamp | pagingStamp | pagingSignature; fill tabs text | multiLineText | date | checkbox. Required and non-empty when AllowDrag=true, and must include at least one signing tab; must be empty when AllowDrag=false
AllowedStampIdsOptionalarray<string>
Stamp IDs available to the signer (max 50). Omit or leave empty for no restriction; when non-empty, only these stamps are selectable and uploading a temporary stamp image is disabled. This field defines visibility only — it is not a grant and does not create one automatically. Stamps from the current Space and from other Spaces are both accepted, but they are granted differently; see the integration flow in the introduction.
TabsOptionalarray<object>
Tab prefill list: fills template tabs by the TemplateTabId returned by describe (tab ownership is defined by the template; only tabs with CanPrefill=true can be filled)
TemplateTabIdRequiredstring
Template tab ID (returned by describe; only tabs with CanPrefill=true can be prefilled)
ValueOptionalstring
Prefill value. Providing the TemplateTabId means setting the tab: an empty Value clears the template default (omitting Value has the same effect as an empty string). For list tabs the value must be one of the preset options and multiLineText must not be all-whitespace (server-validated); other types are not format-checked server-side
OutEnvelopeIdOptionalstring
Client-side business identifier, unique within the space. Duplicate creations are rejected; returned in the response only when provided
Request Example
{
"TemplateId": "TMa1b2c3d4e5f6g7h8i9j0k1l2",
"BasicInfo": {
"EnvelopeTitle": "Authorization Agreement-2026-001",
"Expiration": {
"ExpiresAt": "2026-11-20T23:59:59Z"
}
},
"EmailNotification": {
"EmailSubject": "Please sign: Authorization Agreement-2026-001"
},
"Signers": [
{
"TemplateRecipientId": "TRa1b2c3d4e5",
"Name": "Zhang San",
"Email": "zhangsan@example.com",
"NotificationPreference": "email"
}
],
"Tabs": [
{
"TemplateTabId": "TFa1b2c3d4e5",
"Value": "Tencent Cloud Pte. Ltd."
}
],
"OutEnvelopeId": "biz-2026-001"
}Response Parameters
Response.Data
EnvelopeIdOptionalstring
Envelope ID
OutEnvelopeIdOptionalstring
Client business identifier (returned only when provided)
Response Example
{
"Response": {
"RequestId": "req-abc123",
"Error": null,
"Data": {
"EnvelopeId": "SGEVa1b2c3d4e5f6g",
"OutEnvelopeId": "biz-2026-001"
}
}
}Error Codes
| Error Code | Description |
|---|---|
OPENAPI.OPERATOR_USER_ID_REQUIRED | X-Operator-User-Id missing |
OPENAPI.OPERATOR_USER_NOT_FOUND | X-Operator-User-Id user not found or not in the current space |
OPENAPI.OPERATOR_USER_NOT_HUMAN | X-Operator-User-Id is not a human user |
INVALID_REQUEST | Invalid request (missing required fields / Description over 1000 characters) |
TEMPLATE.NOT_FOUND | Template not found or not in the current space |
TEMPLATE.NOT_ACTIVE | Template not enabled (draft / disabled cannot be used) |
OPENAPI.TEMPLATE_SIGNER_MISMATCH | Signers do not match the template roles (count mismatch / unknown TemplateRecipientId / duplicate) |
OPENAPI.TEMPLATE_FIELD_INVALID | Tabs validation failed (unknown TemplateTabId / duplicate) |
OPENAPI.TEMPLATE_FIELD_TYPE_UNSUPPORTED | Tab type does not support prefill (attachment, auto-generated, and signing tabs such as signature/seal cannot be prefilled) |
VALIDATION.TITLE_TOO_LONG | Envelope title exceeds the length limit (300 characters) |
VALIDATION.EMAIL_SUBJECT_TOO_LONG | Email subject exceeds the length limit |
VALIDATION.EMAIL_MESSAGE_TOO_LONG | Email body exceeds the length limit (5000 characters) |
VALIDATION.EXPIRES_AT_REQUIRED | Expiration omitted and the template has no default, or ExpiresAt is in the past |
VALIDATION.EXPIRES_AT_INVALID | ExpiresAt is not a valid RFC3339 timestamp |
VALIDATION.EXPIRES_AT_PAST | ExpiresAt is earlier than the current time |
VALIDATION.RECIPIENT_EMAIL_INVALID | Signer email format is invalid |
OPENAPI.SIGNATURE_STYLE_INVALID | Signature style contains an unsupported value (only system / handwritten / upload are allowed) |
OPENAPI.DRAG_TAB_TYPE_INVALID | Drag tab type contains an unsupported value |
OPENAPI.DRAG_TAB_TYPE_REQUIRED | Allowed drag signing tab types are missing when drag is enabled |
OPENAPI.DRAG_TAB_TYPE_UNEXPECTED | Allowed drag signing tab types are present when drag is disabled |
OPENAPI.DRAG_TAB_TYPE_SIGNING_REQUIRED | No signing tab (signature/stamp/paging) is included in the allowed drag tab types |
OPENAPI.ALLOWED_STAMP_IDS_EXCEEDED | Allowed stamp IDs exceed the maximum limit |
OPENAPI.STAMP_NOT_FOUND | Stamp not found |
OPENAPI.STAMP_PERMISSION_DENIED | No permission to use this stamp |
VALIDATION.TAB_PROPERTIES_INVALID | Prefill value violates the tab fill contract (list value not in preset options / multiLineText all-whitespace) |
RECIPIENT.EMAIL_DUPLICATE | Signer email duplicates within the envelope |
VALIDATION.AUTH_METHOD_UNSUPPORTED | Authentication method not supported (SMS authentication is not available yet) |
VALIDATION.DOCUMENTS_EXCEED_LIMIT | Number of documents exceeds the current edition limit (send-time validation) |
VALIDATION.DOCUMENTS_REQUIRE_ACTIVE_EDITION | Current edition does not support this document volume (send-time validation) |
ENVELOPE.OUT_ID_DUPLICATE | OutEnvelopeId duplicates an existing envelope in the space |
ENVELOPE.ALREADY_SENDING | The envelope for this OutEnvelopeId is being sent; query its result later instead of retrying |
VALIDATION.AUTH_METHOD_CONTACT_MISSING | Authentication method is missing required credentials (e.g. access_code without AccessCode) |
VALIDATION.AUTH_METHOD_MULTIPLE_NOT_SUPPORTED | Multiple authentication methods are not supported |
VALIDATION.EKYC_CERT_TYPE_INVALID | Invalid EkycCertType |
VALIDATION.RECIPIENT_NAME_TOO_LONG | Signer name exceeds 100 characters |
COMMON.EMAIL_DOMAIN_UNREACHABLE | Signer email domain is undeliverable (domain does not exist or has no mail server) |
VALIDATION.INTERNAL_SIGNER_NOT_MEMBER | An internal signer role in the template can only be assigned to a member of the current space |
RECIPIENT.NOTIFICATION_LANGUAGE_INVALID | Invalid notification language |
INTERNAL_ERROR | Internal server error |