DocuSign template API
---
title: DocuSign template API
description: Atlas DocuSign template API flow: detect signature fields, bind parties, send in order, and poll or webhook status. Includes five free sends on signup.
date: 2026-06-10
updated: 2026-06-10
---
Developers search "docusign template api" when they need repeat sends from stored envelope definitions without re-uploading PDFs every time. DocuSign uses templateId and templateRoles. Atlas uses POST /api/templates/{id}/send with prefill maps.
Share: Send number two should be one API call, not a re-upload ritual.
DocuSign template model
DocuSign templates store documents, recipient roles, and tab placements. Create-from-template calls reference templateId, assign templateRoles with email and name, and optionally merge field data.
Connect webhooks fire on sent, delivered, completed, and declined events. OAuth admin consent precedes most production integrations.
Atlas template model
Atlas templates are saved from a proven envelope in the dashboard. Repeat dispatch uses:
curl -X POST "https://atlaswork.ai/api/templates/$TEMPLATE_ID/send" \
-H "Authorization: Bearer $ATLAS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: docusign-template-api-demo-1" \
-d '{
"parties": [{"email": "signer@example.com", "name": "Signer", "role": "Customer"}],
"prefill": {"company_name": "Acme Inc"}
}'
Trusted templates can auto-send when legal approved the shape. Ad-hoc uploads still return review_url first. That is the trust ladder.
MCP: call get_template then send_contract_from_template. Agents discover prefill keys from the template response.
Full REST reference: e-signature API.
Mapping DocuSign concepts to Atlas
| DocuSign | Atlas |
|---|---|
| templateId | template_id from dashboard |
| templateRoles | parties[] with role matching template |
| tabs / merge fields | prefill map + detected fields |
| Connect webhook | webhook_url + X-Atlas-Signature |
| Create envelope | POST /api/envelope (ad-hoc) |
| Send from template | POST /api/templates/{id}/send |
See DocuSign comparison for pricing context when you evaluate migration.
When to keep DocuSign templates
Enterprise legal already standardized on DocuSign template library and training. Salesforce connector pulls DocuSign template IDs. Migration rewrite cost exceeds per-send savings.
When Atlas templates fit
Your product generates PDF or DOCX externally and only needs a signing layer.
Agents in Claude dispatch repeat NDAs via MCP without OAuth middleware.
Usage pricing at $1 per envelope after five free sends beats per-seat true-ups on automation-only senders.
Create path for first-time templates
Before template send works, prove the document once through ad-hoc create:
curl -X POST https://atlaswork.ai/api/envelope \
-H "Authorization: Bearer $ATLAS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"document_url": "https://example.com/nda.pdf",
"parties": [{"email": "signer@example.com", "name": "Signer", "role": "Customer"}]
}'
Open review_url, confirm fields, send, then save as template in dashboard. Sign up for five free sends to validate the flow.
Implementation depth for "docusign template api"
Production signing integrations fail on edge cases, not happy-path demos. Below is a checklist teams wish they had before the first production send.
Create path hardening
Always pass Idempotency-Key on POST /api/envelope and template send. Retries from Zapier, n8n, or your job runner must not spawn duplicate envelopes.
Upload PDF or DOCX via multipart when bytes live on disk. Use document_url when the file already sits on S3 or your object storage.
Poll fields_status before first ad-hoc send. Template send skips detection when the template is trusted.
Review gate semantics
Atlas defaults to review-first on ad-hoc creates. Templates can auto-send once legal trusts the shape.
If you map DocuSign immediate-send behavior, use auto_send: true on REST create only after review proved the field layout once.
Webhook verification
Set webhook_url at create or template send. Verify X-Atlas-Signature HMAC with your API key before you mutate CRM or billing state.
Handle at least: envelope.sent, envelope.signed, envelope.voided, and envelope.declined.
Map DocuSign Connect event names to Atlas event types in your handler table during migration.
Sequential signing rules
Atlas signs in order. Multi-party sign URLs must include ?t=<token> so each signer only sees their fields.
Template parties order must match sequential signing expectations legal approved.
API surface map
| Action | Atlas route |
|---|---|
| Ad-hoc create | POST /api/envelope |
| Template send | POST /api/templates/{id}/send |
| Read status | GET /api/envelope/{id} |
| Void | POST /api/envelope/{id}/void |
OpenAPI: /openapi.json. Agent instructions: /llms.txt.
MCP parity
Ten MCP tools mirror the lifecycle including get_template and send_contract_from_template.
Connect at /mcp/claude when the caller is an agent rather than your backend.
Error codes you will hit
402 when credits exhausted at send time.
409 when fields_version mismatch or send runs while fields_status is still pending on ad-hoc creates.
400 when parties[] roles do not match template role names. Call get_template first to read expected roles.
Migration checklist from DocuSign templates
Export sample signed PDFs for legal review on Atlas artifacts.
List every Connect webhook consumer and map event types.
Rewrite templateRoles to parties[] with matching role strings.
Run dual-send on one low-risk document before decommissioning DocuSign template IDs in production CRM flows.
Budget one sprint for webhook rewiring and one for legal sign-off on signed PDF samples.
Testing checklist
- Ad-hoc create with two-page PDF or DOCX
- Review_url field confirmation
- Save template from dashboard
- Template send with prefill map
- Webhook delivery and signed PDF download
FAQ
Does Atlas support DocuSign templateId import? No direct import. Re-upload PDF or DOCX, confirm fields once, save as Atlas template.
When are credits consumed? One credit per envelope sent. Drafts and detection are free.
Can templates auto-send? Yes on POST /api/templates/{id}/send when legal trusts the shape. Ad-hoc creates still use review_url by default.