WeGoSign API Documentation
Integrate document signing into your applications with our powerful REST API. Send documents for signature, track progress, and automate your workflows.
Quickstart
Send your first document in 5 minutes
Authentication
Learn how to authenticate API requests
Webhooks
Receive real-time event notifications
Everything you need to integrate WeGoSign into your application
Introduction
The WeGoSign API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Secure
All API requests are made over HTTPS with SHA-256 hashed API keys
Fast
Average response time under 200ms for most operations
RESTful
Standard REST conventions with predictable resource URLs
Idempotent
Safe to retry requests without creating duplicates
Base URL
https://app.wegosign.com/api/v1Quickstart
Send your first document for signature in just a few steps:
Get your API key
Navigate to your organization settings in the dashboard and create a new API key.
API keys start with wgs_live_ for production or wgs_test_ for testing.
Create a template
Upload a PDF and define signature fields via the dashboard or API.
curl -X POST https://app.wegosign.com/api/v1/templates \
-H "Authorization: Bearer wgs_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Employment Contract",
"description": "Standard employment agreement",
"document": {
"data": "base64_encoded_pdf_content",
"filename": "contract.pdf"
}
}'Send for signature
Create an envelope with your template and specify the signers.
curl -X POST https://app.wegosign.com/api/v1/envelopes \
-H "Authorization: Bearer wgs_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"templateId": "template_id_from_step_2",
"title": "Employment Contract - John Doe",
"message": "Please review and sign the attached contract.",
"signers": [
{
"name": "John Doe",
"email": "john@example.com",
"role": "signer"
}
]
}'Authentication
The WeGoSign API uses API keys to authenticate requests. You can create and manage API keys from your organization settings in the dashboard.
API Key Format
wgs_live_*Production keys for live transactions
wgs_test_*Test keys for development and testing
Making Authenticated Requests
Include your API key in the Authorization header using the Bearer scheme:
curl https://app.wegosign.com/api/v1/templates \
-H "Authorization: Bearer wgs_live_your_api_key"Keep your API keys secure
Never expose API keys in client-side code or public repositories. Store them securely in environment variables.
Complete reference for all API endpoints
Templates
Templates are reusable document definitions with pre-configured signature fields. Upload a PDF, define where signatures should go, and reuse it for multiple envelopes.
/api/v1/templatesList Templates
Retrieves all templates for your organization.
Query Parameters
include_archivedInclude archived templates in the response
Response
{
"data": [
{
"id": "tpl_abc123",
"name": "Employment Contract",
"description": "Standard employment agreement",
"pageCount": 3,
"fieldCount": 5,
"roles": ["employee", "employer"],
"isArchived": false,
"createdAt": 1704543600000,
"updatedAt": 1704543600000
}
]
}/api/v1/templatesCreate Template
Creates a new template by uploading a PDF document.
Request Body
Template creation payload with base64-encoded PDF
{
"name": "Employment Contract",
"description": "Standard employment agreement",
"document": {
"data": "base64_encoded_pdf_content",
"filename": "contract.pdf"
}
}Response
Returns the created template with its ID. Use the dashboard to add signature fields.
{
"data": {
"id": "tpl_abc123",
"name": "Employment Contract",
"description": "Standard employment agreement",
"documentName": "contract.pdf",
"createdAt": 1704543600000
}
}Envelopes
Envelopes represent documents sent for signature. Create an envelope from a template, specify signers, and track the signing progress.
Envelope Status Lifecycle
/api/v1/envelopesList Envelopes
Retrieves all envelopes for your organization with optional filtering.
Query Parameters
statusFilter by status: draft, sent, viewed, signed, completed, declined, cancelled, expired
limitNumber of results per page
Response
{
"data": [
{
"id": "env_xyz789",
"title": "Employment Contract - John Doe",
"status": "sent",
"templateName": "Employment Contract",
"signers": [
{
"id": "sgn_abc123",
"name": "John Doe",
"email": "john@example.com",
"role": "employee",
"status": "pending"
}
],
"createdAt": 1704543600000,
"completedAt": null,
"expiresAt": 1705148400000
}
]
}/api/v1/envelopesCreate & Send Envelope
Creates a new envelope from a template and immediately sends it to all signers.
Request Body
Envelope creation payload
{
"templateId": "tpl_abc123",
"title": "Employment Contract - John Doe",
"message": "Please review and sign the attached contract.",
"expiresInHours": 168,
"signers": [
{
"name": "John Doe",
"email": "john@example.com",
"role": "employee",
"signingOrder": 1,
"redirectUrl": "https://yourapp.com/signed"
},
{
"name": "Jane Smith",
"email": "jane@company.com",
"role": "employer",
"signingOrder": 2
}
]
}Response
Returns the envelope ID and signing URLs for each signer.
{
"data": {
"id": "env_xyz789",
"signers": [
{
"id": "sgn_abc123",
"email": "john@example.com",
"signingUrl": "https://app.wegosign.com/sign/abc123..."
},
{
"id": "sgn_def456",
"email": "jane@company.com",
"signingUrl": "https://app.wegosign.com/sign/def456..."
}
]
}
}/api/v1/envelopes/:idGet Envelope
Retrieves detailed information about a specific envelope.
Path Parameters
idThe envelope ID
Response
{
"data": {
"id": "env_xyz789",
"title": "Employment Contract - John Doe",
"status": "completed",
"createdAt": 1704543600000,
"sentAt": 1704543610000,
"completedAt": 1704630000000,
"expiresAt": 1705148400000
}
}/api/v1/envelopes/:idCancel Envelope
Cancels an envelope. Only envelopes in 'sent' status can be cancelled.
Path Parameters
idThe envelope ID
Response
{
"data": {
"id": "env_xyz789",
"status": "cancelled"
}
}/api/v1/envelopes/:id/remindSend Reminder
Sends a reminder email to signers who haven't completed signing.
Path Parameters
idThe envelope ID
Request Body
Optional parameters for the reminder
{
"signerId": "sgn_abc123",
"message": "Friendly reminder to sign the document."
}Response
{
"data": {
"success": true,
"remindedCount": 1
}
}/api/v1/envelopes/:id/audit-logGet Audit Log
Retrieves the complete audit trail for an envelope showing all actions.
Query Parameters
limitNumber of records to return
Path Parameters
idThe envelope ID
Response
{
"data": [
{
"id": "log_1",
"action": "envelope_created",
"actionDescription": "Envelope created",
"actorType": "api",
"actorEmail": "admin@company.com",
"ipAddress": "192.168.1.1",
"timestamp": 1704543600000
},
{
"id": "log_2",
"action": "document_viewed",
"actionDescription": "Document viewed by signer",
"actorType": "signer",
"actorEmail": "john@example.com",
"ipAddress": "203.0.113.50",
"timestamp": 1704550000000
}
]
}Signers
Signers are the recipients of an envelope who need to sign the document. Track individual signer progress and status.
/api/v1/envelopes/:id/signersGet Envelope Signers
Retrieves all signers for an envelope with their current status.
Path Parameters
idThe envelope ID
Response
{
"data": [
{
"id": "sgn_abc123",
"email": "john@example.com",
"name": "John Doe",
"role": "employee",
"signingOrder": 1,
"status": "signed",
"viewedAt": 1704550000000,
"signedAt": 1704560000000,
"declinedAt": null,
"declineReason": null,
"reminderSentAt": null
}
]
}Bulk Sends
Send documents to multiple recipients at once. Perfect for onboarding, mass communications, or any scenario requiring the same document sent to many people.
/api/v1/bulk-sendsCreate Bulk Send
Creates and initiates a bulk send operation for multiple recipients.
Request Body
Bulk send creation payload
{
"templateId": "tpl_abc123",
"titlePrefix": "Onboarding Document",
"message": "Welcome! Please sign your onboarding documents.",
"expiresInHours": 168,
"recipients": [
{
"email": "john@example.com",
"name": "John Doe",
"role": "employee"
},
{
"email": "jane@example.com",
"name": "Jane Smith",
"role": "employee"
}
]
}Response
Bulk sends are processed asynchronously. Use the GET endpoint to check progress.
{
"data": {
"id": "bulk_abc123",
"totalRecipients": 2,
"status": "pending",
"message": "Bulk send started. Envelopes are being created in the background."
}
}/api/v1/bulk-sends/:idGet Bulk Send Status
Retrieves the status and results of a bulk send operation.
Path Parameters
idThe bulk send ID
Response
{
"data": {
"id": "bulk_abc123",
"templateId": "tpl_abc123",
"templateName": "Employment Contract",
"status": "completed",
"totalRecipients": 2,
"processedCount": 2,
"successCount": 2,
"failureCount": 0,
"errors": [],
"createdAt": 1704543600000,
"completedAt": 1704543700000,
"envelopes": [
{
"id": "env_xyz789",
"title": "Onboarding Document - John Doe",
"status": "sent",
"signers": [
{
"email": "john@example.com",
"status": "sent"
}
]
}
]
}
}Webhooks
Receive real-time notifications when events occur in your account. Configure webhook endpoints to automate workflows and keep your systems in sync.
/api/v1/webhooksCreate Webhook
Creates a new webhook endpoint to receive event notifications.
Request Body
Webhook configuration
{
"url": "https://yourapp.com/webhooks/wegosign",
"events": [
"envelope.created",
"envelope.sent",
"envelope.completed",
"signer.viewed",
"signer.signed",
"signer.declined"
],
"description": "Main production webhook"
}Response
The webhook secret is only shown once on creation. Store it securely for signature verification.
{
"data": {
"id": "whk_abc123",
"url": "https://yourapp.com/webhooks/wegosign",
"events": ["envelope.created", "envelope.completed", "signer.signed"],
"description": "Main production webhook",
"secret": "whsec_abc123xyz789...",
"isActive": true,
"createdAt": 1704543600000
}
}/api/v1/webhooksList Webhooks
Retrieves all webhooks configured for your organization.
Response
{
"data": [
{
"id": "whk_abc123",
"url": "https://yourapp.com/webhooks/wegosign",
"events": ["envelope.completed", "signer.signed"],
"description": "Main production webhook",
"isActive": true,
"failureCount": 0,
"lastDeliveredAt": 1704550000000,
"createdAt": 1704543600000
}
]
}/api/v1/webhooks/:idDelete Webhook
Permanently deletes a webhook endpoint.
Path Parameters
idThe webhook ID
Response
{
"data": {
"id": "whk_abc123",
"deleted": true
}
}In-depth guides for common use cases
Document Signing Flow
Understanding the complete lifecycle of a document from creation to completion.
Create Template
Upload a PDF and define signature fields via the dashboard or API. Templates are reusable and can be used for multiple envelopes.
Create & Send Envelope
Create an envelope from a template and specify signers. Each signer receives a unique, secure signing link via email.
Signer Views Document
When a signer clicks their link, they can view the document and see where they need to sign. This triggers the 'signer.viewed' webhook.
Signer Completes Signing
The signer fills in required fields and signs. They can draw, type, or upload a signature. This triggers 'signer.signed'.
Document Completed
When all signers complete, the envelope status changes to 'completed'. Download the signed PDF with embedded audit trail.
Signature Field Types
signatureFull signature - draw, type, or upload
initialsQuick initials field
dateAuto-filled date field
textFree-form text input
checkboxCheckbox for acknowledgments
Webhook Events
WeGoSign sends webhook notifications for the following events:
envelope.createdAn envelope has been created
envelope.sentAn envelope has been sent to signers
envelope.completedAll signers have completed signing
envelope.cancelledAn envelope has been cancelled
envelope.expiredAn envelope has expired without completion (coming soon)
signer.viewedA signer has viewed the document
signer.signedA signer has completed signing
signer.declinedA signer has declined to sign
Webhook Payload Structure
{
"eventId": "evt_abc123xyz",
"eventType": "envelope.completed",
"timestamp": 1704543600000,
"data": {
"envelopeId": "env_xyz789",
"title": "Employment Contract - John Doe",
"status": "completed",
"completedAt": 1704543600000,
"signers": [
{
"id": "sgn_abc123",
"email": "john@example.com",
"name": "John Doe",
"signedAt": 1704543600000
}
]
}
}Verifying Webhook Signatures
Verify that webhooks are actually from WeGoSign by checking the signature header:
1import crypto from 'crypto';23function verifyWebhookSignature(payload, signature, timestamp, secret) {4 // Signature format is "sha256=<hex>"5 const signatureHex = signature.replace('sha256=', '');6 7 // Create message: timestamp.payload8 const message = `${timestamp}.${payload}`;9 10 const expectedSignature = crypto11 .createHmac('sha256', secret)12 .update(message)13 .digest('hex');1415 return crypto.timingSafeEqual(16 Buffer.from(signatureHex),17 Buffer.from(expectedSignature)18 );19}2021// In your webhook handler22app.post('/webhooks/wegosign', (req, res) => {23 const signature = req.headers['x-webhook-signature'];24 const timestamp = req.headers['x-webhook-timestamp'];25 const eventType = req.headers['x-webhook-event'];26 27 const isValid = verifyWebhookSignature(28 JSON.stringify(req.body),29 signature,30 timestamp,31 process.env.WEBHOOK_SECRET32 );3334 if (!isValid) {35 return res.status(401).send('Invalid signature');36 }3738 console.log('Processing event:', eventType);39 // Process the webhook...40 res.status(200).send('OK');41});Error Handling
The API uses standard HTTP status codes and returns error details in a consistent format.
Error Response Format
{
"error": "validation_error",
"message": "Invalid email format for signer",
"details": {
"field": "signers[0].email",
"value": "invalid-email"
}
}HTTP Status Codes
200Success - Request completed successfully
201Created - Resource created successfully
400Bad Request - Invalid request parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Server Error - Something went wrong on our end
Rate Limits
API rate limits vary by plan and operation type. Rate limit information is included in response headers.
Rate Limit Headers
X-RateLimit-LimitMaximum requests allowed in the window
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when the limit resets
Retry-AfterSeconds to wait before retrying (429 responses only)
Limits by Plan
| Plan | Read Operations | Write Operations | Bulk Operations |
|---|---|---|---|
| Free | API access not available — upgrade to Pro | ||
| Pro | 200/min | 50/min | 10/min |
| Enterprise | 200/min | 50/min | 10/min |
Ready to get started?
Create your free account and get API keys to start integrating document signing today.