Table of Contents

Need Help?

Our support team is available to assist you with any questions or issues you may have.

Contact Support

Welcome to the MySignedDocuments API documentation. This guide will help you integrate our digital document signing platform into your applications and workflows.

Our REST APIs provide programmatic access to all of MySignedDocuments's features, allowing you to create custom document signing solutions for your business.

Base URL for all API calls: https://api.mysigneddocuments.com/v1

Getting Started

To use the MySignedDocuments API, you'll need to:

  1. Sign up for a MySignedDocuments account on the registration page.
  2. Generate an API key from your account dashboard.
  3. Include your API key in all requests using the Authorization header.
curl -X GET "https://api.mysigneddocuments.com/v1/documents" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Authentication

All API requests must include your API key in the Authorization header using the Bearer token format:

Authorization: Bearer YOUR_API_KEY

API keys have full access to your account, so keep them secure. Don't share your API keys in publicly accessible areas like GitHub, client-side code, or in your application.

API Key Management

You can manage your API keys from your account dashboard. You can:

  • Create multiple API keys for different applications
  • Assign specific permissions to each key
  • Revoke keys that may have been compromised
  • View usage logs for each key

Documents API

The Documents API allows you to upload, manage, and send documents for signing.

List Documents

GET /documents

Retrieves a list of all documents in your account.

Query Parameters
Parameter Type Description
limit number Maximum number of documents to return (default: 20, max: 100)
offset number Number of documents to skip (for pagination)
status string Filter by document status (draft, sent, completed, declined)
// Example request
curl -X GET "https://api.mysigneddocuments.com/v1/documents?limit=10&status=sent" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
Response (200 OK)
{
  "documents": [
    {
      "id": "doc_12345",
      "name": "Contract Agreement",
      "status": "sent",
      "created_at": "2025-01-15T08:30:00Z",
      "updated_at": "2025-01-15T09:15:00Z",
      "expires_at": "2025-02-15T08:30:00Z",
      "signers": [
        {
          "id": "signer_67890",
          "email": "john@example.com",
          "name": "John Smith",
          "status": "signed"
        },
        {
          "id": "signer_54321",
          "email": "sarah@example.com",
          "name": "Sarah Johnson",
          "status": "pending"
        }
      ]
    },
    // More documents...
  ],
  "total": 45,
  "limit": 10,
  "offset": 0
}

Upload Document

POST /documents

Uploads a new document to your account.

Request Body
Parameter Type Description
name string Required. Name of the document
file file Required. The document file (PDF, DOCX, etc.)
signers array Array of signer objects with email and name
message string Message to include in the signing request email
expires_in number Number of days until the document expires (default: 30)

Signatures API

The Signatures API allows you to manage signature requests and fields within documents.

Add Signature Fields

POST /documents/{document_id}/fields

Adds signature and form fields to a document.

Path Parameters
Parameter Type Description
document_id string Required. The ID of the document
Request Body
Parameter Type Description
fields array Required. Array of field objects
// Example request
curl -X POST "https://api.mysigneddocuments.com/v1/documents/doc_12345/fields" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": [
      {
        "type": "signature",
        "page": 1,
        "x": 100,
        "y": 200,
        "width": 200,
        "height": 50,
        "signer_id": "signer_67890",
        "required": true
      },
      {
        "type": "date",
        "page": 1,
        "x": 350,
        "y": 200,
        "width": 150,
        "height": 50,
        "signer_id": "signer_67890",
        "required": true
      }
    ]
  }'

Users API

The Users API allows you to manage user accounts and permissions within your organization.

List Users

GET /users

Retrieves a list of all users in your organization.

// Example request
curl -X GET "https://api.mysigneddocuments.com/v1/users" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Create User

POST /users

Creates a new user in your organization.

Request Body
Parameter Type Description
email string Required. User's email address
first_name string Required. User's first name
last_name string Required. User's last name
role string User's role (admin, member, or viewer)

Webhooks

Webhooks allow you to receive real-time notifications when events occur in your MySignedDocuments account.

Available Events

Event Description
document.created Triggered when a new document is created
document.sent Triggered when a document is sent for signing
document.viewed Triggered when a signer views a document
document.signed Triggered when a signer signs a document
document.completed Triggered when all signers have signed a document
document.declined Triggered when a signer declines to sign a document

Create Webhook

POST /webhooks

Creates a new webhook endpoint.

Request Body
Parameter Type Description
url string Required. The URL to receive webhook events
events array Required. Array of event names to subscribe to
description string Description of the webhook's purpose
// Example request
curl -X POST "https://api.mysigneddocuments.com/v1/webhooks" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/webhook",
    "events": ["document.signed", "document.completed"],
    "description": "Notification endpoint for signed documents"
  }'

SDKs & Libraries

We provide official client libraries for several popular programming languages to make integrating with our API even easier.

JavaScript

Our JavaScript SDK works in both Node.js and browser environments.

npm install mysigneddocuments.com-sdk
View on GitHub

Python

Our Python library is compatible with Python 3.6 and higher.

pip install mysigneddocuments.com
View on GitHub

PHP

Our PHP library requires PHP 7.2 or higher.

composer require mysigneddocuments.com/mysigneddocuments.com-php
View on GitHub

Java

Our Java SDK requires Java 8 or higher.

// Add to your pom.xml
<dependency>
    <groupId>com.mysigneddocuments.com</groupId>
    <artifactId>mysigneddocuments.com-java</artifactId>
    <version>1.0.0</version>
</dependency>
View on GitHub

Code Examples

Here are some common use cases and how to implement them using our API.

Create and Send a Document for Signature

// JavaScript example (Node.js)
const mysigneddocuments = require('mysigneddocuments.com-sdk');
const fs = require('fs');

const client = new mysigneddocuments('YOUR_API_KEY');

async function createAndSendDocument() {
  try {
    // 1. Upload the document
    const documentFile = fs.readFileSync('contract.pdf');
    const document = await client.documents.create({
      name: 'Contract Agreement',
      file: documentFile,
    });
    
    // 2. Add signers
    const signers = await client.documents.addSigners(document.id, [
      {
        email: 'john@example.com',
        name: 'John Smith',
        role: 'signer'
      },
      {
        email: 'sarah@example.com',
        name: 'Sarah Johnson',
        role: 'signer'
      }
    ]);
    
    // 3. Add signature fields
    await client.documents.addFields(document.id, [
      {
        type: 'signature',
        page: 1,
        x: 100,
        y: 200,
        width: 200,
        height: 50,
        signer_id: signers[0].id,
        required: true
      },
      {
        type: 'signature',
        page: 1,
        x: 100,
        y: 300,
        width: 200,
        height: 50,
        signer_id: signers[1].id,
        required: true
      }
    ]);
    
    // 4. Send the document for signing
    await client.documents.send(document.id, {
      message: 'Please sign this contract agreement.',
      subject: 'Contract for Signature',
      expires_in: 30
    });
    
    console.log('Document sent for signature!');
  } catch (error) {
    console.error('Error:', error);
  }
}

createAndSendDocument();
# Python example
import mysigneddocuments.com

client = mysigneddocuments.com.Client('YOUR_API_KEY')

# 1. Upload the document
with open('contract.pdf', 'rb') as file:
    document = client.documents.create(
        name='Contract Agreement',
        file=file
    )

# 2. Add signers
signers = client.documents.add_signers(document.id, [
    {
        'email': 'john@example.com',
        'name': 'John Smith',
        'role': 'signer'
    },
    {
        'email': 'sarah@example.com',
        'name': 'Sarah Johnson',
        'role': 'signer'
    }
])

# 3. Add signature fields
client.documents.add_fields(document.id, [
    {
        'type': 'signature',
        'page': 1,
        'x': 100,
        'y': 200,
        'width': 200,
        'height': 50,
        'signer_id': signers[0]['id'],
        'required': True
    },
    {
        'type': 'signature',
        'page': 1,
        'x': 100,
        'y': 300,
        'width': 200,
        'height': 50,
        'signer_id': signers[1]['id'],
        'required': True
    }
])

# 4. Send the document for signing
client.documents.send(document.id, 
    message='Please sign this contract agreement.',
    subject='Contract for Signature',
    expires_in=30
)

print('Document sent for signature!')
// PHP example
documents->create([
        'name' => 'Contract Agreement',
        'file' => fopen('contract.pdf', 'r')
    ]);
    
    // 2. Add signers
    $signers = $client->documents->addSigners($document->id, [
        [
            'email' => 'john@example.com',
            'name' => 'John Smith',
            'role' => 'signer'
        ],
        [
            'email' => 'sarah@example.com',
            'name' => 'Sarah Johnson',
            'role' => 'signer'
        ]
    ]);
    
    // 3. Add signature fields
    $client->documents->addFields($document->id, [
        [
            'type' => 'signature',
            'page' => 1,
            'x' => 100,
            'y' => 200,
            'width' => 200,
            'height' => 50,
            'signer_id' => $signers[0]->id,
            'required' => true
        ],
        [
            'type' => 'signature',
            'page' => 1,
            'x' => 100,
            'y' => 300,
            'width' => 200,
            'height' => 50,
            'signer_id' => $signers[1]->id,
            'required' => true
        ]
    ]);
    
    // 4. Send the document for signing
    $client->documents->send($document->id, [
        'message' => 'Please sign this contract agreement.',
        'subject' => 'Contract for Signature',
        'expires_in' => 30
    ]);
    
    echo 'Document sent for signature!';
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
?>