Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.spitshake.io/llms.txt

Use this file to discover all available pages before exploring further.

SDK Libraries

DocuTrust provides official SDK packages for embedding signing forms and template builders into your application, and for interacting with the DocuTrust API programmatically.
PackageFrameworkPurpose
@docutrust/reactReact 16.8+Signing form and template builder React components
@docutrust/vueVue 3Signing form and template builder Vue components
@docutrust/react-nativeReact NativeWebView-based signing and builder components for mobile
@docutrust/angularAngular 14+Signing form and template builder Angular components
@docutrust/apiTypeScript / JavaScriptTyped API client for server-side and client-side usage
@docutrust/n8n-nodes-docutrustn8nCustom n8n nodes for document signing automation
@docutrust/cliCLICommand-line tool for managing templates and submissions

@docutrust/react

React components for embedding DocuTrust signing forms and template builders.

Installation

npm install @docutrust/react

DocuTrustForm

Renders a signing form for a specific submitter.
import { DocuTrustForm } from '@docutrust/react'

function SigningPage() {
  return (
    <DocuTrustForm
      host="https://spitshake.io"
      submitterSlug="aB3kL9mNpQ"
      email="jane.doe@example.com"
      name="Jane Doe"
      role="Recipient"
      language="en"
      withTitle={true}
      withDownloadButton={true}
      withSendCopyButton={true}
      allowToResubmit={false}
      goToLast={true}
      expand={true}
      autoscroll={true}
      preview={false}
      skipFields="Internal Notes"
      readonlyFields="Contract Amount,Start Date"
      values={{
        'Full Name': 'Jane Doe',
        'Email': 'jane.doe@example.com',
        'Company': 'Acme Inc',
        'Title': 'VP of Operations',
        'Date': '2026-04-09'
      }}
      metadata={{
        customer_id: 'cust_8472',
        deal_id: 'deal_291',
        plan: 'enterprise',
        source: 'react_embed'
      }}
      completedRedirectUrl="https://your-app.com/signing-complete"
      onLoaded={(detail) => {
        console.log('Form loaded:', detail.submitter_id)
        console.log('Template:', detail.template_name)
        console.log('Role:', detail.role)
        console.log('Fields:', detail.fields.length)
      }}
      onCompleted={(detail) => {
        console.log('Completed:', detail.submission_id)
        console.log('Documents:', detail.documents)
        console.log('Values:', detail.values)
        console.log('Audit log:', detail.audit_log_url)
      }}
      onDeclined={(detail) => {
        console.log('Declined:', detail.reason)
      }}
      onFieldValue={(detail) => {
        console.log('Field changed:', detail.field_name, '=', detail.value)
        console.log('Progress:', detail.completed_fields, '/', detail.total_fields)
      }}
    />
  )
}

DocuTrustBuilder

Renders the template builder for creating and editing templates.
import { DocuTrustBuilder } from '@docutrust/react'

function BuilderPage() {
  return (
    <DocuTrustBuilder
      host="https://spitshake.io"
      token="eyJhbGciOiJIUzI1NiJ9..."
      language="en"
      autosave={true}
      preview={true}
      withTitle={true}
      withSendButton={true}
      withRecipients={true}
      onlyDefinedFields={false}
      roles={['Sender', 'Recipient', 'Witness']}
      fields={[
        { name: 'Full Name', type: 'text', role: 'Recipient', required: true },
        { name: 'Email', type: 'text', role: 'Recipient', required: true },
        { name: 'Signature', type: 'signature', role: 'Recipient', required: true },
        { name: 'Date', type: 'date', role: 'Recipient', required: true },
        { name: 'Sender Signature', type: 'signature', role: 'Sender', required: true },
        { name: 'Witness Signature', type: 'signature', role: 'Witness', required: true }
      ]}
      onTemplateSaved={(detail) => {
        console.log('Template saved:', detail.template_id)
        console.log('Updated at:', detail.updated_at)
        console.log('Fields:', detail.fields.length)
      }}
      onSend={(detail) => {
        console.log('Send clicked:', detail.template_id)
        console.log('Roles:', detail.submitters.map(s => s.name))
      }}
      onLoaded={(detail) => {
        console.log('Builder loaded:', detail.template_id)
        console.log('Documents:', detail.documents.length)
      }}
    />
  )
}

Props Reference

DocuTrustForm Props

PropTypeRequiredDefaultDescription
hoststringYesBase URL of your DocuTrust instance
submitterSlugstringYesSubmitter signing slug
emailstringNoPre-fill signer email
namestringNoPre-fill signer name
rolestringNoTarget submitter role
languagestringNoUI language code (en, es, fr, de, it, pt, nl, ar, cs, he, ko, pl, uk, ja)
withTitlebooleanNotrueShow the template title
withDownloadButtonbooleanNotrueShow the download button after completion
withSendCopyButtonbooleanNotrueShow the “Send a copy” button
allowToResubmitbooleanNofalseAllow resubmission
goToLastbooleanNofalseJump to last incomplete field
expandbooleanNofalseExpand form to full content height
autoscrollbooleanNotrueAuto-scroll to next field
previewbooleanNofalseRead-only preview mode
skipFieldsstringNoComma-separated field names to skip
readonlyFieldsstringNoComma-separated read-only field names
valuesobjectNoPre-fill field values
metadataobjectNoCustom metadata
completedRedirectUrlstringNoRedirect URL after completion
onLoadedfunctionNoCallback when form loads
onCompletedfunctionNoCallback when signing completes
onDeclinedfunctionNoCallback when signer declines
onFieldValuefunctionNoCallback when a field value changes

DocuTrustBuilder Props

PropTypeRequiredDefaultDescription
hoststringYesBase URL of your DocuTrust instance
tokenstringNoJWT token from POST /api/embed/token
templateIdnumberNoTemplate ID (session auth only)
languagestringNoUI language code
autosavebooleanNotrueEnable auto-save
previewbooleanNotrueShow document preview panel
withTitlebooleanNotrueShow editable template title
withSendButtonbooleanNotrueShow the “Send” button
withRecipientsbooleanNotrueShow recipients section
onlyDefinedFieldsbooleanNofalseOnly show pre-defined field types
fieldsarrayNoPre-defined field definitions
rolesarrayNoPre-defined submitter role names
onLoadedfunctionNoCallback when builder loads
onTemplateSavedfunctionNoCallback when template is saved
onSendfunctionNoCallback when “Send” button is clicked

@docutrust/vue

Vue 3 components for embedding DocuTrust signing forms and template builders.

Installation

npm install @docutrust/vue

DocuTrustForm

<template>
  <DocuTrustForm
    host="https://spitshake.io"
    submitter-slug="aB3kL9mNpQ"
    email="jane.doe@example.com"
    name="Jane Doe"
    role="Recipient"
    language="en"
    :with-title="true"
    :with-download-button="true"
    :with-send-copy-button="true"
    :allow-to-resubmit="false"
    :go-to-last="true"
    :expand="true"
    :autoscroll="true"
    :preview="false"
    skip-fields="Internal Notes"
    readonly-fields="Contract Amount,Start Date"
    :values="{
      'Full Name': 'Jane Doe',
      'Email': 'jane.doe@example.com',
      'Company': 'Acme Inc',
      'Title': 'VP of Operations',
      'Date': '2026-04-09'
    }"
    :metadata="{
      customer_id: 'cust_8472',
      deal_id: 'deal_291',
      plan: 'enterprise',
      source: 'vue_embed'
    }"
    completed-redirect-url="https://your-app.com/signing-complete"
    @loaded="onLoaded"
    @completed="onCompleted"
    @declined="onDeclined"
    @field-value="onFieldValue"
  />
</template>

<script setup>
import { DocuTrustForm } from '@docutrust/vue'

function onLoaded(detail) {
  console.log('Form loaded:', detail.submitter_id)
  console.log('Template:', detail.template_name)
  console.log('Role:', detail.role)
  console.log('Fields:', detail.fields.length)
}

function onCompleted(detail) {
  console.log('Completed:', detail.submission_id)
  console.log('Documents:', detail.documents)
  console.log('Values:', detail.values)
  console.log('Audit log:', detail.audit_log_url)
}

function onDeclined(detail) {
  console.log('Declined:', detail.reason)
}

function onFieldValue(detail) {
  console.log('Field changed:', detail.field_name, '=', detail.value)
  console.log('Progress:', detail.completed_fields, '/', detail.total_fields)
}
</script>

DocuTrustBuilder

<template>
  <DocuTrustBuilder
    host="https://spitshake.io"
    token="eyJhbGciOiJIUzI1NiJ9..."
    language="en"
    :autosave="true"
    :preview="true"
    :with-title="true"
    :with-send-button="true"
    :with-recipients="true"
    :only-defined-fields="false"
    :roles="['Sender', 'Recipient', 'Witness']"
    :fields="[
      { name: 'Full Name', type: 'text', role: 'Recipient', required: true },
      { name: 'Email', type: 'text', role: 'Recipient', required: true },
      { name: 'Signature', type: 'signature', role: 'Recipient', required: true },
      { name: 'Date', type: 'date', role: 'Recipient', required: true },
      { name: 'Sender Signature', type: 'signature', role: 'Sender', required: true },
      { name: 'Witness Signature', type: 'signature', role: 'Witness', required: true }
    ]"
    @loaded="onBuilderLoaded"
    @template-saved="onTemplateSaved"
    @send="onSend"
  />
</template>

<script setup>
import { DocuTrustBuilder } from '@docutrust/vue'

function onBuilderLoaded(detail) {
  console.log('Builder loaded:', detail.template_id)
  console.log('Documents:', detail.documents.length)
}

function onTemplateSaved(detail) {
  console.log('Template saved:', detail.template_id)
  console.log('Updated at:', detail.updated_at)
  console.log('Fields:', detail.fields.length)
}

function onSend(detail) {
  console.log('Send clicked:', detail.template_id)
  console.log('Roles:', detail.submitters.map(s => s.name))
}
</script>
Vue components use kebab-case for props (submitter-slug, with-title) and native Vue event syntax (@loaded, @completed).

@docutrust/react-native

React Native components for embedding DocuTrust signing forms and template builders in mobile applications. Components render inside a WebView.

Installation

npm install @docutrust/react-native react-native-webview
react-native-webview is a required peer dependency.

DocuTrustForm

import { DocuTrustForm } from '@docutrust/react-native'

function SigningScreen() {
  return (
    <DocuTrustForm
      host="https://spitshake.io"
      submitterSlug="aB3kL9mNpQ"
      email="jane.doe@example.com"
      name="Jane Doe"
      role="Recipient"
      language="en"
      withTitle={true}
      withDownloadButton={true}
      withSendCopyButton={true}
      allowToResubmit={false}
      goToLast={true}
      expand={true}
      autoscroll={true}
      preview={false}
      skipFields="Internal Notes"
      readonlyFields="Contract Amount,Start Date"
      values={{
        'Full Name': 'Jane Doe',
        'Email': 'jane.doe@example.com',
        'Company': 'Acme Inc',
        'Title': 'VP of Operations',
        'Date': '2026-04-09'
      }}
      metadata={{
        customer_id: 'cust_8472',
        deal_id: 'deal_291',
        plan: 'enterprise',
        source: 'react_native_embed'
      }}
      completedRedirectUrl="https://your-app.com/signing-complete"
      onLoaded={(detail) => {
        console.log('Form loaded:', detail.submitter_id)
        console.log('Template:', detail.template_name)
      }}
      onCompleted={(detail) => {
        console.log('Completed:', detail.submission_id)
        console.log('Documents:', detail.documents)
        console.log('Values:', detail.values)
      }}
      onDeclined={(detail) => {
        console.log('Declined:', detail.reason)
      }}
      onFieldValue={(detail) => {
        console.log('Field changed:', detail.field_name, '=', detail.value)
      }}
      style={{ flex: 1 }}
    />
  )
}

DocuTrustBuilder

import { DocuTrustBuilder } from '@docutrust/react-native'

function BuilderScreen() {
  return (
    <DocuTrustBuilder
      host="https://spitshake.io"
      token="eyJhbGciOiJIUzI1NiJ9..."
      language="en"
      autosave={true}
      preview={true}
      withTitle={true}
      withSendButton={true}
      withRecipients={true}
      onlyDefinedFields={false}
      roles={['Sender', 'Recipient', 'Witness']}
      fields={[
        { name: 'Full Name', type: 'text', role: 'Recipient', required: true },
        { name: 'Email', type: 'text', role: 'Recipient', required: true },
        { name: 'Signature', type: 'signature', role: 'Recipient', required: true },
        { name: 'Date', type: 'date', role: 'Recipient', required: true },
        { name: 'Sender Signature', type: 'signature', role: 'Sender', required: true }
      ]}
      onLoaded={(detail) => {
        console.log('Builder loaded:', detail.template_id)
      }}
      onTemplateSaved={(detail) => {
        console.log('Template saved:', detail.template_id)
      }}
      onSend={(detail) => {
        console.log('Send clicked:', detail.template_id)
      }}
      style={{ flex: 1 }}
    />
  )
}
React Native components accept an additional style prop for controlling the WebView container layout. Use flex: 1 to fill the available screen space.

@docutrust/angular

Angular components for embedding DocuTrust signing forms and template builders. Supports Angular 14 and above.

Installation

npm install @docutrust/angular

Module Setup

Import the DocuTrustModule in your Angular module:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { DocuTrustModule } from '@docutrust/angular';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    DocuTrustModule.forRoot({
      host: 'https://spitshake.io'
    })
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

DocuTrustFormComponent

import { Component } from '@angular/core';

@Component({
  selector: 'app-signing-page',
  template: `
    <docutrust-form
      [submitterSlug]="'aB3kL9mNpQ'"
      [email]="'jane.doe@example.com'"
      [name]="'Jane Doe'"
      [role]="'Recipient'"
      [language]="'en'"
      [withTitle]="true"
      [withDownloadButton]="true"
      [withSendCopyButton]="true"
      [allowToResubmit]="false"
      [goToLast]="true"
      [expand]="true"
      [autoscroll]="true"
      [preview]="false"
      [skipFields]="'Internal Notes'"
      [readonlyFields]="'Contract Amount,Start Date'"
      [values]="{
        'Full Name': 'Jane Doe',
        'Email': 'jane.doe@example.com',
        'Company': 'Acme Inc',
        'Title': 'VP of Operations',
        'Date': '2026-04-09'
      }"
      [metadata]="{
        customer_id: 'cust_8472',
        deal_id: 'deal_291',
        plan: 'enterprise',
        source: 'angular_embed'
      }"
      [completedRedirectUrl]="'https://your-app.com/signing-complete'"
      (loaded)="onLoaded($event)"
      (completed)="onCompleted($event)"
      (declined)="onDeclined($event)"
      (fieldValue)="onFieldValue($event)"
    ></docutrust-form>
  `
})
export class SigningPageComponent {
  onLoaded(detail: any) {
    console.log('Form loaded:', detail.submitter_id);
    console.log('Template:', detail.template_name);
    console.log('Role:', detail.role);
    console.log('Fields:', detail.fields.length);
  }

  onCompleted(detail: any) {
    console.log('Completed:', detail.submission_id);
    console.log('Documents:', detail.documents);
    console.log('Values:', detail.values);
    console.log('Audit log:', detail.audit_log_url);
  }

  onDeclined(detail: any) {
    console.log('Declined:', detail.reason);
  }

  onFieldValue(detail: any) {
    console.log('Field changed:', detail.field_name, '=', detail.value);
    console.log('Progress:', detail.completed_fields, '/', detail.total_fields);
  }
}

DocuTrustBuilderComponent

import { Component } from '@angular/core';

@Component({
  selector: 'app-builder-page',
  template: `
    <docutrust-builder
      [token]="'eyJhbGciOiJIUzI1NiJ9...'"
      [language]="'en'"
      [autosave]="true"
      [preview]="true"
      [withTitle]="true"
      [withSendButton]="true"
      [withRecipients]="true"
      [onlyDefinedFields]="false"
      [roles]="['Sender', 'Recipient', 'Witness']"
      [fields]="[
        { name: 'Full Name', type: 'text', role: 'Recipient', required: true },
        { name: 'Email', type: 'text', role: 'Recipient', required: true },
        { name: 'Signature', type: 'signature', role: 'Recipient', required: true },
        { name: 'Date', type: 'date', role: 'Recipient', required: true },
        { name: 'Sender Signature', type: 'signature', role: 'Sender', required: true },
        { name: 'Witness Signature', type: 'signature', role: 'Witness', required: true }
      ]"
      (loaded)="onBuilderLoaded($event)"
      (templateSaved)="onTemplateSaved($event)"
      (send)="onSend($event)"
    ></docutrust-builder>
  `
})
export class BuilderPageComponent {
  onBuilderLoaded(detail: any) {
    console.log('Builder loaded:', detail.template_id);
    console.log('Documents:', detail.documents.length);
  }

  onTemplateSaved(detail: any) {
    console.log('Template saved:', detail.template_id);
    console.log('Updated at:', detail.updated_at);
    console.log('Fields:', detail.fields.length);
  }

  onSend(detail: any) {
    console.log('Send clicked:', detail.template_id);
    console.log('Roles:', detail.submitters.map((s: any) => s.name));
  }
}
Angular components use property binding syntax ([prop]="value") and event binding syntax ((event)="handler($event)").

@docutrust/n8n-nodes-docutrust

Custom n8n nodes for automating document signing workflows. Provides trigger and action nodes that integrate directly with the n8n visual workflow editor.

Installation

Install the community node in your n8n instance:
npm install @docutrust/n8n-nodes-docutrust
Or install via the n8n community nodes UI: Settings > Community Nodes > Install > @docutrust/n8n-nodes-docutrust.

Available Nodes

DocuTrust Trigger

Listens for webhook events from DocuTrust and starts a workflow when they fire. Supported trigger events:
EventDescription
form.completedA submitter completed their signing form.
form.declinedA submitter declined to sign.
form.viewedA submitter opened the signing link.
submission.completedAll submitters completed the submission.
submission.expiredThe submission expired.
template.createdA new template was created.
template.updatedA template was modified.

DocuTrust Action

Performs operations against the DocuTrust API. Supported operations:
ResourceOperationDescription
TemplateListList all templates with optional filters.
TemplateGetRetrieve a single template by ID.
TemplateCloneCreate a copy of an existing template.
SubmissionCreateCreate a new submission from a template.
SubmissionGetRetrieve a submission by ID.
SubmissionListList submissions with optional filters.
SubmissionSend ReminderSend reminder emails to pending submitters.
SubmitterGetRetrieve a submitter by ID.
SubmitterUpdateUpdate submitter details and field values.

Credential Setup

  1. In n8n, go to Credentials > New Credential > DocuTrust API.
  2. Enter your DocuTrust instance URL and API token.
  3. Click Test to verify the connection.
{
  "baseUrl": "https://spitshake.io",
  "apiToken": "YOUR_API_TOKEN"
}

Example Workflow

A workflow that creates a submission when a new row is added to Google Sheets, then sends a Slack notification when signing completes:
  1. Google Sheets Trigger — fires when a new row is added.
  2. DocuTrust Action — creates a submission with data from the spreadsheet row.
  3. DocuTrust Trigger — listens for form.completed events.
  4. Slack Action — posts a notification to a channel.

@docutrust/cli

A command-line tool for managing templates, submissions, and account settings from the terminal. Useful for scripting, CI/CD pipelines, and batch operations.

Installation

npm install -g @docutrust/cli

Configuration

Set your DocuTrust instance URL and API token:
docutrust config set --host https://spitshake.io --token YOUR_API_TOKEN
The configuration is stored in ~/.docutrustrc:
{
  "host": "https://spitshake.io",
  "token": "YOUR_API_TOKEN"
}

Commands

Templates

# List all templates
docutrust templates list

# List templates in a folder
docutrust templates list --folder "Legal Contracts"

# Get a single template
docutrust templates get 42

# Create a template from a PDF file
docutrust templates create --name "Service Agreement" --file ./contract.pdf

# Clone a template
docutrust templates clone 42 --name "Service Agreement - West Region"

# Archive a template
docutrust templates archive 42

Submissions

# List all submissions
docutrust submissions list

# List with filters
docutrust submissions list --status pending --template-id 42 --limit 25

# Create a submission
docutrust submissions create --template-id 42 \
  --submitter "Client:jane@example.com:Jane Smith" \
  --submitter "Company Representative:bob@acme.com:Bob Johnson" \
  --send-email

# Get a single submission
docutrust submissions get 187

# Send a reminder
docutrust submissions remind 187

# Download completed documents
docutrust submissions download 187 --output ./signed-docs/

# Download as merged PDF
docutrust submissions download 187 --merge --output ./signed-contract.pdf

# Archive a submission
docutrust submissions archive 187

Bulk Operations

# Bulk send from a CSV file
docutrust submissions bulk-create --template-id 42 --csv ./recipients.csv --send-email

# CSV format: role,email,name,field_key_1,field_key_2,...
# Client,jane@example.com,Jane Smith,Acme Corp,2026-04-08

Settings

# View account settings
docutrust settings get

# Update a setting
docutrust settings update --company-name "Acme Inc" --timezone "America/New_York"

# View webhooks
docutrust webhooks list

# Create a webhook
docutrust webhooks create --url https://yourapp.com/webhooks/docutrust \
  --events form.completed,submission.completed
Use docutrust --help or docutrust <command> --help for detailed usage information on any command.

@docutrust/api

A typed TypeScript/JavaScript client for the DocuTrust REST API. Works in Node.js, Deno, Bun, and browser environments.

Installation

npm install @docutrust/api

Configuration

import { DocuTrust } from '@docutrust/api'

const client = new DocuTrust({
  baseUrl: 'https://spitshake.io',
  apiToken: 'YOUR_API_TOKEN'
})

Templates

// List all templates
const templates = await client.templates.list()

// List with pagination
const page = await client.templates.list({ limit: 10, after: 'cursor_abc123' })

// Get a single template
const template = await client.templates.get(15)

// Update a template
const updated = await client.templates.update(15, {
  name: 'Updated Employment Agreement',
  folder_name: 'HR Documents'
})

// Archive a template
await client.templates.archive(15)

// Clone a template
const clone = await client.templates.clone(15, { name: 'Employment Agreement (Copy)' })

// Create from PDF
const fromPdf = await client.templates.createFromPdf({
  name: 'New Contract',
  documents: [
    { name: 'contract.pdf', file: pdfBuffer }
  ]
})

// Create from DOCX
const fromDocx = await client.templates.createFromDocx({
  name: 'Offer Letter',
  documents: [
    { name: 'offer.docx', file: docxBuffer }
  ]
})

// Create from HTML
const fromHtml = await client.templates.createFromHtml({
  name: 'Invoice',
  html: '<html><body><h1>Invoice #{{number}}</h1></body></html>'
})

Submissions

// Create a submission
const submission = await client.submissions.create({
  template_id: 15,
  send_email: true,
  submitters_order: 'random',
  submitters: [
    {
      email: 'signer@example.com',
      name: 'Jane Doe',
      role: 'Recipient',
      phone: '+15551234567',
      values: {
        'Full Name': 'Jane Doe',
        'Company': 'Acme Inc'
      },
      metadata: {
        customer_id: 'cust_8472'
      },
      send_email: true,
      send_sms: false
    }
  ],
  message: {
    subject: 'Please sign your employment agreement',
    body: 'Hi {{name}}, please review and sign the attached document.'
  },
  metadata: {
    deal_id: 'deal_291',
    source: 'api_client'
  }
})

// Create from emails
const fromEmails = await client.submissions.createFromEmails({
  template_id: 15,
  emails: 'signer1@example.com, signer2@example.com'
})

// List submissions
const submissions = await client.submissions.list()

// List with filters
const filtered = await client.submissions.list({
  template_id: 15,
  status: 'completed',
  limit: 25,
  after: 'cursor_xyz789'
})

// Get a single submission
const detail = await client.submissions.get(89)

// Archive a submission
await client.submissions.archive(89)

// List submission documents
const documents = await client.submissions.listDocuments(89)

// Download submission documents (merged PDF)
const pdfBlob = await client.submissions.downloadDocuments(89)

Download documents

// Download a signed PDF as binary
const buffer = await client.submissions.downloadDocument(submissionId, documentId)

Submitters

// List submitters
const submitters = await client.submitters.list()

// List with filters
const filtered = await client.submitters.list({
  submission_id: 89,
  status: 'completed'
})

// Get a single submitter
const submitter = await client.submitters.get(142)

// Update a submitter
const updated = await client.submitters.update(142, {
  name: 'Jane M. Doe',
  email: 'jane.m.doe@example.com',
  phone: '+15559876543',
  values: {
    'Title': 'Senior VP of Operations'
  },
  metadata: {
    updated_by: 'admin'
  }
})

// Send reminder
await client.submitters.sendReminder(142)

Webhooks

// List webhooks
const webhooks = await client.webhooks.list()

// Create a webhook
const webhook = await client.webhooks.create({
  url: 'https://your-app.com/webhooks/docutrust',
  events: [
    'form.completed',
    'form.declined',
    'form.delegated',
    'submission.completed',
    'submission.archived'
  ],
  secret: 'whsec_your_webhook_secret'
})

// Update a webhook
const updated = await client.webhooks.update(webhook.id, {
  url: 'https://your-app.com/webhooks/docutrust-v2',
  events: ['form.completed', 'submission.completed']
})

// Delete a webhook
await client.webhooks.delete(webhook.id)

// Send a test webhook
await client.webhooks.sendTest(webhook.id)

// Regenerate secret
const newSecret = await client.webhooks.regenerateSecret(webhook.id)

Users

// List users
const users = await client.users.list()

// Get current user
const me = await client.users.getCurrent()

// Invite a user
const invited = await client.users.invite({
  email: 'newuser@example.com',
  first_name: 'New',
  last_name: 'User',
  role: 'admin'
})

// Update a user
const updated = await client.users.update(5, {
  first_name: 'Updated',
  last_name: 'Name'
})

// Archive a user
await client.users.archive(5)

// Restore an archived user
await client.users.restore(5)

Settings

// Get account settings
const settings = await client.settings.get()

// Update settings
const updated = await client.settings.update({
  company_name: 'Acme Inc',
  timezone: 'America/New_York'
})

// Get SMTP settings
const smtp = await client.settings.getSmtp()

// Update SMTP settings
await client.settings.updateSmtp({
  host: 'smtp.example.com',
  port: 587,
  username: 'noreply@example.com',
  password: 'smtp_password',
  from_email: 'noreply@example.com',
  from_name: 'Acme Inc'
})

// Test SMTP configuration
await client.settings.testSmtp()

Audit Events

// List audit events
const { data } = await client.auditEvents.list({
  event_type: 'submission.completed',
  from: '2026-01-01',
  per_page: 50
})

Error Handling

import { DocuTrust, DocuTrustError } from '@docutrust/api'

const client = new DocuTrust({
  baseUrl: 'https://spitshake.io',
  apiToken: 'YOUR_API_TOKEN'
})

try {
  const submission = await client.submissions.create({
    template_id: 999,
    submitters: [{ email: 'signer@example.com' }]
  })
} catch (error) {
  if (error instanceof DocuTrustError) {
    console.error('Status:', error.status)       // 404
    console.error('Message:', error.message)      // "Template not found"
    console.error('Code:', error.code)            // "not_found"
    console.error('Details:', error.details)       // Additional error context
  }
}

TypeScript Types

The client exports TypeScript types for all request and response objects:
import type {
  Template,
  TemplateListParams,
  Submission,
  SubmissionCreateParams,
  Submitter,
  SubmitterUpdateParams,
  Webhook,
  WebhookCreateParams,
  User,
  UserInviteParams,
  AccountSettings,
  AccountSettingsUpdateParams,
  PaginatedResponse,
  DocuTrustErrorResponse
} from '@docutrust/api'