Upload a contract template
Uploads a document file to create a new contract template version in DRAFT status.
Use the builder session endpoint to configure field placements before publishing.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Upload a document to create a new contract template version. The file is validated and stored, a template version is created in DRAFT status, and the document is registered with the signing provider so its signer roles and fields can be detected. Returns the created template version, including its detected roles, fields, and variable placeholders.
This is a multipart form upload, not a JSON request.
Authentication & access
- Requires a client API token:
Authorization: Bearer <token>. - The caller must hold the
contracts.templates.writepermission and have the OWNER, OPERATIONS, or DEVELOPER role. - The client must have contract signing enabled. If the feature is disabled the request returns
403.
Request body (multipart/form-data)
| Field | Type | Required | Notes |
|---|---|---|---|
file | file | Yes | The source document to upload. |
name | text | No | Display name for the template. When omitted, the uploaded filename (or Contract Template) is used. |
File constraints
- Only PDF and DOCX documents are accepted; the extension must be
.pdfor.docx. - The file content must actually match the declared type (a content check rejects a mismatched or corrupt file).
- The file must be non-empty and must not exceed the configured maximum upload size.
Response
200 — The template version was created in DRAFT status. The payload is the template version, including:
id,name,status(DRAFT), andfile_type.external_id,signing_template_id, andsigning_template_slug.- the source file metadata under
source_file. roles— signer roles detected in the document.fields— fields detected in the document.detected_variables— variable placeholders found in the document.
After creating a template, use the builder session endpoint to configure field placements and signer roles before publishing.
Error responses
| Status | When |
|---|---|
400 | Missing filename; unsupported file extension (not PDF or DOCX); empty file; file content does not match the declared PDF/DOCX type |
403 | Contract signing is disabled for the client |
413 | Uploaded file exceeds the maximum allowed size |
422 | The multipart form failed validation (e.g. the file part is missing) |
502 | The signing provider rejected or failed the request while registering the document |
503 | The signing provider is temporarily unavailable |
Standard 401 (authentication), 403 (insufficient permission or role), and 429 (rate limit) responses apply to every endpoint and are documented in the Error reference.