Download OpenAPI specification:
The Pactly Public API provides programmatic access to contract lifecycle management capabilities, enabling integration with your existing systems. Key features include:
• Contract Management: Create, retrieve, update, and search contracts across your organization • Template Operations: Access and manage contract templates for consistent document generation • Document Generation: Generate contracts from templates with dynamic variable substitution • Text Extraction: Extract and analyze text content from contracts and documents • Workflow Automation: Trigger workflows and track contract lifecycle events
The API follows RESTful principles and returns JSON responses. All endpoints require authentication via API key.
Operations related to contract management including creation, retrieval, updates, and text extraction
Retrieve a paginated list of contracts accessible to the authenticated user. Supports filtering by type, status, and date ranges.
| createdAfter | string <date-time> Only return contracts created after this date (ISO 8601) |
| createdBefore | string <date-time> Only return contracts created before this date (ISO 8601) |
| updatedAfter | string <date-time> Only return contracts updated after this date (ISO 8601) |
| updatedBefore | string <date-time> Only return contracts updated before this date (ISO 8601) |
| status | integer [ 1 .. 6 ] Filter by status code: 1=Draft, 2=In Negotiation, 3=Pending Approval, 4=Pending Signature, 5=Executed, 6=Terminated |
{- "contracts": [
- {
- "id": "507f1f77bcf86cd799439011",
- "type": "template",
- "name": "Software License Agreement - Acme Corp",
- "reference": "SLA-2024-001",
- "createdAt": "2024-01-15T10:30:00Z",
- "updatedAt": "2024-01-20T14:45:00Z",
- "status": "executed"
}, - {
- "id": "507f1f77bcf86cd799439014",
- "type": "playbook",
- "name": "Service Agreement - Beta Inc",
- "reference": "SA-2024-002",
- "createdAt": "2024-01-16T09:00:00Z",
- "updatedAt": "2024-01-18T11:30:00Z",
- "status": "draft"
}
]
}Generate a new contract from a template.
values is a flat map keyed by the variable, valuemap and party ids from GET /v1/templates/{id}: a scalar for a variable, the chosen label (an array of labels for a multi-selection valuemap) for a valuemap, and an object of the declared attributes for a party. An unknown key, a wrong type, an unknown label or a missing required value is a 400 naming what is wrong. A value that is not supplied renders as [●].
options.persist (default true) decides whether Pactly keeps the contract. Persisted contracts are returned as a record you then fetch with GET /v1/contracts/{id}/download; ephemeral ones ("persist": false) keep nothing — no contract, no file, no audit event — and the document comes back base64-encoded in the response.
options.triggerWorkflows defaults to the value of persist and sends real email to real people, so turn it off for a bulk import. It cannot be enabled without persisting: a workflow has no contract to act on.
| templateId required | string^[0-9a-fA-F]{24}$ Template to generate from |
| contractName | string <= 256 characters Default: "Pactly contract" Name for the generated contract |
object Flat map keyed by the ids from GET /v1/templates/{id}. A variable takes a value of its declared valueType — a string for text (numbers are rejected, not coerced), a real boolean for boolean. A valuemap takes the chosen label — an array of labels when allowMultipleSelection is true, a single label when it is not. A party takes an object of its declared attributes, plus "type" ("entity" or "individual") when the template leaves the party type "unknown". Anything omitted renders as [●]. | |
object |
{- "templateId": "string",
- "contractName": "Pactly contract",
- "values": {
- "SupplierName": "Acme Pte Ltd",
- "Term": 24,
- "Agency": false,
- "ContractingEntity": "Singapore - Acme Holdings",
- "party1": {
- "entityName": "Acme Pte Ltd",
- "entityRegNo": "196800306E",
- "country": "Singapore",
- "address": "1 Raffles Place, Singapore 048616"
}
}, - "options": {
- "persist": true,
- "triggerWorkflows": true,
- "reference": "string"
}
}{- "persisted": true,
- "id": "string",
- "name": "string",
- "reference": "string",
- "template": "string",
- "company": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "effectiveDate": "2019-08-24T14:15:22Z",
- "values": { }
}Retrieve detailed information about a specific contract including all properties, metadata, and status information.
| id required | string Route pattern variable |
{- "id": "507f1f77bcf86cd799439011",
- "type": "template",
- "name": "Software License Agreement - Acme Corp",
- "reference": "SLA-2024-001",
- "status": "executed",
- "createdAt": "2024-01-15T10:30:00Z",
- "updatedAt": "2024-01-20T14:45:00Z",
- "finalizedAt": "2024-01-20T14:45:00Z",
- "executedAt": "2024-01-20T15:00:00Z",
- "executionMethod": "docusign",
- "archived": false,
- "deleted": false,
- "aborted": false,
- "final": true,
- "hubRequestStatus": "completed",
- "properties": {
- "licenseType": {
- "value": "Enterprise",
- "meta": {
- "name": "License Type",
- "description": "Type of software license",
- "type": "select",
- "group": "License Details"
}
}, - "effectiveDate": {
- "value": "2024-02-01",
- "meta": {
- "name": "Effective Date",
- "description": "When the license becomes active",
- "type": "date",
- "group": "License Details"
}
}
}, - "user": "507f1f77bcf86cd799439012",
- "template": "507f1f77bcf86cd799439013"
}Extract and return the full text content of a contract. Useful for search, analysis, and AI processing.
| id required | string^[0-9a-fA-F]{24}$ Contract ID (MongoDB ObjectId format) |
{- "contractId": "507f1f77bcf86cd799439011",
- "name": "Software License Agreement - Acme Corp",
- "text": [
- "SOFTWARE LICENSE AGREEMENT",
- "This Software License Agreement (\"Agreement\") is entered into as of February 1, 2024",
- "between Acme Corporation (\"Licensor\") and Beta Inc (\"Licensee\").",
- "",
- "1. GRANT OF LICENSE",
- "Subject to the terms and conditions of this Agreement, Licensor hereby grants to Licensee",
- "a non-exclusive, non-transferable Enterprise license to use the Software."
]
}Retrieve all available contract templates that can be used to create new contracts.
[- {
- "id": "507f1f77bcf86cd799439013",
- "name": "Software License Agreement Template",
- "version": "2.1.0",
- "description": "Standard template for software licensing agreements with customizable terms",
- "createdAt": "2023-06-15T08:00:00Z",
- "variables": [
- {
- "name": "companyName",
- "type": "text",
- "required": true,
- "description": "Name of the licensing company"
}, - {
- "name": "licenseType",
- "type": "select",
- "options": [
- "Basic",
- "Professional",
- "Enterprise"
], - "required": true
}
], - "valuemaps": [
- {
- "name": "pricingTiers",
- "values": {
- "Basic": "$99/month",
- "Professional": "$299/month",
- "Enterprise": "Custom pricing"
}
}
]
}
]Retrieve detailed information about a specific template including variables and value mappings.
| id required | string^[0-9a-fA-F]{24}$ Template ID (MongoDB ObjectId format) |
{- "id": "507f1f77bcf86cd799439013",
- "name": "Software License Agreement Template",
- "version": "2.1.0",
- "description": "Standard template for software licensing agreements with customizable terms",
- "createdAt": "2023-06-15T08:00:00Z",
- "variables": [
- {
- "name": "companyName",
- "type": "text",
- "required": true,
- "description": "Name of the licensing company"
}, - {
- "name": "licenseType",
- "type": "select",
- "options": [
- "Basic",
- "Professional",
- "Enterprise"
], - "required": true
}
], - "valuemaps": [
- {
- "name": "pricingTiers",
- "values": {
- "Basic": "$99/month",
- "Professional": "$299/month",
- "Enterprise": "Custom pricing"
}
}
]
}List all emails associated with contracts (for AI training)
| pagesize | integer Default: 100 Number of emails to return |
| cursor | string Cursor for pagination |
| contractType | string Enum: "template" "playbook" "external" Filter by contract type |
| contractId | string Filter by specific contract ID |
| sender | string Filter by sender email |
| dateFrom | string <date> Filter emails from this date |
| dateTo | string <date> Filter emails until this date |
{- "emails": [
- {
- "id": "string",
- "subject": "string",
- "sender": "string",
- "recipient": "string",
- "body": "string",
- "bodyPlainText": "string",
- "contract": { },
- "attachments": [ ]
}
], - "pagination": {
- "pageSize": 0,
- "hasMore": true,
- "cursor": "string",
- "total": 0
}
}Retrieve all contract property definitions available to the company, including system default properties.
{- "properties": [
- {
- "id": "string",
- "key": "string",
- "label": "string",
- "description": "string",
- "type": "string",
- "options": { },
- "group": "string",
- "subGroup": "string",
- "sortOrder": 0,
- "isDefault": true,
- "manualOnly": true
}
]
}Retrieve a single property definition by its ID or unique key.
| idOrKey required | string Property ID (MongoDB ObjectId) or property key |
{- "id": "string",
- "key": "string",
- "label": "string",
- "description": "string",
- "type": "string",
- "options": { },
- "group": "string",
- "subGroup": "string",
- "sortOrder": 0,
- "isDefault": true,
- "manualOnly": true
}Retrieve all contract categories available to the company, including system default categories.
{- "categories": [
- {
- "id": "string",
- "label": "string",
- "abbreviation": "string",
- "description": "string",
- "isDefault": true
}
]
}