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://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://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://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://wegosign.com/api/v1/templates \
-H "Authorization: Bearer wgs_live_<YOUR_API_KEY>"Alternative: X-API-Key Header
If your platform strips Authorization headers (common with some serverless environments), you can use theX-API-Key header as a fallback:
X-API-Key: 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. Optionally include fields with conditional logic.
Request Body
Template creation payload with base64-encoded PDF and optional fields
{
"name": "Employment Contract",
"description": "Standard employment agreement",
"document": {
"data": "base64_encoded_pdf_content",
"filename": "contract.pdf"
},
"fields": [
{
"id": "field_1",
"type": "signature",
"role": "employee",
"page": 1,
"x": 100,
"y": 500,
"width": 200,
"height": 50,
"required": true,
"label": "Employee Signature"
},
{
"id": "field_2",
"type": "dropdown",
"role": "employee",
"page": 1,
"x": 100,
"y": 300,
"width": 150,
"height": 30,
"required": true,
"label": "Department",
"options": [
{ "label": "Engineering", "value": "eng" },
{ "label": "Sales", "value": "sales" }
]
}
]
}Response
Returns the created template with field count and roles.
{
"data": {
"id": "tpl_abc123",
"name": "Employment Contract",
"description": "Standard employment agreement",
"documentName": "contract.pdf",
"fieldCount": 2,
"roles": ["employee"],
"createdAt": 1704543600000
}
}/api/v1/templates/:idGet Template
Retrieves a template with fields, roles, placeholder keys, archive status, and document URL.
Path Parameters
idTemplate ID
Response
{
"data": {
"id": "tpl_abc123",
"name": "Employment Contract",
"description": "Standard employment agreement",
"pageCount": 3,
"fields": [],
"roles": ["employee"],
"placeholderKeys": [],
"isArchived": false,
"documentUrl": "https://...",
"createdAt": 1704543600000,
"updatedAt": 1704543600000
}
}/api/v1/templates/:idUpdate Template
Updates template metadata.
Path Parameters
idTemplate ID
Request Body
Template metadata fields
{
"name": "Employment Contract v2",
"description": "Updated employment agreement"
}Response
{
"data": {
"id": "tpl_abc123",
"name": "Employment Contract v2",
"description": "Updated employment agreement",
"updatedAt": 1704543600000
}
}/api/v1/templates/:idArchive Template
Archives a template so it no longer appears in default template lists.
Path Parameters
idTemplate ID
Response
{
"data": {
"id": "tpl_abc123",
"archived": true
}
}/api/v1/templates/:id/fieldsUpdate Template Fields
Updates all fields for a template. Supports all field types and conditional logic.
Request Body
Array of fields with positions, types, and optional conditions
{
"fields": [
{
"id": "field_1",
"type": "dropdown",
"role": "signer",
"page": 1,
"x": 100,
"y": 200,
"width": 150,
"height": 30,
"required": true,
"label": "Select Option",
"options": [
{ "label": "Option A", "value": "a" },
{ "label": "Option B", "value": "b" }
]
},
{
"id": "field_2",
"type": "text",
"role": "signer",
"page": 1,
"x": 100,
"y": 250,
"width": 200,
"height": 30,
"required": false,
"label": "Additional Details",
"conditions": [
{
"sourceFieldId": "field_1",
"operator": "equals",
"value": "b"
}
],
"conditionAction": "show",
"conditionLogic": "all"
}
]
}Response
Returns the updated field count and roles.
{
"data": {
"id": "tpl_abc123",
"fieldCount": 2,
"roles": ["signer"],
"updatedAt": 1704543600000
}
}/api/v1/templates/:id/fieldsGet Template Fields
Retrieves all fields for a template including their conditions.
Response
Returns all fields, roles, and placeholder keys for the template.
{
"data": {
"templateId": "tpl_abc123",
"fields": [
{
"id": "field_1",
"type": "dropdown",
"role": "signer",
"page": 1,
"x": 100,
"y": 200,
"width": 150,
"height": 30,
"required": true,
"label": "Select Option",
"options": [
{ "label": "Option A", "value": "a" },
{ "label": "Option B", "value": "b" }
]
}
],
"roles": ["signer"],
"placeholderKeys": []
}
}Packages
Packages bundle multiple templates into a single multi-document signing workflow. Create packages, map package-level roles to template roles, and send them through the envelopes API.
/api/v1/packagesList Packages
Retrieves all template packages for your organization.
Query Parameters
include_archivedInclude archived packages in the response
Response
{
"data": [
{
"id": "pkg_abc123",
"name": "New Hire Package",
"description": "All onboarding documents",
"status": "active",
"templates": [
{
"templateId": "tpl_contract",
"order": 0,
"name": "Employment Contract",
"pageCount": 3,
"fieldCount": 8,
"roles": ["employee", "employer"]
}
],
"roleMappings": [],
"stats": {
"documentCount": 2,
"totalFields": 14,
"totalPages": 7,
"roleCount": 2
},
"createdAt": 1704543600000,
"updatedAt": 1704543600000
}
]
}/api/v1/packagesCreate Package
Creates a package from one or more templates. Role mappings are auto-generated when omitted.
Request Body
Package creation payload
{
"name": "New Hire Package",
"description": "All onboarding documents",
"templateIds": ["tpl_contract", "tpl_w4"],
"roleMappings": [
{
"packageRoleId": "role_1",
"packageRoleName": "Employee",
"color": "#3b82f6",
"templateRoles": [
{ "templateId": "tpl_contract", "roleId": "employee" },
{ "templateId": "tpl_w4", "roleId": "employee" }
]
}
]
}Response
Returns the created package with template details and aggregate stats.
{
"data": {
"id": "pkg_abc123",
"name": "New Hire Package",
"description": "All onboarding documents",
"status": "active",
"templates": [
{
"templateId": "tpl_contract",
"order": 0,
"name": "Employment Contract",
"pageCount": 3,
"fieldCount": 8,
"roles": ["employee", "employer"]
}
],
"roleMappings": [],
"stats": {
"documentCount": 2,
"totalFields": 14,
"totalPages": 7,
"roleCount": 2
},
"createdAt": 1704543600000,
"updatedAt": 1704543600000
}
}/api/v1/packages/:idGet Package
Retrieves a specific package by ID.
Path Parameters
idThe package ID
Response
Returns package metadata, template details, role mappings, and stats.
{
"data": {
"id": "pkg_abc123",
"name": "New Hire Package",
"description": "All onboarding documents",
"status": "active",
"templates": [],
"roleMappings": [],
"stats": {
"documentCount": 2,
"totalFields": 14,
"totalPages": 7,
"roleCount": 2
},
"createdAt": 1704543600000,
"updatedAt": 1704543600000
}
}/api/v1/packages/:idUpdate Package
Updates package metadata, template order, or role mappings.
Path Parameters
idThe package ID
Request Body
Fields to update
{
"name": "Updated New Hire Package",
"templateIds": ["tpl_contract", "tpl_w4", "tpl_handbook"]
}Response
{
"data": {
"id": "pkg_abc123",
"name": "Updated New Hire Package",
"status": "active",
"templates": [],
"roleMappings": [],
"stats": {
"documentCount": 3,
"totalFields": 20,
"totalPages": 12,
"roleCount": 2
},
"createdAt": 1704543600000,
"updatedAt": 1704550000000
}
}/api/v1/packages/:idArchive Package
Archives a package so it no longer appears in default package lists.
Path Parameters
idThe package ID
Response
{
"data": {
"id": "pkg_abc123",
"archived": true
}
}Envelopes
Envelopes represent documents sent for signature. Create an envelope from a template or package, specify one or more signers, and track the signing progress.
Envelope Status Lifecycle
Multiple Signers & Signing Order
Sequential Signing
Signers sign one after another. Use different signingOrder values (1, 2, 3...). Signer 2 can only sign after Signer 1 completes.
Parallel Signing
All signers can sign simultaneously. Use the same signingOrder value for all signers (e.g., all set to 1).
/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 or package with one or more signers. Supports sequential or parallel signing.
Query Parameters
templateIdTemplate ID to send. Provide exactly one of templateId or packageId.
packageIdPackage ID for a multi-document signing workflow. Provide exactly one of templateId or packageId.
signersArray of signers. Each signer needs name, email. Optional: role, signingOrder (for sequential signing), redirectUrl.
signers[].signingOrderOrder in which signers sign. Same number = parallel signing. Different numbers = sequential (1 signs first, then 2, etc.).
scheduledAtSchedule envelope to be sent at a future time. Must be 5 min to 30 days in the future. Omit to send immediately.
Request Body
Envelope creation payload with multiple signers
{
"templateId": "tpl_abc123",
"title": "Employment Contract - John Doe",
"message": "Please review and sign the attached contract.",
"expiresInHours": 168,
"scheduledAt": "2026-01-15T09:00:00Z",
"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
},
{
"name": "Legal Team",
"email": "legal@company.com",
"role": "approver",
"signingOrder": 3
}
]
}Response
Returns envelope ID and unique signing URLs for each signer. Status is 'scheduled' if scheduledAt provided, otherwise 'sent'.
{
"data": {
"id": "env_xyz789",
"status": "scheduled",
"scheduledAt": "2026-01-15T09:00:00.000Z",
"signers": [
{
"id": "sgn_abc123",
"email": "john@example.com",
"signingUrl": "https://wegosign.com/sign/abc123..."
},
{
"id": "sgn_def456",
"email": "jane@company.com",
"signingUrl": "https://wegosign.com/sign/def456..."
},
{
"id": "sgn_ghi789",
"email": "legal@company.com",
"signingUrl": "https://wegosign.com/sign/ghi789..."
}
]
}
}/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
}
]
}/api/v1/envelopes/:id/downloadDownload Signed Document
Retrieves download URLs for the signed PDF document and certificate. Only available for completed envelopes.
Query Parameters
typeWhat to download: 'document', 'certificate', or 'all'
Path Parameters
idThe envelope ID
Response
Download URLs expire after 1 hour. Request new URLs if they have expired.
{
"data": {
"id": "env_xyz789",
"title": "Employment Contract - John Doe",
"status": "completed",
"completedAt": 1704630000000,
"documentUrl": "https://storage.convex.cloud/...",
"certificateUrl": "https://storage.convex.cloud/...",
"expiresIn": "1 hour"
}
}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. Supports column mapping for placeholders and prefilled fields, scheduled sends, and error reporting.
/api/v1/bulk-sendsCreate Bulk Send
Creates and initiates a bulk send operation for multiple recipients. Supports column mappings for document placeholders and prefilled signer fields, as well as scheduled sends.
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",
"additionalData": {
"company": "Acme Inc",
"start_date": "2024-02-01",
"employee_id": "EMP-001"
}
},
{
"email": "jane@example.com",
"name": "Jane Smith",
"role": "employee",
"additionalData": {
"company": "Acme Inc",
"start_date": "2024-02-15",
"employee_id": "EMP-002"
}
}
],
"columnMappings": {
"placeholders": {
"company": "company_name",
"start_date": "employment_start_date"
},
"signerFields": {
"employee_id": "field_employee_id"
}
},
"scheduledAt": 1704600000000
}Response
Bulk sends are processed asynchronously. If scheduledAt is provided, status will be 'scheduled' and processing will begin at that time. Column mappings allow mapping recipient additionalData to document placeholders or prefillable signer fields.
{
"data": {
"id": "bulk_abc123",
"totalRecipients": 2,
"status": "scheduled",
"scheduledAt": 1704600000000,
"message": "Bulk send scheduled for 2024-01-07T08:00:00.000Z"
}
}/api/v1/bulk-sends/:idGet Bulk Send Status
Retrieves the status and results of a bulk send operation, including all created envelopes.
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": [],
"columnMappings": {
"placeholders": { "company": "company_name" },
"signerFields": { "employee_id": "field_employee_id" }
},
"scheduledAt": null,
"createdAt": 1704543600000,
"completedAt": 1704543700000,
"envelopes": [
{
"id": "env_xyz789",
"title": "Onboarding Document - John Doe",
"status": "sent",
"placeholderValues": [
{ "key": "company_name", "value": "Acme Inc" }
],
"signers": [
{
"email": "john@example.com",
"status": "sent",
"prefilledFields": { "field_employee_id": "EMP-001" }
}
]
}
]
}
}/api/v1/bulk-sends/:id/errorsGet Error Report
Retrieves a detailed error report for a bulk send. Useful for identifying which recipients failed and why. Supports JSON and CSV formats.
Path Parameters
idThe bulk send ID
formatResponse format: 'json' (default) or 'csv'
Response
Use ?format=csv to download errors as a CSV file for easy analysis in spreadsheets.
{
"data": {
"bulkSendId": "bulk_abc123",
"templateId": "tpl_abc123",
"titlePrefix": "Onboarding Document",
"status": "completed",
"summary": {
"totalRecipients": 10,
"successCount": 8,
"failureCount": 2
},
"createdAt": 1704543600000,
"completedAt": 1704543700000,
"errors": [
{
"row": 5,
"email": "invalid@example",
"errorType": "invalid_data",
"errorMessage": "Invalid email format"
},
{
"row": 8,
"email": "quota@example.com",
"errorType": "quota_exceeded",
"errorMessage": "Monthly envelope limit reached"
}
]
}
}/api/v1/bulk-sends/:idCancel Bulk Send
Cancels a bulk send operation and all its associated pending envelopes. Scheduled bulk sends can also be cancelled before they start processing.
Path Parameters
idThe bulk send ID
Response
Returns the number of envelopes that were cancelled. Completed bulk sends cannot be cancelled.
{
"data": {
"id": "bulk_abc123",
"cancelled": true,
"cancelledEnvelopes": 5
}
}Bulk Send Webhook Events
Subscribe to these webhook events to track bulk send progress:
bulk_send.started- Fired when bulk send processing beginsbulk_send.completed- Fired when all envelopes have been processedbulk_send.failed- Fired when bulk send fails (all recipients failed)
Invoices
Create, send, and manage client invoices programmatically. Track payments, record partial payments, and receive webhook notifications for the full invoice lifecycle.
Invoice Lifecycle
Invoices can also transition to overdue (past due date), partially_paid (partial payment recorded), or void (cancelled).
/api/v1/invoicesList Invoices
Retrieves all invoices for your organization, optionally filtered by status.
Query Parameters
statusFilter by status: draft, sent, viewed, overdue, paid, partially_paid, void
limitMaximum results to return (default: 50, max: 100)
Response
{
"data": [
{
"id": "inv_abc123",
"invoiceNumber": "INV-0001",
"clientName": "John Smith",
"clientEmail": "john@example.com",
"clientCompany": "Acme Corp",
"title": "Consulting Services - March 2026",
"currency": "NGN",
"totalKobo": 5000000,
"status": "sent",
"invoiceDate": 1711929600000,
"dueDate": 1714521600000,
"sentAt": 1711929600000,
"viewCount": 3,
"createdAt": 1711929600000
}
]
}/api/v1/invoicesCreate Invoice
Creates a new draft invoice. The invoice must be sent separately using the Send endpoint.
Request Body
Invoice details. All amounts are in kobo (smallest currency unit).
{
"clientName": "John Smith",
"clientEmail": "john@example.com",
"clientCompany": "Acme Corp",
"title": "Consulting Services - March 2026",
"currency": "NGN",
"lineItems": [
{
"description": "Strategy consulting (10 hours)",
"quantity": 10,
"unitPriceKobo": 500000,
"totalKobo": 5000000
},
{
"description": "Document review",
"quantity": 1,
"unitPriceKobo": 200000,
"totalKobo": 200000
}
],
"subtotalKobo": 5200000,
"taxRate": 7.5,
"taxAmountKobo": 390000,
"totalKobo": 5590000,
"invoiceDate": 1711929600000,
"dueDate": 1714521600000,
"notes": "Payment due within 30 days."
}Response
{
"data": {
"id": "inv_abc123",
"invoiceNumber": "INV-0001",
"status": "draft",
"totalKobo": 5590000,
"viewToken": "a1b2c3d4...",
"createdAt": 1711929600000
}
}/api/v1/invoices/:idGet Invoice
Retrieves a specific invoice with full details including payment history.
Path Parameters
idThe invoice ID
Response
{
"data": {
"id": "inv_abc123",
"invoiceNumber": "INV-0001",
"clientName": "John Smith",
"clientEmail": "john@example.com",
"title": "Consulting Services",
"currency": "NGN",
"lineItems": [...],
"subtotalKobo": 5200000,
"taxRate": 7.5,
"taxAmountKobo": 390000,
"totalKobo": 5590000,
"paidAmountKobo": 2000000,
"status": "partially_paid",
"payments": [
{
"amountKobo": 2000000,
"paymentDate": 1712534400000,
"paymentMethod": "bank_transfer",
"reference": "TXN-12345"
}
],
"viewCount": 5,
"lastViewedAt": 1712620800000,
"sentAt": 1711929600000,
"dueDate": 1714521600000
}
}/api/v1/invoices/:idUpdate Invoice
Updates a draft invoice. Only invoices in draft status can be modified.
Path Parameters
idThe invoice ID
Request Body
Fields to update (all optional)
{
"title": "Updated Title",
"dueDate": 1714521600000,
"notes": "Updated payment terms."
}Response
{
"data": {
"id": "inv_abc123",
"status": "draft",
"title": "Updated Title",
"updatedAt": 1712534400000
}
}/api/v1/invoices/:id/sendSend Invoice
Sends a draft invoice to the client via email. The invoice status changes to 'sent' and a public view link is generated.
Path Parameters
idThe invoice ID
Response
Triggers invoice.sent webhook. The client receives an email with a link to view and download the invoice.
{
"data": {
"success": true
}
}/api/v1/invoices/:id/paymentsRecord Payment
Records a payment against an invoice. Supports partial payments — the invoice status automatically updates to 'partially_paid' or 'paid' based on the total amount received.
Path Parameters
idThe invoice ID
Request Body
Payment details
{
"amountKobo": 2000000,
"paymentDate": "2026-04-10T00:00:00.000Z",
"paymentMethod": "bank_transfer",
"reference": "TXN-12345",
"note": "First installment"
}Response
Triggers invoice.payment_recorded webhook on every payment. When fully paid, also triggers invoice.paid webhook and sends a receipt email to the client.
{
"data": {
"success": true,
"status": "partially_paid"
}
}/api/v1/invoices/:id/voidVoid Invoice
Voids an invoice, making it permanently inactive. Cannot void invoices that are already paid or voided.
Path Parameters
idThe invoice ID
Response
Triggers invoice.voided webhook.
{
"data": {
"success": true
}
}Generic Business Apps
Use one API surface for available business apps that share the generic record engine, including Business Intake, Hiring Packets, and Renewals & Compliance.
/api/v1/apps/:appSlug/recordsList App Records
Lists records for an available generic business app.
Query Parameters
statusOptional record status filter
limitMaximum records to return
Path Parameters
appSlugAvailable app slug, such as business-intake, hiring-packets, or renewals-compliance
Response
{
"data": [
{
"record": {
"id": "rec_abc123",
"appSlug": "business-intake",
"recordType": "vendor_onboarding",
"title": "Acme Catering",
"status": "pending_review"
}
}
]
}/api/v1/apps/:appSlug/recordsCreate App Record
Creates a generic app record using the app's default record type unless recordType is provided.
Path Parameters
appSlugAvailable app slug
Request Body
Generic app record fields
{
"title": "Acme Catering",
"recordType": "vendor_onboarding",
"status": "pending_review",
"metadata": {
"contactEmail": "sam@example.com"
}
}Response
{
"data": {
"id": "rec_abc123"
}
}/api/v1/apps/:appSlug/records/:idGet App Record
Returns one generic app record by ID.
Path Parameters
appSlugAvailable app slug
idGeneric app record ID
Response
{
"data": {
"record": {
"id": "rec_abc123",
"appSlug": "business-intake",
"recordType": "vendor_onboarding",
"title": "Acme Catering",
"status": "pending_review"
}
}
}/api/v1/apps/:appSlug/records/:idUpdate App Record
Updates a generic app record status, title, metadata, or related party fields.
Path Parameters
appSlugAvailable app slug
idGeneric app record ID
Request Body
Partial record update
{
"status": "approved",
"metadata": {
"reviewedBy": "finance"
}
}Response
{
"data": {
"success": true
}
}/api/v1/apps/:appSlug/records/:id/documentsList App Record Documents
Lists documents attached to a generic app record. The API resolves the record and uses its actual record type.
Path Parameters
appSlugAvailable app slug
idGeneric app record ID
Response
{
"data": [
{
"id": "doc_abc123",
"entityType": "vendor_onboarding",
"fileName": "acme-w9.pdf",
"status": "pending_review"
}
]
}/api/v1/apps/:appSlug/records/:id/documentsAttach App Record Document
Uploads a base64-encoded document to a generic app record.
Path Parameters
appSlugAvailable app slug
idGeneric app record ID
Request Body
Document upload payload
{
"requirementKey": "tax_form",
"label": "Signed W-9",
"document": {
"filename": "acme-w9.pdf",
"contentType": "application/pdf",
"data": "base64..."
}
}Response
{
"data": {
"id": "doc_abc123"
}
}/api/v1/apps/:appSlug/records/:id/approvalsList App Record Approvals
Lists approval requests for a generic app record.
Path Parameters
appSlugAvailable app slug
idGeneric app record ID
Response
{
"data": [
{
"id": "appr_abc123",
"entityType": "vendor_onboarding",
"status": "pending"
}
]
}/api/v1/apps/:appSlug/records/:id/approvalsRequest App Record Approval
Creates an internal approval request for a generic app record.
Path Parameters
appSlugAvailable app slug
idGeneric app record ID
Request Body
Approval request payload
{
"title": "Finance approval",
"mode": "sequential",
"approvers": [
{ "approverEmail": "finance@example.com", "stepNumber": 1 }
]
}Response
{
"data": {
"id": "appr_abc123"
}
}/api/v1/apps/:appSlug/records/:id/portal-linksList App Record Portal Links
Lists public intake portal links for a generic app record.
Path Parameters
appSlugAvailable app slug
idGeneric app record ID
Response
{
"data": [
{
"id": "portal_abc123",
"status": "active",
"recipientEmail": "sam@example.com"
}
]
}/api/v1/apps/:appSlug/records/:id/portal-linksCreate App Record Portal Link
Creates a public intake portal link for a generic app record.
Path Parameters
appSlugAvailable app slug
idGeneric app record ID
Request Body
Portal link payload
{
"recipientName": "Sam Lee",
"recipientEmail": "sam@example.com",
"notificationChannels": ["email"]
}Response
{
"data": {
"id": "portal_abc123",
"url": "https://wegosign.com/intake/token"
}
}/api/v1/apps/:appSlug/records/:id/portal-links/:portalLinkIdRevoke App Record Portal Link
Revokes a public intake portal link for a generic app record.
Path Parameters
appSlugAvailable app slug
idGeneric app record ID
portalLinkIdPortal link ID
Response
{
"data": {
"status": "revoked"
}
}Business Intake
Create intake records for clients, vendors, partners, suppliers, consultants, agencies, contractors, and other business relationships with type-specific documents, approvals, tasks, team assignments, portal links, and encrypted vault fields.
/api/v1/business-intakeList Business Intakes
Lists Business Intake records with checklist readiness, task counts, approval count, team count, portal count, and vault summary counts.
Query Parameters
statusFilter by status, for example pending_review or approved
limitMaximum records to return (max: 200)
Response
{
"data": [
{
"record": {
"id": "rec_abc123",
"title": "Acme Catering",
"status": "pending_review",
"metadata": { "intakeType": "vendor" },
"relatedParty": {
"name": "Sam Lee",
"email": "sam@example.com",
"company": "Acme Catering"
}
},
"checklistSummary": {
"requiredCount": 4,
"approvedRequired": 3,
"missingRequired": 1,
"completionPercent": 75
},
"pendingApprovalCount": 1,
"vaultItemCount": 2
}
]
}/api/v1/business-intakeCreate Business Intake
Creates a Business Intake record. Set intakeType to client, vendor, partner, supplier, consultant, agency, contractor, or other.
Request Body
Business intake fields
{
"title": "Acme Catering",
"intakeType": "vendor",
"contactName": "Sam Lee",
"contactEmail": "sam@example.com",
"companyName": "Acme Catering",
"serviceCategory": "Catering",
"taxClassification": "LLC",
"paymentTerms": "Net 30",
"riskLevel": "standard",
"targetStartDate": "2026-05-15"
}Response
{
"data": {
"id": "rec_abc123"
}
}/api/v1/business-intake/:intakeIdGet Business Intake
Returns the intake record, required document checklist, documents, tasks, approvals, team members, portal links, vault summaries, action register entries, and audit activity.
Path Parameters
intakeIdBusiness Intake record ID
Response
{
"data": {
"record": { "id": "rec_abc123", "title": "Acme Catering", "status": "pending_review" },
"checklistSummary": { "completionPercent": 75 },
"checklist": [...],
"documents": [...],
"actions": [...],
"approvals": [...],
"members": [...],
"vaultItems": [
{ "fieldKey": "bank_account", "label": "Bank account", "redactedPreview": "****1234" }
]
}
}/api/v1/business-intake/:intakeId/documentsAttach Business Intake Document
Uploads a base64-encoded document to an intake checklist item.
Path Parameters
intakeIdBusiness Intake record ID
Request Body
Document upload payload
{
"requirementKey": "tax_form",
"status": "pending_review",
"accessLevel": "finance",
"isSensitive": true,
"document": {
"filename": "acme-w9.pdf",
"contentType": "application/pdf",
"data": "base64..."
}
}Response
{
"data": {
"id": "doc_abc123"
}
}/api/v1/business-intake/:intakeId/tasksCreate Business Intake Task
Creates an intake follow-up, onboarding, review, or setup task.
Request Body
Task payload
{
"title": "Verify payment details",
"description": "Confirm remittance details with finance",
"dueDate": 1778803200000
}Response
{
"data": {
"id": "appr_abc123"
}
}/api/v1/business-intake/:intakeId/approvalsRequest Business Intake Approval
Creates an internal approval request for intake review.
Request Body
Approval request
{
"title": "Finance approval",
"mode": "sequential",
"approvers": [
{ "approverEmail": "finance@example.com", "stepNumber": 1 }
]
}Response
{
"data": {
"id": "appr_abc123"
}
}/api/v1/business-intake/:intakeId/teamAssign Business Intake Team Member
Assigns an existing workspace member to the intake record.
Request Body
Team assignment
{
"userId": "user_abc123",
"role": "contributor"
}Response
{
"data": {
"id": "member_abc123"
}
}/api/v1/business-intake/:intakeId/portal-linksCreate Business Intake Portal Link
Creates a public intake link for document collection and optional email/SMS notification.
Request Body
Portal link payload
{
"recipientName": "Sam Lee",
"recipientEmail": "sam@example.com",
"recipientPhone": "+15551234567",
"notificationChannels": ["email", "sms"]
}Response
{
"data": {
"id": "portal_abc123"
}
}/api/v1/business-intake/:intakeId/vaultSet Business Intake Vault Field
Creates or updates an encrypted intake vault field. The API returns the vault item ID, not the plaintext value.
Request Body
Encrypted field payload
{
"fieldKey": "bank_account",
"label": "Bank account",
"value": "1234567890",
"accessLevel": "finance"
}Response
{
"data": {
"id": "vault_abc123"
}
}Hiring Packets
Create hiring packet records, collect offer letters and agreements, track policy acknowledgments, manage onboarding tasks, assign team members, create external portal links, request approvals, and store restricted values in the encrypted vault.
/api/v1/hiring-packetsList Hiring Packets
Lists Hiring Packet records with checklist readiness, approval count, open task count, team count, and vault summary counts.
Query Parameters
statusFilter by status, for example offer_sent or cleared_to_start
limitMaximum records to return (max: 200)
Response
{
"data": [
{
"packet": { "id": "rec_abc123", "title": "Avery Johnson", "status": "offer_sent" },
"checklistSummary": { "requiredCount": 3, "approvedRequired": 1, "completionPercent": 33 },
"openTaskCount": 2,
"teamMemberCount": 1,
"vaultItemCount": 0
}
]
}/api/v1/hiring-packetsCreate Hiring Packet
Creates a Hiring Packet record with candidate, role, worker type, start date, manager, and compensation metadata.
Request Body
Hiring packet fields
{
"candidateName": "Avery Johnson",
"candidateEmail": "avery@example.com",
"candidatePhone": "+2348012345678",
"smsAlerts": true,
"roleTitle": "Operations Manager",
"department": "Operations",
"workerType": "employee",
"startDate": "2026-05-15"
}Response
{
"data": {
"id": "rec_abc123"
}
}/api/v1/hiring-packets/:packetId/tasksCreate Hiring Packet Task
Creates an onboarding task and emits generic app action events plus Hiring Packet task events.
Request Body
Task fields
{
"title": "Provision laptop",
"dueDate": 1770000000000
}Response
{
"data": {
"id": "action_abc123"
}
}/api/v1/hiring-packets/:packetId/portal-linksCreate Hiring Packet Portal Link
Creates a public intake link for the candidate or contractor to submit details and checklist documents.
Request Body
Portal link fields
{
"recipientName": "Avery Johnson",
"recipientEmail": "avery@example.com",
"notificationChannels": ["sms"],
"label": "Candidate document collection"
}Response
{
"data": {
"id": "link_abc123",
"url": "https://wegosign.com/intake/token"
}
}Renewals & Compliance
Track contracts, permits, insurance certificates, training credentials, policy acknowledgments, regulatory filings, custom compliance items, required evidence, approvals, tasks, teams, portal submissions, and encrypted vault fields.
/api/v1/renewals-complianceList Compliance Items
Lists Renewals & Compliance records with checklist readiness, approval count, open task count, team count, and vault summary counts.
Query Parameters
statusFilter by status, for example pending_documents, compliant, expiring_soon, or expired
limitMaximum records to return (max: 200)
Response
{
"data": [
{
"item": { "id": "rec_abc123", "title": "General Liability COI", "status": "expiring_soon" },
"checklistSummary": { "requiredCount": 3, "approvedRequired": 2, "completionPercent": 67 },
"openTaskCount": 1,
"teamMemberCount": 1,
"vaultItemCount": 0
}
]
}/api/v1/renewals-complianceCreate Compliance Item
Creates a configurable renewal or compliance item. The tracking type determines the default document and evidence checklist.
Request Body
Compliance item fields
{
"title": "General Liability COI",
"trackingType": "insurance_coi",
"relatedPartyName": "Northstar Logistics",
"issuingAuthority": "Carrier Mutual",
"expirationDate": "2026-08-01",
"renewalDueDate": "2026-07-15",
"policyNumber": "COI-2026-1001"
}Response
{
"data": {
"id": "rec_abc123"
}
}/api/v1/renewals-compliance/:itemId/documentsAttach Compliance Evidence
Attaches a base64-encoded required document or supporting evidence file to a compliance item.
Request Body
Document upload fields
{
"requirementKey": "certificate_of_insurance",
"label": "Current COI",
"document": {
"filename": "coi.pdf",
"contentType": "application/pdf",
"data": "base64..."
}
}Response
{
"data": {
"id": "doc_abc123"
}
}/api/v1/renewals-compliance/:itemId/tasksCreate Compliance Task
Creates a renewal reminder, follow-up, filing, inspection, or review task.
Request Body
Task fields
{
"title": "Request renewed COI",
"dueDate": 1784073600000
}Response
{
"data": {
"id": "action_abc123"
}
}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",
"document.downloaded"
],
"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/:idGet Webhook
Retrieves a specific webhook by its ID.
Path Parameters
idThe webhook ID
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
}
}Connect WeGoSign to AI assistants and agent clients through the hosted MCP endpoint or local stdio server
Overview
WeGoSign exposes the same REST API workflows through MCP tools, resources, and prompts. Hosted MCP clients can connect to /api/mcp with a WeGoSign API key, and local clients can run the standalone MCP server package.
Signing Workflows
Send template or package envelopes, track signers, remind, cancel, and download
Template Packages
List, create, update, archive, and send multi-document packages
Business Automation
Manage webhooks, invoices, bulk sends, and SSO status from agent clients
{
"endpoint": "https://wegosign.com/api/mcp",
"transport": "Streamable HTTP",
"authentication": "Authorization: Bearer wgs_live_...",
"toolCount": 30,
"resourceCount": 7,
"promptCount": 4
}MCP Tools
MCP tools map to authenticated /api/v1 operations. The send-envelope tool accepts exactly one oftemplateId or packageId.
| Category | Tools |
|---|---|
| Envelopes | list-envelopes, get-envelope, send-envelope, cancel-envelope, send-reminder, download-envelope, get-envelope-audit-log, get-envelope-signers |
| Templates | list-templates, get-template, get-template-fields, create-template, update-template, archive-template, update-template-fields |
| Template Packages | list-packages, get-package, create-package, update-package, archive-package |
| Bulk Sends | create-bulk-send, get-bulk-send, get-bulk-send-errors |
| Invoices | list-invoices, create-invoice, get-invoice, send-invoice, record-payment, void-invoice |
| Event Ledger | list-event-ledger-events, get-event-ledger-event, create-event-ledger-event, update-event-ledger-event, create-event-ledger-sponsor, create-event-ledger-expense, import-meetumo-event-ledger |
| Generic Business Apps | list-business-records, get-business-record, create-business-record, update-business-record-status, list-business-record-documents, attach-business-record-document, list-business-record-approvals, request-business-record-approval, create-business-record-portal-link |
| Business Intake | list-business-intakes, get-business-intake, create-business-intake, update-business-intake-status, attach-business-intake-document, review-business-intake-document, create-business-intake-task, update-business-intake-task, request-business-intake-approval, assign-business-intake-team-member, create-business-intake-portal-link, set-business-intake-vault-field |
| Hiring Packets | list-hiring-packets, get-hiring-packet, create-hiring-packet, update-hiring-packet-status, attach-hiring-packet-document, review-hiring-packet-document, create-hiring-packet-task, update-hiring-packet-task, request-hiring-packet-approval, assign-hiring-packet-team-member, create-hiring-packet-portal-link, set-hiring-packet-vault-field |
| Renewals & Compliance | list-renewal-compliance-items, get-renewal-compliance-item, create-renewal-compliance-item, update-renewal-compliance-status, attach-renewal-compliance-document, review-renewal-compliance-document, create-renewal-compliance-task, update-renewal-compliance-task, request-renewal-compliance-approval, assign-renewal-compliance-team-member, create-renewal-compliance-portal-link, set-renewal-compliance-vault-field |
| Webhooks & SSO | list-webhooks, get-webhook, create-webhook, delete-webhook, get-sso-config |
Resources & Prompts
Resources
wegosign://organization/stats, wegosign://templates,wegosign://packages, wegosign://webhooks,wegosign://sso/config, wegosign://envelopes/{envelopeId}/audit,wegosign://invoices, wegosign://event-ledger,wegosign://business-intake,wegosign://hiring-packets, and wegosign://renewals-compliance.
Prompts
send-for-signature, send-package-for-signature,check-pending, and weekly-report.
Best practices and implementation guides
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.
Basic Field Types
signatureFull signature - draw, type, or upload
initialsQuick initials field
sender_signatureSender pre-signs before sending
dateAuto-filled date field
textFree-form text input
checkboxCheckbox for acknowledgments
Advanced Field Types
emailEmail address with validation
phonePhone number with country code
numberNumeric input with min/max validation
dropdownSingle-select dropdown menu
radio_groupRadio buttons - select one option
multi_selectCheckboxes - select multiple options
date_pickerCalendar date picker for custom dates
Conditional Field Logic
Show, hide, or require fields based on other field values. Configure conditions in the template editor.
Supported Operators:
equals - Value matches exactlynot_equals - Value does not matchcontains - Value contains textnot_contains - Value does not contain textis_empty - Field is emptyis_not_empty - Field has a valuegreater_than / less_than - Numeric comparisonActions:
Sequential Signing
Control the order in which signers must sign documents. Sequential signing ensures that signers can only access and sign the document when it's their turn.
How It Works
1. Assign a signingOrder number to each signer (1 = first)
2. Signers with lower numbers must complete before higher numbers can access the document
3. Signers attempting to access out of order receive a "not your turn" message
API Example
{
"templateId": "template_abc123",
"signers": [
{ "name": "Manager", "email": "manager@company.com", "signingOrder": 1 },
{ "name": "Director", "email": "director@company.com", "signingOrder": 2 },
{ "name": "CEO", "email": "ceo@company.com", "signingOrder": 3 }
]
}Parallel Signing
For parallel signing where all signers can sign simultaneously, assign the samesigningOrder to all signers or omit it entirely.
Template Packages
Template packages allow you to bundle multiple templates together for complex multi-document signing workflows. Signers receive all documents in a single signing session.
Key Features
Multi-Document Bundles
Combine multiple templates into a single package
Unified Role Mapping
Map package roles to template-specific roles
Single Signing Session
Signers complete all documents in one session
Consistent Experience
Same signer sees their fields across all docs
Dashboard and API
Template packages can be managed in the dashboard or through the/api/v1/packages endpoints. MCP clients can use list-packages,create-package, andsend-envelope withpackageId to send a multi-document package.
Scheduled Sends
Schedule envelopes to be sent at a future date and time. Perfect for time-sensitive documents or coordinating across time zones.
API Example
{
"templateId": "template_abc123",
"signers": [
{ "name": "John Doe", "email": "john@example.com" }
],
"scheduledAt": "2024-12-15T09:00:00Z"
}Constraints
• Minimum: Must be at least 5 minutes in the future
• Maximum: Cannot be more than 30 days in the future
• Format: ISO 8601 timestamp (e.g., 2024-12-15T09:00:00Z)
Bulk Send Scheduling
Bulk sends also support scheduling. Include scheduledAtin your bulk send request to schedule mass document delivery.
CC Recipients
Add CC (carbon copy) recipients to receive copies of the envelope without needing to sign. They're notified when the envelope is sent and completed.
API Example
{
"templateId": "template_abc123",
"signers": [
{ "name": "John Doe", "email": "john@example.com" }
],
"ccRecipients": [
{ "name": "Legal Team", "email": "legal@company.com" },
{ "name": "HR Manager", "email": "hr@company.com" }
]
}CC vs Signers
| Feature | Signers | CC Recipients |
|---|---|---|
| Can sign document | ✓ | — |
| Notified when sent | ✓ | ✓ |
| Notified when completed | ✓ | ✓ |
| Receives signed document | ✓ | ✓ |
Password Protection
Add an extra layer of security by requiring signers to enter a password before viewing and signing documents. Available on all plans.
Key Features
Per-Signer Passwords
Each signer has their own unique password
Auto-Generated
8-character alphanumeric passwords by default
Multi-Channel Delivery
Deliver via Email, SMS, or WhatsApp
Lockout Protection
Account locked after 5 failed attempts
Security Flow
1. Sender enables password protection for a signer
2. Password is auto-generated (or custom-set) and delivered via chosen channel
3. Signer must enter correct password before viewing the document
4. After 5 failed attempts, access is locked until sender resends password
Dashboard Only
Password protection is currently configured through the dashboard when creating envelopes. API support for password-protected envelopes is planned for a future release.
Invoicing Guide
WeGoSign's invoicing API lets you create, send, and track client invoices programmatically. This guide walks through common invoicing workflows.
1. Create and Send an Invoice
Invoices are created in draft status. You must explicitly send them to deliver the email to the client.
// Step 1: Create a draft invoice
const invoice = await fetch("https://wegosign.com/api/v1/invoices", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
clientName: "John Smith",
clientEmail: "john@example.com",
title: "Consulting Services - April 2026",
currency: "NGN",
lineItems: [
{ description: "Strategy session (2hrs)", quantity: 2, unitPriceKobo: 500000, totalKobo: 1000000 }
],
subtotalKobo: 1000000,
totalKobo: 1000000,
invoiceDate: Date.now(),
dueDate: Date.now() + 30 * 24 * 60 * 60 * 1000
})
});
const { data } = await invoice.json();
// Step 2: Send it
await fetch(`https://wegosign.com/api/v1/invoices/${data.id}/send`, {
method: "POST",
headers: { "Authorization": "Bearer YOUR_API_KEY" }
});2. Record Payments
Record partial or full payments. The invoice status updates automatically: partial payments set it to partially_paid, and when the total is reached it becomes paid.
// Record a partial payment
const result = await fetch(`https://wegosign.com/api/v1/invoices/${invoiceId}/payments`, {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
amountKobo: 500000,
paymentMethod: "bank_transfer",
reference: "TXN-12345"
})
});
// { "data": { "success": true, "status": "partially_paid" } }
// Record remaining payment
await fetch(`https://wegosign.com/api/v1/invoices/${invoiceId}/payments`, {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
amountKobo: 500000,
paymentMethod: "bank_transfer",
reference: "TXN-12346"
})
});
// { "data": { "success": true, "status": "paid" } }
// Client receives a receipt email automatically3. Listen for Invoice Events
Subscribe to invoice webhook events to automate your billing workflow. The invoice.viewed event fires every time the client opens the invoice page — useful for tracking engagement.
// Create a webhook for invoice events
await fetch("https://wegosign.com/api/v1/webhooks", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
url: "https://yourapp.com/webhooks/invoices",
events: [
"invoice.sent",
"invoice.viewed",
"invoice.payment_recorded",
"invoice.paid",
"invoice.overdue",
"invoice.reminder_sent"
],
description: "Invoice lifecycle tracking"
})
});
// Example webhook payload for invoice.payment_recorded:
// {
// "type": "invoice.payment_recorded",
// "data": {
// "invoice_id": "inv_abc123",
// "invoice_number": "INV-0001",
// "client_email": "john@example.com",
// "amount_kobo": 500000,
// "total_paid_kobo": 500000,
// "total_kobo": 1000000,
// "currency": "NGN",
// "payment_method": "bank_transfer",
// "status": "partially_paid"
// }
// }Invoice Webhook Events Reference
| Event | When | Frequency |
|---|---|---|
invoice.created | Invoice created as draft | Once |
invoice.sent | Invoice email sent to client | Once |
invoice.viewed | Client opens the invoice page | Every view |
invoice.payment_recorded | A payment is recorded | Every payment |
invoice.paid | Invoice fully paid | Once |
invoice.overdue | Invoice passes due date | Once |
invoice.reminder_sent | Overdue reminder email sent | Each reminder |
invoice.voided | Invoice voided/cancelled | Once |
Webhook Events
WeGoSign sends webhook notifications for the following events:
Envelope Events
envelope.createdAn envelope has been created
envelope.sentAn envelope has been sent to signers
envelope.viewedAny signer has viewed the document
envelope.signedAny signer has completed their signature
envelope.completedAll signers have completed signing
envelope.declinedAny signer has declined to sign
envelope.cancelledAn envelope has been cancelled
envelope.expiredAn envelope has expired without completion
Signer Events
signer.viewedA specific signer has viewed the document
signer.signedA specific signer has completed signing
signer.declinedA specific signer has declined to sign
Reminder Events
reminder.sentA reminder email was sent to a signer (automatic or manual)
Document Events
document.downloadedA signed document has been downloaded
Invoice Events
invoice.createdA new client invoice has been created
invoice.sentAn invoice has been sent to the client via email
invoice.viewedThe client opened the invoice page (fires on every view)
invoice.payment_recordedA payment was recorded (including partial payments)
invoice.paidAn invoice has been fully paid
invoice.overdueAn invoice has passed its due date
invoice.reminder_sentAn overdue reminder email was sent to the client
invoice.voidedAn invoice has been voided
Generic App Events
app.record.createdA business app record has been created
app.record.status_changedA business app record status has changed
app.document.attachedA document was attached to a business app record
app.document.reviewedA business app document was approved, rejected, expired, or sent for revision
app.approval.completedA business app approval request was approved
app.approval.step_decidedA business app approval step was approved or rejected
app.portal.link_createdAn external intake portal link was created for a business app record
app.portal.submittedAn external recipient submitted fields or documents through the intake portal
app.action.createdA business app action or task was created
app.action.completedA business app action or task was completed
Business Intake Events
business_intake.record.createdA business intake record has been created
business_intake.record.status_changedA business intake status has changed
business_intake.document.attachedA required intake document or evidence file was attached
business_intake.document.reviewedA business intake document was approved, rejected, expired, or sent for revision
business_intake.task.completedA business intake task was completed
business_intake.approval.completedA business intake approval request was approved
business_intake.payment_details.updatedEncrypted payment details changed
business_intake.team.assignedA team member was assigned to a business intake record
business_intake.vault.updatedAn encrypted business intake vault field changed
business_intake.portal.submittedA recipient submitted details or documents through an intake portal link
Hiring Packets Events
hiring_packets.packet.createdA hiring packet has been created
hiring_packets.packet.status_changedA hiring packet status has changed
hiring_packets.document.attachedAn offer letter, contractor agreement, policy acknowledgment, or onboarding file was attached
hiring_packets.task.createdAn onboarding task was created for a hiring packet
hiring_packets.task.completedAn onboarding task was completed for a hiring packet
hiring_packets.team.assignedA team member was assigned to a hiring packet
hiring_packets.approval.completedA hiring packet approval request was approved
hiring_packets.vault.updatedAn encrypted hiring packet vault field changed
hiring_packets.portal.submittedA candidate or contractor submitted details or documents through an intake portal link
Renewals & Compliance Events
renewals_compliance.item.createdA renewal or compliance item has been created
renewals_compliance.item.status_changedA compliance item status has changed
renewals_compliance.document.attachedA required compliance document or evidence file was attached
renewals_compliance.document.reviewedA compliance document was approved, rejected, expired, or sent for revision
renewals_compliance.task.completedA compliance task or renewal reminder was completed
renewals_compliance.approval.completedA compliance approval request was approved
renewals_compliance.vault.updatedAn encrypted compliance vault field changed
renewals_compliance.portal.submittedAn external party submitted details or evidence through an intake portal link
Bulk Send Events
bulk_send.startedA bulk send job has started processing
bulk_send.completedA bulk send job has finished successfully
bulk_send.failedA bulk send job has failed
Webhook Payload Structure
{
"id": "evt_abc123xyz",
"type": "signer.signed",
"created": 1704543600000,
"data": {
"envelope": {
"id": "env_xyz789",
"title": "Employment Contract - John Doe",
"status": "signed",
"createdAt": 1704543600000,
"completedAt": null
},
"signer": {
"id": "sgn_abc123",
"email": "john@example.com",
"name": "John Doe",
"role": "employee",
"status": "signed",
"viewedAt": 1704543500000,
"signedAt": 1704543600000,
"declinedAt": null,
"declineReason": null,
"completedFields": [
{
"fieldId": "field_signature_1",
"value": "data:image/png;base64,iVBORw0KGgoAAA...",
"completedAt": 1704543590000
},
{
"fieldId": "field_email_1",
"value": "john.doe@example.com",
"completedAt": 1704543580000
},
{
"fieldId": "field_dropdown_1",
"value": "Full-Time",
"completedAt": 1704543570000
}
]
},
"timestamp": 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=', '');67 // Create message: timestamp.payload8 const message = `${timestamp}.${payload}`;910 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'];2627 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 // Access payload fields: id, type, created, data39 const { id, type, created, data } = req.body;40 console.log('Processing event:', type, 'Event ID:', id);4142 // Process the webhook based on event type...43 res.status(200).send('OK');44});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
Ready to get started?
Create your free account and get API keys to start integrating document signing today.