Sign
curl --request POST \
--url https://api.superdoc.dev/v1/sign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document": {
"base64": "aSDinaTvuI8gbWludGxpZnk="
},
"signer": {
"email": "jane@example.com",
"name": "Jane Smith",
"ip": "203.0.113.42",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
},
"auditTrail": [
{
"timestamp": "2023-11-07T05:31:56Z",
"data": {}
}
],
"eventId": "<string>",
"metadata": {},
"certificate": {
"enabled": true
}
}
'import requests
url = "https://api.superdoc.dev/v1/sign"
payload = {
"document": { "base64": "aSDinaTvuI8gbWludGxpZnk=" },
"signer": {
"email": "jane@example.com",
"name": "Jane Smith",
"ip": "203.0.113.42",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
},
"auditTrail": [
{
"timestamp": "2023-11-07T05:31:56Z",
"data": {}
}
],
"eventId": "<string>",
"metadata": {},
"certificate": { "enabled": True }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
document: {base64: 'aSDinaTvuI8gbWludGxpZnk='},
signer: {
email: 'jane@example.com',
name: 'Jane Smith',
ip: '203.0.113.42',
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36'
},
auditTrail: [{timestamp: '2023-11-07T05:31:56Z', data: {}}],
eventId: '<string>',
metadata: {},
certificate: {enabled: true}
})
};
fetch('https://api.superdoc.dev/v1/sign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.superdoc.dev/v1/sign",
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([
'document' => [
'base64' => 'aSDinaTvuI8gbWludGxpZnk='
],
'signer' => [
'email' => 'jane@example.com',
'name' => 'Jane Smith',
'ip' => '203.0.113.42',
'userAgent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36'
],
'auditTrail' => [
[
'timestamp' => '2023-11-07T05:31:56Z',
'data' => [
]
]
],
'eventId' => '<string>',
'metadata' => [
],
'certificate' => [
'enabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.superdoc.dev/v1/sign"
payload := strings.NewReader("{\n \"document\": {\n \"base64\": \"aSDinaTvuI8gbWludGxpZnk=\"\n },\n \"signer\": {\n \"email\": \"jane@example.com\",\n \"name\": \"Jane Smith\",\n \"ip\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36\"\n },\n \"auditTrail\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"data\": {}\n }\n ],\n \"eventId\": \"<string>\",\n \"metadata\": {},\n \"certificate\": {\n \"enabled\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.superdoc.dev/v1/sign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document\": {\n \"base64\": \"aSDinaTvuI8gbWludGxpZnk=\"\n },\n \"signer\": {\n \"email\": \"jane@example.com\",\n \"name\": \"Jane Smith\",\n \"ip\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36\"\n },\n \"auditTrail\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"data\": {}\n }\n ],\n \"eventId\": \"<string>\",\n \"metadata\": {},\n \"certificate\": {\n \"enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.superdoc.dev/v1/sign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document\": {\n \"base64\": \"aSDinaTvuI8gbWludGxpZnk=\"\n },\n \"signer\": {\n \"email\": \"jane@example.com\",\n \"name\": \"Jane Smith\",\n \"ip\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36\"\n },\n \"auditTrail\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"data\": {}\n }\n ],\n \"eventId\": \"<string>\",\n \"metadata\": {},\n \"certificate\": {\n \"enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"document": {
"base64": "<string>",
"contentType": "<string>"
}
}{
"code": "INVALID_FILE_FORMAT",
"error": "Bad Request",
"message": "File is not a valid DOCX",
"requestId": "req_abc123"
}{
"code": "INVALID_FILE_FORMAT",
"error": "Bad Request",
"message": "File is not a valid DOCX",
"requestId": "req_abc123"
}{
"code": "INVALID_FILE_FORMAT",
"error": "Bad Request",
"message": "File is not a valid DOCX",
"requestId": "req_abc123"
}{
"code": "INVALID_FILE_FORMAT",
"error": "Bad Request",
"message": "File is not a valid DOCX",
"requestId": "req_abc123"
}Document Operations
Sign
Sign a PDF or DOCX document with a cryptographic signature.
Send a JSON request body with:
document(required): object containing eitherbase64orurlsigner(required): signer details —emailandnameare required;ipanduserAgentare optional and, when provided, are recorded in the audit trail certificate. No other signer fields are accepted; usemetadatafor anything application-specific.auditTrail(required): array of signing events. Must include at least onesubmitevent for e-signature compliance.eventId(optional): unique identifier for the signing eventmetadata(optional): free-form object for application-specific context (tenantId, contractId, etc.)certificate(optional):{ enabled: boolean }— controls whether an audit trail certificate page is appended (default:true)
The response returns the signed PDF as base64.
POST
/
v1
/
sign
Sign
curl --request POST \
--url https://api.superdoc.dev/v1/sign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document": {
"base64": "aSDinaTvuI8gbWludGxpZnk="
},
"signer": {
"email": "jane@example.com",
"name": "Jane Smith",
"ip": "203.0.113.42",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
},
"auditTrail": [
{
"timestamp": "2023-11-07T05:31:56Z",
"data": {}
}
],
"eventId": "<string>",
"metadata": {},
"certificate": {
"enabled": true
}
}
'import requests
url = "https://api.superdoc.dev/v1/sign"
payload = {
"document": { "base64": "aSDinaTvuI8gbWludGxpZnk=" },
"signer": {
"email": "jane@example.com",
"name": "Jane Smith",
"ip": "203.0.113.42",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
},
"auditTrail": [
{
"timestamp": "2023-11-07T05:31:56Z",
"data": {}
}
],
"eventId": "<string>",
"metadata": {},
"certificate": { "enabled": True }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
document: {base64: 'aSDinaTvuI8gbWludGxpZnk='},
signer: {
email: 'jane@example.com',
name: 'Jane Smith',
ip: '203.0.113.42',
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36'
},
auditTrail: [{timestamp: '2023-11-07T05:31:56Z', data: {}}],
eventId: '<string>',
metadata: {},
certificate: {enabled: true}
})
};
fetch('https://api.superdoc.dev/v1/sign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.superdoc.dev/v1/sign",
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([
'document' => [
'base64' => 'aSDinaTvuI8gbWludGxpZnk='
],
'signer' => [
'email' => 'jane@example.com',
'name' => 'Jane Smith',
'ip' => '203.0.113.42',
'userAgent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36'
],
'auditTrail' => [
[
'timestamp' => '2023-11-07T05:31:56Z',
'data' => [
]
]
],
'eventId' => '<string>',
'metadata' => [
],
'certificate' => [
'enabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.superdoc.dev/v1/sign"
payload := strings.NewReader("{\n \"document\": {\n \"base64\": \"aSDinaTvuI8gbWludGxpZnk=\"\n },\n \"signer\": {\n \"email\": \"jane@example.com\",\n \"name\": \"Jane Smith\",\n \"ip\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36\"\n },\n \"auditTrail\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"data\": {}\n }\n ],\n \"eventId\": \"<string>\",\n \"metadata\": {},\n \"certificate\": {\n \"enabled\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.superdoc.dev/v1/sign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document\": {\n \"base64\": \"aSDinaTvuI8gbWludGxpZnk=\"\n },\n \"signer\": {\n \"email\": \"jane@example.com\",\n \"name\": \"Jane Smith\",\n \"ip\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36\"\n },\n \"auditTrail\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"data\": {}\n }\n ],\n \"eventId\": \"<string>\",\n \"metadata\": {},\n \"certificate\": {\n \"enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.superdoc.dev/v1/sign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document\": {\n \"base64\": \"aSDinaTvuI8gbWludGxpZnk=\"\n },\n \"signer\": {\n \"email\": \"jane@example.com\",\n \"name\": \"Jane Smith\",\n \"ip\": \"203.0.113.42\",\n \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36\"\n },\n \"auditTrail\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"data\": {}\n }\n ],\n \"eventId\": \"<string>\",\n \"metadata\": {},\n \"certificate\": {\n \"enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"document": {
"base64": "<string>",
"contentType": "<string>"
}
}{
"code": "INVALID_FILE_FORMAT",
"error": "Bad Request",
"message": "File is not a valid DOCX",
"requestId": "req_abc123"
}{
"code": "INVALID_FILE_FORMAT",
"error": "Bad Request",
"message": "File is not a valid DOCX",
"requestId": "req_abc123"
}{
"code": "INVALID_FILE_FORMAT",
"error": "Bad Request",
"message": "File is not a valid DOCX",
"requestId": "req_abc123"
}{
"code": "INVALID_FILE_FORMAT",
"error": "Bad Request",
"message": "File is not a valid DOCX",
"requestId": "req_abc123"
}Body
application/json
Was this page helpful?

