Pactly Public API (0.2.0)

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.

Contracts

Operations related to contract management including creation, retrieval, updates, and text extraction

List all contracts

Retrieve a paginated list of contracts accessible to the authenticated user. Supports filtering by type, status, and date ranges.

Authorizations:
ApiKeyAuth
query Parameters
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

Responses

Response samples

Content type
application/json
{
  • "contracts": [
    ]
}

Generate contract

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.

Authorizations:
ApiKeyAuth
Request Body schema: application/json
required
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

Responses

Request samples

Content type
application/json
{
  • "templateId": "string",
  • "contractName": "Pactly contract",
  • "values": {
    },
  • "options": {
    }
}

Response samples

Content type
application/json
Example
{
  • "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": { }
}

Get contract details

Retrieve detailed information about a specific contract including all properties, metadata, and status information.

Authorizations:
ApiKeyAuth
path Parameters
id
required
string

Route pattern variable id

Responses

Response samples

Content type
application/json
{
  • "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": {
    },
  • "user": "507f1f77bcf86cd799439012",
  • "template": "507f1f77bcf86cd799439013"
}

Extract contract text

Extract and return the full text content of a contract. Useful for search, analysis, and AI processing.

Authorizations:
ApiKeyAuth
path Parameters
id
required
string^[0-9a-fA-F]{24}$

Contract ID (MongoDB ObjectId format)

Responses

Response samples

Content type
application/json
{
  • "contractId": "507f1f77bcf86cd799439011",
  • "name": "Software License Agreement - Acme Corp",
  • "text": [
    ]
}

Download contract

Download a contract file by ID

Authorizations:
ApiKeyAuth
path Parameters
id
required
string^[0-9a-fA-F]{24}$

Contract ID (MongoDB ObjectId format)

Responses

Response samples

Content type
application/json
{
  • "error": "Bad Request",
  • "message": "Invalid contract ID format"
}

Templates

Manage contract templates that serve as the foundation for generating new contracts

List all templates

Retrieve all available contract templates that can be used to create new contracts.

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get template details

Retrieve detailed information about a specific template including variables and value mappings.

Authorizations:
ApiKeyAuth
path Parameters
id
required
string^[0-9a-fA-F]{24}$

Template ID (MongoDB ObjectId format)

Responses

Response samples

Content type
application/json
{
  • "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": [
    ],
  • "valuemaps": [
    ]
}

Emails

Email-related operations

List contract emails

List all emails associated with contracts (for AI training)

Authorizations:
ApiKeyAuth
query Parameters
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

Responses

Response samples

Content type
application/json
{
  • "emails": [
    ],
  • "pagination": {
    }
}

Properties

Contract property definitions that define the metadata fields available on contracts

List property definitions

Retrieve all contract property definitions available to the company, including system default properties.

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "properties": [
    ]
}

Get property definition

Retrieve a single property definition by its ID or unique key.

Authorizations:
ApiKeyAuth
path Parameters
idOrKey
required
string

Property ID (MongoDB ObjectId) or property key

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "key": "string",
  • "label": "string",
  • "description": "string",
  • "type": "string",
  • "options": { },
  • "group": "string",
  • "subGroup": "string",
  • "sortOrder": 0,
  • "isDefault": true,
  • "manualOnly": true
}

Categories

Contract categories used to classify and organize contracts

List categories

Retrieve all contract categories available to the company, including system default categories.

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "categories": [
    ]
}

Test endpoint

Test endpoint to test API connectivity and authentication

Authorizations:
ApiKeyAuth

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}