Comprehensive guides and API references to help you get the most out of CrossDocument.
CrossDocument is a secure digital document signing platform that enables businesses to streamline their document workflows. Our platform provides electronic signatures that are legally binding and compliant with regulations worldwide.
This documentation is for CrossDocument v3.0. If you're using an older version, please refer to the legacy documentation.
Get up and running with CrossDocument in minutes by following these simple steps:
Sign up for a free trial account at crossdocument.com/register.
Upload the document you need signed from your dashboard.
Drag and drop signature fields onto your document where signatures are needed.
Enter the email addresses of your signatories and send the document.
Monitor the signing progress in real-time from your dashboard.
The CrossDocument API allows you to integrate our electronic signature capabilities into your own applications. Our RESTful API provides endpoints for managing documents, templates, signatures, and more.
https://api.crossdocument.com/v3
All requests should be sent with the following headers:
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
All responses are returned in JSON format with the following structure:
{
"status": "success",
"data": {
// Response data here
}
}
Errors are returned with appropriate HTTP status codes and a JSON body:
{
"status": "error",
"error": {
"code": "invalid_request",
"message": "The request was invalid",
"details": [
// Additional error details
]
}
}
The CrossDocument API uses API keys for authentication. You can generate and manage your API keys from your account dashboard.
Your API key will only be displayed once. Make sure to copy it and store it securely.
Include your API key in the Authorization header of all requests:
curl -X GET \
https://api.crossdocument.com/v3/documents \
-H 'Authorization: Bearer YOUR_API_KEY'
The Documents API allows you to create, retrieve, update, and delete documents in your CrossDocument account.
POST /documents
Upload a new document to your account.
curl -X POST \
https://api.crossdocument.com/v3/documents \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@contract.pdf' \
-F 'name=Sales Contract' \
-F 'folder_id=123456'
{
"status": "success",
"data": {
"document_id": "doc_123456789",
"name": "Sales Contract",
"created_at": "2023-01-15T14:30:00Z",
"status": "draft",
"file": {
"name": "contract.pdf",
"size": 1024000,
"type": "application/pdf"
}
}
}
GET /documents
Retrieve a list of documents in your account.
curl -X GET \
'https://api.crossdocument.com/v3/documents?limit=10&offset=0' \
-H 'Authorization: Bearer YOUR_API_KEY'
{
"status": "success",
"data": {
"documents": [
{
"document_id": "doc_123456789",
"name": "Sales Contract",
"created_at": "2023-01-15T14:30:00Z",
"status": "draft"
},
{
"document_id": "doc_987654321",
"name": "NDA Agreement",
"created_at": "2023-01-14T10:15:00Z",
"status": "completed"
}
],
"total": 2,
"limit": 10,
"offset": 0
}
}
Here are some examples of how to use the CrossDocument API in different programming languages.
// Send a document for signature using JavaScript
const axios = require('axios');
const fs = require('fs');
const FormData = require('form-data');
const API_KEY = 'YOUR_API_KEY';
const API_URL = 'https://api.crossdocument.com/v3';
async function sendDocument() {
try {
// First, upload the document
const formData = new FormData();
formData.append('file', fs.createReadStream('contract.pdf'));
formData.append('name', 'Sales Contract');
const uploadResponse = await axios.post(`${API_URL}/documents`, formData, {
headers: {
...formData.getHeaders(),
'Authorization': `Bearer ${API_KEY}`
}
});
const documentId = uploadResponse.data.data.document_id;
// Now, send it for signature
const signatories = [
{
email: 'john@example.com',
name: 'John Doe',
role: 'signer'
},
{
email: 'jane@example.com',
name: 'Jane Smith',
role: 'approver'
}
];
const sendResponse = await axios.post(`${API_URL}/documents/${documentId}/send`, {
signatories,
message: 'Please sign this contract',
expires_in: 7 // days
}, {
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
}
});
console.log('Document sent successfully:', sendResponse.data);
} catch (error) {
console.error('Error:', error.response ? error.response.data : error.message);
}
}
sendDocument();
import requests
import json
API_KEY = 'YOUR_API_KEY'
API_URL = 'https://api.crossdocument.com/v3'
def send_document():
# First, upload the document
headers = {
'Authorization': f'Bearer {API_KEY}'
}
files = {
'file': ('contract.pdf', open('contract.pdf', 'rb'), 'application/pdf')
}
data = {
'name': 'Sales Contract'
}
upload_response = requests.post(
f'{API_URL}/documents',
headers=headers,
files=files,
data=data
)
upload_data = upload_response.json()
document_id = upload_data['data']['document_id']
# Now, send it for signature
signatories = [
{
'email': 'john@example.com',
'name': 'John Doe',
'role': 'signer'
},
{
'email': 'jane@example.com',
'name': 'Jane Smith',
'role': 'approver'
}
]
send_data = {
'signatories': signatories,
'message': 'Please sign this contract',
'expires_in': 7 # days
}
send_headers = {
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
}
send_response = requests.post(
f'{API_URL}/documents/{document_id}/send',
headers=send_headers,
data=json.dumps(send_data)
)
print('Document sent successfully:', send_response.json())
if __name__ == '__main__':
send_document()
<?php
$API_KEY = 'YOUR_API_KEY';
$API_URL = 'https://api.crossdocument.com/v3';
function sendDocument() {
global $API_KEY, $API_URL;
// First, upload the document
$curl = curl_init();
$postFields = [
'file' => new CURLFile('contract.pdf', 'application/pdf', 'contract.pdf'),
'name' => 'Sales Contract'
];
curl_setopt_array($curl, [
CURLOPT_URL => $API_URL . '/documents',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $postFields,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $API_KEY
],
]);
$uploadResponse = curl_exec($curl);
$uploadErr = curl_error($curl);
curl_close($curl);
if ($uploadErr) {
echo 'Error uploading document: ' . $uploadErr;
return;
}
$uploadData = json_decode($uploadResponse, true);
$documentId = $uploadData['data']['document_id'];
// Now, send it for signature
$signatories = [
[
'email' => 'john@example.com',
'name' => 'John Doe',
'role' => 'signer'
],
[
'email' => 'jane@example.com',
'name' => 'Jane Smith',
'role' => 'approver'
]
];
$sendData = [
'signatories' => $signatories,
'message' => 'Please sign this contract',
'expires_in' => 7 // days
];
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $API_URL . '/documents/' . $documentId . '/send',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($sendData),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $API_KEY,
'Content-Type: application/json'
],
]);
$sendResponse = curl_exec($curl);
$sendErr = curl_error($curl);
curl_close($curl);
if ($sendErr) {
echo 'Error sending document: ' . $sendErr;
return;
}
echo 'Document sent successfully: ' . $sendResponse;
}
sendDocument();
?>
require 'net/http'
require 'uri'
require 'json'
require 'mime/types'
API_KEY = 'YOUR_API_KEY'
API_URL = 'https://api.crossdocument.com/v3'
def send_document
# First, upload the document
uri = URI.parse("#{API_URL}/documents")
file = File.open('contract.pdf', 'rb')
content_type = MIME::Types.type_for('contract.pdf').first.content_type
# Create request
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{API_KEY}"
# Create multipart form data
boundary = "----WebKitFormBoundary#{SecureRandom.hex(16)}"
request['Content-Type'] = "multipart/form-data; boundary=#{boundary}"
post_body = []
post_body << "--#{boundary}\r\n"
post_body << "Content-Disposition: form-data; name=\"file\"; filename=\"contract.pdf\"\r\n"
post_body << "Content-Type: #{content_type}\r\n\r\n"
post_body << file.read
post_body << "\r\n--#{boundary}\r\n"
post_body << "Content-Disposition: form-data; name=\"name\"\r\n\r\n"
post_body << "Sales Contract"
post_body << "\r\n--#{boundary}--\r\n"
request.body = post_body.join
# Send request
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = (uri.scheme == 'https')
upload_response = http.request(request)
upload_data = JSON.parse(upload_response.body)
document_id = upload_data['data']['document_id']
# Now, send it for signature
signatories = [
{
email: 'john@example.com',
name: 'John Doe',
role: 'signer'
},
{
email: 'jane@example.com',
name: 'Jane Smith',
role: 'approver'
}
]
send_data = {
signatories: signatories,
message: 'Please sign this contract',
expires_in: 7 # days
}
uri = URI.parse("#{API_URL}/documents/#{document_id}/send")
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{API_KEY}"
request['Content-Type'] = 'application/json'
request.body = send_data.to_json
send_response = http.request(request)
puts "Document sent successfully: #{send_response.body}"
end
send_document