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. Create a developer account at /signup
- 2. Add your OpenAI or Anthropic API key in the dashboard (select your preferred model)
- 3. Create an app to get your
X-Developer-Key - 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.
/api/v1/generateGenerate 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| template_slug | string | Yes | Template to use (e.g. "nda", "msa") |
| fields | object | Yes | Key-value pairs for template variables |
| ai_provider | string | No | "openai" or "anthropic" (default: your active key) |
| format | string | No | "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 consumedExample (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
}
}/api/v1/templatesList 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"]
}
]
}/api/v1/contracts/:idRetrieve 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/:appIdEmbeddable 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
Event notificationsWebhooks
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 generatedcontract.signedFired when a contract is signed by a partycontract.updatedFired when a contract is edited or amendedapp.rate_limitedFired when your app hits its daily rate limitPayload 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.
| Code | Meaning |
|---|---|
| 400 | Bad request — missing or invalid parameters |
| 401 | Unauthorized — invalid or missing X-Developer-Key |
| 403 | Forbidden — template not allowed for your app |
| 429 | Rate limited — daily request limit exceeded |
| 500 | Server error — AI generation failed |
| 503 | AI 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"
}
}
}