Envelope Templates (Template)API ReferenceCreate Envelope from Template

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[].TemplateRecipientId must 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[].TemplateTabId must 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

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.
application/json
TemplateIdRequiredstring
Template ID
BasicInfoOptionalobject
Envelope basic info
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
⌃Sub-properties
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
⌃Sub-properties
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)
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
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)
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)
⌃Sub-properties
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

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 CodeDescription
OPENAPI.OPERATOR_USER_ID_REQUIREDX-Operator-User-Id missing
OPENAPI.OPERATOR_USER_NOT_FOUNDX-Operator-User-Id user not found or not in the current space
OPENAPI.OPERATOR_USER_NOT_HUMANX-Operator-User-Id is not a human user
INVALID_REQUESTInvalid request (missing required fields / Description over 1000 characters)
TEMPLATE.NOT_FOUNDTemplate not found or not in the current space
TEMPLATE.NOT_ACTIVETemplate not enabled (draft / disabled cannot be used)
OPENAPI.TEMPLATE_SIGNER_MISMATCHSigners do not match the template roles (count mismatch / unknown TemplateRecipientId / duplicate)
OPENAPI.TEMPLATE_FIELD_INVALIDTabs validation failed (unknown TemplateTabId / duplicate)
OPENAPI.TEMPLATE_FIELD_TYPE_UNSUPPORTEDTab type does not support prefill (attachment, auto-generated, and signing tabs such as signature/seal cannot be prefilled)
VALIDATION.TITLE_TOO_LONGEnvelope title exceeds the length limit (300 characters)
VALIDATION.EMAIL_SUBJECT_TOO_LONGEmail subject exceeds the length limit
VALIDATION.EMAIL_MESSAGE_TOO_LONGEmail body exceeds the length limit (5000 characters)
VALIDATION.EXPIRES_AT_REQUIREDExpiration omitted and the template has no default, or ExpiresAt is in the past
VALIDATION.EXPIRES_AT_INVALIDExpiresAt is not a valid RFC3339 timestamp
VALIDATION.EXPIRES_AT_PASTExpiresAt is earlier than the current time
VALIDATION.RECIPIENT_EMAIL_INVALIDSigner email format is invalid
OPENAPI.SIGNATURE_STYLE_INVALIDSignature style contains an unsupported value (only system / handwritten / upload are allowed)
OPENAPI.DRAG_TAB_TYPE_INVALIDDrag tab type contains an unsupported value
OPENAPI.DRAG_TAB_TYPE_REQUIREDAllowed drag signing tab types are missing when drag is enabled
OPENAPI.DRAG_TAB_TYPE_UNEXPECTEDAllowed drag signing tab types are present when drag is disabled
OPENAPI.DRAG_TAB_TYPE_SIGNING_REQUIREDNo signing tab (signature/stamp/paging) is included in the allowed drag tab types
OPENAPI.ALLOWED_STAMP_IDS_EXCEEDEDAllowed stamp IDs exceed the maximum limit
OPENAPI.STAMP_NOT_FOUNDStamp not found
OPENAPI.STAMP_PERMISSION_DENIEDNo permission to use this stamp
VALIDATION.TAB_PROPERTIES_INVALIDPrefill value violates the tab fill contract (list value not in preset options / multiLineText all-whitespace)
RECIPIENT.EMAIL_DUPLICATESigner email duplicates within the envelope
VALIDATION.AUTH_METHOD_UNSUPPORTEDAuthentication method not supported (SMS authentication is not available yet)
VALIDATION.DOCUMENTS_EXCEED_LIMITNumber of documents exceeds the current edition limit (send-time validation)
VALIDATION.DOCUMENTS_REQUIRE_ACTIVE_EDITIONCurrent edition does not support this document volume (send-time validation)
ENVELOPE.OUT_ID_DUPLICATEOutEnvelopeId duplicates an existing envelope in the space
ENVELOPE.ALREADY_SENDINGThe envelope for this OutEnvelopeId is being sent; query its result later instead of retrying
VALIDATION.AUTH_METHOD_CONTACT_MISSINGAuthentication method is missing required credentials (e.g. access_code without AccessCode)
VALIDATION.AUTH_METHOD_MULTIPLE_NOT_SUPPORTEDMultiple authentication methods are not supported
VALIDATION.EKYC_CERT_TYPE_INVALIDInvalid EkycCertType
VALIDATION.RECIPIENT_NAME_TOO_LONGSigner name exceeds 100 characters
COMMON.EMAIL_DOMAIN_UNREACHABLESigner email domain is undeliverable (domain does not exist or has no mail server)
VALIDATION.INTERNAL_SIGNER_NOT_MEMBERAn internal signer role in the template can only be assigned to a member of the current space
RECIPIENT.NOTIFICATION_LANGUAGE_INVALIDInvalid notification language
INTERNAL_ERRORInternal server error