Skip to content

SignetX API Documentation

The SignetX API lets you generate legal contracts programmatically using AI. Bring your own OpenAI or Anthropic API key — you control your AI costs.

BYOK

Use your own AI keys. We never charge you for generation.

Fast

Contracts generated in under 10 seconds.

Legal Templates

NDAs, MSAs, SOWs, employment, and more.

Quick Start

  1. 1. Create a developer account at /signup
  2. 2. Add your OpenAI or Anthropic API key in the dashboard (select your preferred model)
  3. 3. Create an app to get your X-Developer-Key
  4. 4. Start making API requests

Authentication

Every API request must include your developer key in the X-Developer-Key header. You get this key when you create an app in the developer dashboard.

# All requests require the X-Developer-Key header
curl https://api.signetx.net/api/v1/generate \
  -H "X-Developer-Key: sk_signet_dev_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"template_slug": "nda", "fields": {}}'

Important: Never expose your developer key in client-side code or public repositories. Always proxy requests through your backend server.

POST/api/v1/generate

Generate a Contract

Generate a legal contract from a template using AI. The request uses your own AI key (OpenAI or Anthropic) that you configured in the dashboard.

Request Body

ParameterTypeRequiredDescription
template_slugstringYesTemplate to use (e.g. "nda", "msa")
fieldsobjectYesKey-value pairs for template variables
ai_providerstringNo"openai" or "anthropic" (default: your active key)
formatstringNo"text", "html", or "both" (default: "both")

Example (JavaScript)

// Generate a contract
const response = await fetch(
  "https://api.signetx.net/api/v1/generate",
  {
    method: "POST",
    headers: {
      "X-Developer-Key": "sk_signet_dev_xxxxx",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      template_slug: "nda",
      fields: {
        party_a: "Acme Inc.",
        party_b: "TechCorp LLC",
        effective_date: "2026-01-15",
        jurisdiction: "California",
      },
    }),
  }
);

const { contract, metadata } = await response.json();
// contract.id — use to retrieve later
// contract.content — the generated contract text
// contract.html — formatted HTML version
// metadata.tokens_used — AI tokens consumed

Example (Python)

import requests

response = requests.post(
    "https://api.signetx.net/api/v1/generate",
    headers={
        "X-Developer-Key": "sk_signet_dev_xxxxx",
        "Content-Type": "application/json",
    },
    json={
        "template_slug": "nda",
        "fields": {
            "party_a": "Acme Inc.",
            "party_b": "TechCorp LLC",
            "effective_date": "2026-01-15",
        },
    },
)

data = response.json()
print(data["contract"]["content"])

Response

{
  "contract": {
    "id": "ctr_abc123",
    "content": "MUTUAL NON-DISCLOSURE AGREEMENT\n\nThis Agreement...",
    "html": "<h1>Mutual Non-Disclosure Agreement</h1>...",
    "template_slug": "nda",
    "created_at": "2026-01-15T10:30:00Z"
  },
  "metadata": {
    "tokens_used": 1200,
    "ai_provider": "openai",
    "generation_time_ms": 8500
  }
}
GET/api/v1/templates

List Available Templates

Returns the list of templates available to your app. This is determined by the template scoping you configured when creating the app.

// List available templates for your app
const response = await fetch(
  "https://api.signetx.net/api/v1/templates",
  {
    headers: {
      "X-Developer-Key": "sk_signet_dev_xxxxx",
    },
  }
);

const { templates } = await response.json();
// templates: [
//   { slug: "nda", name: "NDA", category: "legal" },
//   { slug: "msa", name: "Master Service Agreement", category: "legal" },
//   ...
// ]

Response

{
  "templates": [
    {
      "slug": "nda",
      "name": "Non-Disclosure Agreement",
      "category": "legal",
      "fields": ["party_a", "party_b", "effective_date", "jurisdiction"]
    },
    {
      "slug": "msa",
      "name": "Master Service Agreement",
      "category": "legal",
      "fields": ["client", "provider", "term_months", "payment_terms"]
    }
  ]
}
GET/api/v1/contracts/:id

Retrieve a Contract

Fetch a previously generated contract by its ID. Returns the full content in both plain text and HTML formats.

// Retrieve a previously generated contract
const response = await fetch(
  "https://api.signetx.net/api/v1/contracts/${id}",
  {
    headers: {
      "X-Developer-Key": "sk_signet_dev_xxxxx",
    },
  }
);

const { contract } = await response.json();
// contract.content — plain text
// contract.html — formatted HTML
// contract.metadata — template info, fields used
EMBED/embed/:appId

Embeddable Widget

Drop a single iframe into your app to give your users a fully branded contract creation experience. The widget uses your developer AI key and respects your template scoping.

<!-- Embed the SignetX widget in your app -->
<iframe
  src="https://api.signetx.net/embed/APP_ID"
  width="100%"
  height="600"
  frameborder="0"
  style="border-radius: 12px; border: 1px solid #e0e0e0;"
></iframe>

Customization

  • - Branding: Set custom colors, logo, and title in your app settings
  • - Templates: Choose which templates appear in the widget
  • - Theme: Light or dark mode
WEBHOOKEvent notifications

Webhooks

Configure a webhook URL in your app settings to receive real-time notifications when contracts are generated, signed, or updated.

Supported Events

contract.generatedFired when a contract is successfully generated
contract.signedFired when a contract is signed by a party
contract.updatedFired when a contract is edited or amended
app.rate_limitedFired when your app hits its daily rate limit

Payload Example

// Webhook payloads are sent as POST to your configured URL

// contract.generated
{
  "event": "contract.generated",
  "app_id": "APP_ID",
  "contract_id": "CONTRACT_ID",
  "template_slug": "nda",
  "timestamp": "2026-01-15T10:30:00Z",
  "data": {
    "content_length": 4500,
    "tokens_used": 1200,
  }
}

// contract.signed
{
  "event": "contract.signed",
  "app_id": "APP_ID",
  "contract_id": "CONTRACT_ID",
  "timestamp": "2026-01-15T11:00:00Z",
  "data": {
    "signed_by": "[email protected]",
  }
}

Webhook Security

Each webhook includes an X-SignetX-Signature header containing an HMAC-SHA256 signature of the payload using your developer key. Always verify this signature on your server.

API Explorer

Try the SignetX API directly from your browser. Enter your developer key and send a live request.

Note: Requests are sent from your browser to the SignetX API. Make sure your app has an active AI provider key configured in the dashboard for generation to work.

Error Codes

The API uses standard HTTP status codes.

CodeMeaning
400Bad request — missing or invalid parameters
401Unauthorized — invalid or missing X-Developer-Key
403Forbidden — template not allowed for your app
429Rate limited — daily request limit exceeded
500Server error — AI generation failed
503AI provider unavailable — check your API key

Error Response Format

{
  "error": {
    "code": "rate_limited",
    "message": "Daily request limit of 100 exceeded. Resets at midnight UTC.",
    "details": {
      "limit": 100,
      "used": 100,
      "resets_at": "2026-01-16T00:00:00Z"
    }
  }
}
SignetX — AI-Powered Contract Generator