Documentation

Everything you need to integrate agreement signing into your application.

Quickstart

Get your first agreement signed in 5 minutes.

1Create an API key

Sign up at pactra.dev/signup, then go to Settings → API Keys and create a new key.

2Create an agreement

curl -X POST https://pactra.dev/api/v1/agreements \
  -H "Authorization: Bearer pk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Service Agreement",
    "description": "Q1 consulting contract"
  }'

3Add signers and send

Add signers to the agreement, then send it for signature. Each signer receives an email with a secure signing link.

4Verify with receipts

When signing completes, a cryptographic receipt is generated. Verify it anytime via the API to prove what was signed, by whom, and when.

Authentication

Authenticate API requests using Bearer token authentication with your API key.

Authorization: Bearer pk_live_YOUR_API_KEY

Key Types

PrefixModeDescription
pk_live_LiveProduction data. Sends real emails.
pk_test_TestSandbox mode. No emails sent.

Agreements API

Create, list, and manage agreements programmatically.

GET/api/v1/agreements
List agreements. Supports ?status=, ?limit=, ?offset= query params.
POST/api/v1/agreements

Create a new draft agreement.

{
  "title": "Service Agreement",
  "description": "Optional description",
  "document_id": "uuid (optional)"
}
GET/api/v1/agreements/:id
Get a specific agreement with signers and versions.

Receipts & Verification

Every signature generates a cryptographic receipt with a SHA-256 hash of all signing data. Verify receipts anytime to prove integrity.

GET/api/v1/receipts/:id
Retrieve a signature receipt.
POST/api/v1/receipts/:id/verify
Verify receipt integrity by recomputing the hash and comparing. Returns { valid: true/false }.

Webhooks

Receive real-time notifications when events occur. Payloads are signed with HMAC-SHA256.

Events

EventDescription
signature.completedA signer has completed their signature.
agreement.completedAll signers have signed. Agreement is complete.

Verification

// Verify the webhook signature
const signature = request.headers['x-pactra-signature'];
const expected = 'sha256=' + hmacSha256(body, webhookSecret);
if (signature !== expected) throw new Error('Invalid signature');

Retry Policy

Failed deliveries are retried up to 5 times with exponential backoff: 1m, 5m, 30m, 2h, 12h. After max retries, the delivery is marked as dead-lettered.

MCP / AI Agents

Connect AI agents to Pactra using the Model Context Protocol (MCP). Any MCP-compatible client (Claude Code, ChatGPT, Cursor, etc.) can create and manage agreements.

Setup

// Add to your MCP client configuration
{
  "mcpServers": {
    "pactra": {
      "command": "npx",
      "args": ["pactra-mcp"],
      "env": {
        "PACTRA_API_KEY": "pk_live_YOUR_KEY"
      }
    }
  }
}

Available Tools

ToolDescription
list_agreementsList agreements in the workspace
create_agreementCreate a new draft agreement
get_agreementGet agreement details and status
add_signerAdd a signer to a draft agreement
get_receiptRetrieve a signature receipt
verify_receiptVerify receipt cryptographic integrity

SDKs

Use our TypeScript SDK for type-safe API access, or the React component for embedded signing.

@pactra/sdk
import { PactraClient } from '@pactra/sdk';

const pactra = new PactraClient({
  apiKey: 'pk_live_...'
});

const agreement = await pactra
  .createAgreement({
    title: 'Service Agreement'
  });
@pactra/react
import { PactraSigning } from '@pactra/react';

<PactraSigning
  token={signingToken}
  onSigned={(e) => {
    console.log('Signed!', e);
  }}
  onError={(e) => {
    console.error('Error', e);
  }}
/>

Need help? Contact us at hello@pactra.dev