API と MCP
署名を除き、ProperTrust パネルでできるすべての操作を独自のシステムや AI エージェントから利用できます:Bitcoin でのファイルへのタイムスタンプ付与、条項ライブラリからの契約作成、署名ラウンドの開始と完了までの追跡、証明の確認。
クイックスタート
1. サインインし、パネルの「API と MCP」でキーを作成します。キーは pt_live_ で始まり、一度だけ表示されます。 キーのページを開く
2. すべての呼び出しでベアラートークンとして送信します。
curl https://api.propertrust.com/v1/me \ -H "Authorization: Bearer pt_live_…"
3. ファイルにタイムスタンプを付与します:内容は暗号化して保存され、その SHA-256 が Bitcoin に記録されます。
curl -X POST https://api.propertrust.com/v1/documents \ -H "Authorization: Bearer pt_live_…" \ -F title="Board minutes 26 November" -F file=@minutes.pdf
4. 独自の文面から署名ラウンドを開始します。各「## 見出し」は条項となり、当事者は署名前に一つずつ確認します。
curl -X POST https://api.propertrust.com/v1/agreements \
-H "Authorization: Bearer pt_live_…" -H "Content-Type: application/json" \
-H "Idempotency-Key: order-10482" \
-d '{"title":"Purchase of Product X",
"wording":"## 1. Subject\nThe Seller sells Product X to the Buyer for CHF 1200.\n\n## 2. Delivery\nWithin 14 days.",
"parties":[{"name":"Jane Buyer","email":"jane@example.com","role":"Buyer"}]}'
レスポンスには ID、PDF のハッシュ、検証コード、招待された各当事者の参加リンクが含まれます。status が completed になるまで GET /agreements/{id} をポーリングしてください。
エージェントおよび開発者向けの完全なガイドはこちら: https://api.propertrust.com: 契約書の登録方法、当事者への送付方法、返送される署名の種類、閲覧権限、Telegram ボットが起動するタイミングについて説明しています。
ベース URL: https://api.propertrust.com/v1 · OpenAPI 3.1: https://api.propertrust.com/openapi.json · 言語モデル向け: https://api.propertrust.com/llms.txt
MCP:AI エージェントを接続
ProperTrust は Model Context Protocol サーバーです。お客様のキーで接続したエージェントは、このページのすべての操作を接頭辞 pt_ の付いたツールとして利用できます。エージェントはお客様のアカウントとして、キーのスコープの範囲内で動作します。表示されるツール一覧はすでにそのスコープで絞り込まれています。
エンドポイント: https://api.propertrust.com/mcp · トランスポート:Streamable HTTP(POST による JSON-RPC 2.0、ステートレス)
claude mcp add --transport http propertrust https://api.propertrust.com/mcp \ --header "Authorization: Bearer pt_live_…"
{
"mcpServers": {
"propertrust": {
"type": "http",
"url": "https://api.propertrust.com/mcp",
"headers": { "Authorization": "Bearer pt_live_…" }
}
}
}
ローカルサーバーしか起動できないクライアントは、mcp-remote ブリッジ経由でエンドポイントに接続します。設定例はパネルのキーのページに表示されます。
手動で試す:
curl -X POST https://api.propertrust.com/mcp \
-H "Authorization: Bearer pt_live_…" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"pt_whoami","arguments":{}}}'
ルール
- キーは作成したアカウントとして動作し、そのアカウントが閲覧できるものを閲覧できます。スコープは最大3つです:read(常に付与)、write、content。
- キーで署名することはできません。署名は、各当事者がすべての条項を確認したうえで、パネルまたは Telegram で本人が行います。API で文面を読み取っても、既読確認とはみなされません。
- 契約の作成、当事者の追加、リマインドを行うと、他の人にメールが送信されます。エージェントは実行前に依頼者の確認を取ってください。
- 確定済みの文面は編集できません。変更するには、契約をキャンセルして新しく作成してください。
- 公開されるのはハッシュのみです。タイトルは public_title を設定した場合にのみ証明ページに表示されます。
- 作成される文面は条項ライブラリに基づく補助であり、法的助言ではありません。
アカウント
/v1/mereadMCP: pt_whoamiThe account behind the key: name, identity level, what the key may do. Call it first to check that the connection works.
/v1/catalogreadMCP: pt_catalogThe fixed lists the other calls refer to: contract types with their default roles and fields, legal systems, governing laws with default venue, arbitration institutions, document kinds, identity levels.
/v1/guidereadMCP: pt_guideThe ProperTrust guide for agents, chapter by chapter. Without a topic it lists the chapters. Read "overview" before your first task, "contracts" before creating an agreement, "confidentiality" before handling anything sensitive, "telegram" before passing Telegram handles. Topics: overview, contracts, distribution, signatures, confidentiality, telegram, recipes, errors.
ライブラリ
/v1/templatesreadMCP: pt_templates_listThe templates of the account's library with their key and the variables each one needs.
/v1/templates/{template}readMCP: pt_template_getOne template with its wording in Markdown. Variables appear as {{name}}.
/v1/contracts/composereadMCP: pt_contract_composeBuilds the wording of a contract from structured input with the same deterministic composer as the contract assistant in the panel: no language model is involved, the clauses come from the ProperTrust clause library and depend on contract type, governing law and dispute forum. Returns Markdown. With save_draft the result is also stored as a draft the account holder can review and edit in the panel. Pass the Markdown, or the draft id, to agreement_create to start the signature round. Call catalog for the allowed values.
契約
/v1/agreementswriteMCP: pt_agreement_createFreezes a wording and starts the signature round: the text is rendered to PDF, hashed, stored encrypted and anchored in Bitcoin, and every party is invited to read it clause by clause and sign. Give exactly one source: template (with variables), wording (Markdown, sections start with "## "), draft (id from contract_compose), or a finished file (file_base64 with filename; REST also takes the multipart part "file"). The account behind the key is always the first party. This sends messages to other people: e-mail to parties with an email, and a Telegram message from the ProperTrust bot to parties with a telegram handle. The answer lists, under "telegram", what the bot could do for each handle and the start link to pass on where it could not write. Guide: topics contracts, distribution, telegram.
/v1/agreementsreadMCP: pt_agreements_listAgreements the account owns or is a party to, newest first.
/v1/agreements/{id}readMCP: pt_agreement_getStatus of one agreement: who was invited, who read, who signed (with the signature record: method, time, identity level, hash), who declined, how far the Telegram bot got with each party, the hash of the document, the Bitcoin anchor, the verification code, and after completion the bundle hash and the editions. This is the call to poll. Guide: topic signatures.
/v1/agreements/{id}/wordingcontentMCP: pt_agreement_wordingThe wording of an agreement clause by clause. Reading it through the API does not count as a read receipt for any party. The PDF itself: GET /agreements/{id}/document.
/v1/agreements/{id}/bundlereadMCP: pt_agreement_bundleThe signature bundle of a completed agreement: the canonical record of who signed which document when, with every read receipt and signature hash. Returned parsed and as the exact JSON text whose SHA-256 is bundle_sha256, so you can check the hash yourself. It holds names, times and hashes, not the wording.
/v1/agreements/{id}/partieswriteMCP: pt_agreement_add_partyInvites a further party to an open agreement (owner only). Give an email, a telegram handle, or both. Sends the invitation (e-mail, and through the bot for a handle) unless notify is false; the join link and the Telegram start link are in the answer either way.
/v1/agreements/{id}/parties/{party}writeMCP: pt_agreement_remove_partyRemoves a party that has not read or signed yet (owner only). A party that has read or signed stays on the record.
/v1/agreements/{id}/remindwriteMCP: pt_agreement_remindSends the invitation again to every party that has not joined yet (owner only): by e-mail, and through the Telegram bot for parties with a handle (the bot writes to the same party at most once in six hours).
/v1/agreements/{id}/closewriteMCP: pt_agreement_closeCloses a round that was kept open for further parties (owner only). Works when every current party has signed; the agreement then completes: signature bundle, anchoring, one edition per party.
/v1/agreements/{id}/cancelwriteMCP: pt_agreement_cancelCancels an agreement that is still collecting signatures (owner only). It cannot be reopened; the document and its timestamp stay on the record.
/v1/agreements/{id}/pinwriteMCP: pt_agreement_set_pinSets the PIN of the public verification page, or removes it when pin is left out (owner only). The notice printed on an existing PDF does not change.
/v1/agreements/{id}/documentcontentThe PDF of the agreement, for its owner and its parties. Does not count as a read receipt.
文書と証明
/v1/documentswriteMCP: pt_document_depositStores a file encrypted in the vault and anchors its SHA-256 in Bitcoin: proof that exactly this content existed at this time. Give the content as text, or as content_base64 for binary files. REST also accepts multipart/form-data with the part "file". The anchor is confirmed within a few hours; document_get shows the state.
/v1/documentsreadMCP: pt_documents_listThe documents in the account's vault, newest first.
/v1/documents/{id}readMCP: pt_document_getOne document of the vault with its hash and every anchor: provider, state, Bitcoin block, link to the OpenTimestamps proof file.
/v1/documents/{id}/contentcontentMCP: pt_document_contentThe decrypted file. REST streams the bytes. As a tool it returns text for text files and base64 otherwise, up to 5 MB.
/v1/proofs/{sha256}readMCP: pt_proof_lookupAsks whether a SHA-256 is registered with ProperTrust, by anyone: when it was first seen and how it is anchored. Shows what the public proof page shows, never content. Compute the hash yourself; the file does not need to leave your system.
/v1/verify/{code}readMCP: pt_verify_codeChecks the code printed next to the QR on a ProperTrust document: who issued it, the state of the signature round, the hash and the anchor. Shows what the public check page shows without the PIN.
Telegram
/v1/telegram/groupsreadMCP: pt_telegram_groupsThe Telegram groups the ProperTrust bot moderates and the account is a member of, with the state of the gate and the open rounds. Empty until the account is connected to Telegram (send /connect to the bot).
/v1/agreements/{id}/telegramwriteMCP: pt_telegram_inviteTriggers the ProperTrust bot for one agreement (owner only): it writes to every party with a telegram handle that has not signed and that it has not written to yet, and returns for each such party the status (contacted, or needs_start_link when Telegram does not let the bot write first) and the start link. With again it repeats the invitation to parties contacted before, at most once in six hours. agreement_create and agreement_add_party trigger the bot by themselves; use this after you learn that a party has opened the bot, or for a reminder. Guide: topic telegram.
/v1/telegram/groups/{group}/roundswriteMCP: pt_telegram_moderateLets the bot run the signature round of an open agreement in a Telegram group: it posts the wording there, and every member confirms the clauses and signs in the private chat with the bot. The bot writes into the group at once.
エラーと制限
REST は HTTP ステータスと JSON 本文で応答します。error は判定に使える固定の語、message は人が読むための文です。MCP ツールでは、同じエラーが isError 付きのツール結果として返されます。
{ "error": "scope_missing", "message": "This key does not have the \"write\" scope that agreement_create needs." }
401 missing_api_key, invalid_api_key· キーがない、または不明・無効化済み・期限切れのキー403 scope_missing, forbidden, level_too_low· このキーまたはアカウントにはこの操作の権限がありません404 not_found, template_not_found· このアカウントにこの ID のものは存在しません409 conflict, in_progress· 現在の状態では実行できません(例:契約がすでに完了している)422 invalid_input, cannot_create· 引数が不足しているか誤っています。details に該当フィールドが示されます429 rate_limited· キーごとに毎分 120 回まで。ヘッダー X-RateLimit-Remaining と Retry-After で現在の状況を確認できます
書き込み系の呼び出しは Idempotency-Key ヘッダー(ツールでは引数 idempotency_key)を受け付けます。24時間以内に同じ値で再度呼び出すと、2件目の契約は作成されず、最初の結果が返されます。一覧は limit と page でページ分割され、has_more で次のページの有無がわかります。時刻は UTC の ISO 8601 形式です。アップロードは 48 MB までです。
API バージョン 1.2.0。お問い合わせ:support@propertrust.com