Getting Started

Welcome to the SignatureMills documentation. Here you'll find comprehensive guides and documentation to help you start working with SignatureMills as quickly as possible.

Quick Start

SignatureMills provides a powerful API for integrating digital document signing into your applications. Follow these steps to get started:

  1. Sign up for a SignatureMills account
  2. Create an API key in your dashboard
  3. Install the SignatureMills SDK for your platform
  4. Start integrating digital signatures into your application

Quick Installation

npm install @signaturemills/sdk
Note: You'll need to have an active SignatureMills account to use the API. If you don't have one yet, sign up for a free trial.

Authentication

All API requests must be authenticated using your API key. You can find your API key in the SignatureMills dashboard under Settings > API.

API Key Authentication

Include your API key in the Authorization header of your requests:

Authorization: Bearer YOUR_API_KEY
Warning: Keep your API key secure and never expose it in client-side code. Always make API requests from your server.

API Reference

Base URL

All API requests should be made to: https://api.signaturemills.com/v1

Documents

POST /documents
Create a Document

Creates a new document for signing.

Request Body
{
  "title": "Contract Agreement",
  "file": "base64_encoded_file_content",
  "signers": [
    {
      "email": "john@example.com",
      "name": "John Doe",
      "order": 1
    },
    {
      "email": "jane@example.com",
      "name": "Jane Smith",
      "order": 2
    }
  ],
  "fields": [
    {
      "type": "signature",
      "page": 1,
      "x": 100,
      "y": 200,
      "width": 150,
      "height": 50,
      "signer_index": 0
    }
  ]
}
Response
{
  "id": "doc_123456789",
  "title": "Contract Agreement",
  "status": "pending",
  "created_at": "2023-04-01T12:00:00Z",
  "expires_at": "2023-05-01T12:00:00Z",
  "signers": [
    {
      "id": "signer_123",
      "email": "john@example.com",
      "name": "John Doe",
      "status": "pending",
      "order": 1
    },
    {
      "id": "signer_456",
      "email": "jane@example.com",
      "name": "Jane Smith",
      "status": "pending",
      "order": 2
    }
  ],
  "signing_url": "https://sign.signaturemills.com/doc_123456789"
}
GET /documents/{document_id}
Get Document Status

Retrieves the status and details of a document.

Response
{
  "id": "doc_123456789",
  "title": "Contract Agreement",
  "status": "completed",
  "created_at": "2023-04-01T12:00:00Z",
  "completed_at": "2023-04-02T15:30:00Z",
  "signers": [
    {
      "id": "signer_123",
      "email": "john@example.com",
      "name": "John Doe",
      "status": "signed",
      "signed_at": "2023-04-02T14:20:00Z",
      "order": 1
    },
    {
      "id": "signer_456",
      "email": "jane@example.com",
      "name": "Jane Smith",
      "status": "signed",
      "signed_at": "2023-04-02T15:30:00Z",
      "order": 2
    }
  ],
  "download_url": "https://api.signaturemills.com/v1/documents/doc_123456789/download"
}

Webhooks

SignatureMills can send webhook notifications to your application when certain events occur, such as when a document is signed or completed.

Setting Up Webhooks

To set up webhooks, go to your SignatureMills dashboard under Settings > Webhooks and add your webhook URL.

Webhook Events

Event Description
document.created Triggered when a new document is created
document.signed Triggered when a signer signs a document
document.completed Triggered when all signers have signed a document
document.expired Triggered when a document expires without being completed

Webhook Payload Example

{
  "event": "document.signed",
  "timestamp": "2023-04-02T14:20:00Z",
  "data": {
    "document_id": "doc_123456789",
    "signer": {
      "id": "signer_123",
      "email": "john@example.com",
      "name": "John Doe"
    }
  }
}

SDKs & Libraries

We provide official SDKs for several programming languages to make integrating with SignatureMills easier.

JavaScript/Node.js

npm install @signaturemills/sdk

Python

pip install signaturemills

PHP

composer require signaturemills/signaturemills-php

Ruby

gem install signaturemills

Examples

Creating a Document (Node.js)

const SignatureMills = require('@signaturemills/sdk');

// Initialize the client with your API key
const client = new SignatureMills('your_api_key');

async function createDocument() {
  try {
    // Create a new document
    const document = await client.documents.create({
      title: 'Contract Agreement',
      file: fs.readFileSync('contract.pdf').toString('base64'),
      signers: [
        {
          email: 'john@example.com',
          name: 'John Doe',
          order: 1
        },
        {
          email: 'jane@example.com',
          name: 'Jane Smith',
          order: 2
        }
      ],
      fields: [
        {
          type: 'signature',
          page: 1,
          x: 100,
          y: 200,
          width: 150,
          height: 50,
          signer_index: 0
        }
      ]
    });
    
    console.log('Document created:', document.id);
    console.log('Signing URL:', document.signing_url);
  } catch (error) {
    console.error('Error creating document:', error);
  }
}

createDocument();

Handling Webhooks (Node.js/Express)

const express = require('express');
const bodyParser = require('body-parser');
const SignatureMills = require('@signaturemills/sdk');

const app = express();
const client = new SignatureMills('your_api_key');

// Parse JSON request body
app.use(bodyParser.json());

// Webhook endpoint
app.post('/webhooks/signaturemills', (req, res) => {
  const event = req.body;
  
  // Verify webhook signature (recommended)
  if (!client.webhooks.verifySignature(req.body, req.headers['x-signature-mills-signature'])) {
    return res.status(400).send('Invalid signature');
  }
  
  // Handle different event types
  switch (event.event) {
    case 'document.signed':
      console.log(`Document ${event.data.document_id} signed by ${event.data.signer.name}`);
      // Update your database or notify your users
      break;
      
    case 'document.completed':
      console.log(`Document ${event.data.document_id} completed`);
      // Process the completed document
      break;
      
    default:
      console.log(`Received event: ${event.event}`);
  }
  
  // Acknowledge receipt of the webhook
  res.status(200).send('Webhook received');
});

app.listen(3000, () => {
  console.log('Server listening on port 3000');
});

FAQs

SignatureMills supports PDF, Word (DOCX), Excel (XLSX), and image files (PNG, JPG) for document signing. All non-PDF files are automatically converted to PDF for the signing process.

Yes, signatures created with SignatureMills are legally binding in most jurisdictions. Our platform complies with eSignature laws including ESIGN (USA), UETA (USA), and eIDAS (EU).

All documents and data are encrypted both in transit and at rest using AES-256 encryption. We also maintain a comprehensive audit trail for all document activities.

Yes, you can customize the signing experience with your company's branding, including logo, colors, and custom email templates. This feature is available on the Enterprise plan.