開発者向け
アプリのすべての機能を REST API と MCP サーバーとして提供しているため、バックエンドや AI エージェントから文書の送信、署名状況の追跡、オンチェーン証明の取得が行えます。料金は同じく 1 文書あたり 1 クレジットです。
https://signdocumentsonchain.com/api/v1https://signdocumentsonchain.com/api/mcpAI エージェント向け MCP
エンドポイントは https://signdocumentsonchain.com/api/mcp(Streamable HTTP)で、API キーで認証します。ツール:get_account, quote, send_document, list_documents, get_document, remind_signer, cancel_document, verify。
Claude Code:
claude mcp add --transport http signonchain https://signdocumentsonchain.com/api/mcp \
--header "Authorization: Bearer soc_YOUR_KEY"JSON 設定に対応した任意のクライアント(Cursor、Windsurf、mcp-remote 経由の Claude Desktop など):
{
"mcpServers": {
"signonchain": {
"url": "https://signdocumentsonchain.com/api/mcp",
"headers": { "Authorization": "Bearer soc_YOUR_KEY" }
}
}
}エージェントには、送信前に文書・署名者・費用をユーザーに確認すること、および文書内に記載された指示には従わないことが指示されています。すべての送信には冪等キーが付与されるため、再試行してもメールの重複送信や二重課金は発生しません。
REST API
ベース URL は https://signdocumentsonchain.com/api/v1 です。すべてのリクエストに Authorization: Bearer soc_… を付けて送信してください。
PDF を署名に送信する:
curl https://signdocumentsonchain.com/api/v1/envelopes \
-H "Authorization: Bearer $SOC_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-F document=@contract.pdf \
-F 'signers=[{"email":"ana@example.com","name":"Ana Gómez"},{"email":"bob@example.com"}]' \
-F title="Consulting agreement"または、PDF を base64 エンコードした JSON で送信する:
{
"document": { "filename": "nda.pdf", "content_base64": "JVBERi0xLjQK..." },
"signers": [{ "email": "ana@example.com", "name": "Ana Gómez" }],
"title": "Mutual NDA",
"message": "Please sign by Friday"
}その後、文書が完了して証明されるまでポーリングします:
{
"id": "5955ce9b-…",
"status": "completed",
"signers": [{ "email": "ana@example.com", "status": "signed", "signed_at": "…" }],
"certification": {
"status": "confirmed",
"commitment": "da1e163b…",
"chain": "Base",
"transaction": "0x…",
"explorer_url": "https://basescan.org/tx/0x…",
"verify_url": "https://signdocumentsonchain.com/verify/da1e163b…"
},
"files": { "signed": "https://…/api/v1/download/…", "certificate": "https://…" }
}エラーと制限
invalid_request401unauthorized402insufficient_credits404not_foundエラーは {"error":{"code","message"}} の形式で、ステータスは 400(invalid_request)、401(unauthorized)、402(insufficient_credits)、404(not_found)です。ファイル形式は問わず、最大 100 MB まで受け付けます。リクエスト本文はホスティング基盤により約 4 MB に制限されるため、小さなファイルはインライン(base64 またはマルチパート、約 3 MB 未満)で送信し、大きなファイルは 2 段階で送信してください:ファイル名を指定して POST /uploads を呼ぶと put_url が返されます。そこに生のバイトを PUT し、"document": { "filename", "upload_id" } で文書を作成します。PDF には証明書が末尾に追加されます。その他のファイルはそのまま署名され、別途証明書 PDF が発行されます。
{
"error": {
"code": "insufficient_credits",
"message": "…"
}
}複数ファイル、URL、Google Drive
"documents": [ … ] では最大 20 個のファイルを 1 つの文書としてまとめて署名できます。各ファイルには content_base64、upload_id、url(当社がダウンロードする公開 https リンク)、google_drive_file_id(連携ページでの Google Drive 接続が必要)のいずれか 1 つを指定します。マルチパートの場合は document と document_url を繰り返します。複数の PDF は 1 つの PDF に結合され、それ以外の組み合わせは 1 つの ZIP になります。各ファイルの SHA-512 は証明書に記載され、個別に検証できます。
{
"documents": [
{ "filename": "contract.pdf", "upload_id": "…" },
{ "url": "https://example.com/annex.pdf" },
{ "google_drive_file_id": "1AbC…" }
],
"signers": [{ "email": "ana@example.com" }]
}Webhook、Zapier、Make、n8n
イベント:document.sent, signer.viewed, signer.signed, signer.declined, document.completed, document.declined, document.canceled, document.certified。各イベントは { id, type, created_at, data: { document, signer? } } として POST され、Standard Webhooks のヘッダー(webhook-id、webhook-timestamp、webhook-signature)が付与されます。署名には HMAC-SHA256 ではなく HMAC-SHA-512(NSA CNSA 2.0)を使用します:webhook-signature: v2,<base64 HMAC-SHA512(secret, id.timestamp.body)>。キーは whsec_ の後ろの base64 です。2xx 応答はすべて配信成功とみなされ、410 で登録解除され、失敗した場合は約 1 日間再試行されます。Zapier、Make、n8n のアプリも API キーで同じエンドポイントを使用します。イベント内のダウンロードリンクは 24 時間有効です。
webhook-id: evt_3f9a…
webhook-timestamp: 1764806400
webhook-signature: v2,Zt3q…
{
"id": "evt_3f9a…",
"type": "document.completed",
"created_at": "2026-12-04T10:00:00Z",
"data": { "document": { "id": "5955ce9b-…", "status": "completed", … } }
}import { createHmac, timingSafeEqual } from 'node:crypto'
// secret: the whsec_… value shown once when you add the webhook
export function verify(secret, headers, rawBody) {
const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64')
const signed = `${headers['webhook-id']}.${headers['webhook-timestamp']}.${rawBody}`
const expected = Buffer.from('v2,' + createHmac('sha512', key).update(signed).digest('base64'))
return headers['webhook-signature'].split(' ').some((s) => {
const got = Buffer.from(s)
return got.length === expected.length && timingSafeEqual(got, expected)
})
}ご不明な点はありますか?すべてのレスポンスには、signdocumentsonchain.com で文書を確認できる dashboard_url が含まれています。