Documents
Business+Generate and manage documents.
Endpoints
/api/v1/documents
List all documents
/api/v1/documents/{id}
Retrieve a single document
/api/v1/documents
Generate a new document
/api/v1/documents/{id}
Change a document: content (HTML, sanitised like the editor), metadata and, for contracts, the contract status. Locked documents (signed, sent for signature, active contract) only allow the permitted status steps (e.g. active -> terminated), otherwise 409
/api/v1/documents/{id}
Delete a document like in the admin (open billable items of its line items are voided, a replaced booth fee is restored). Locked documents: 409
/api/v1/documents/{id}/pdf
Download the document as PDF. variant=auto (default) returns the signed PDF of an e-signed contract when it exists, else the generated PDF; variant=signed or variant=generated forces one. The X-Document-Variant header tells which one you got
Query Parameters
| Parameter | Description |
|---|---|
entity_type
|
Filter by entity type |
entity_id
|
Filter by entity ID |
category_id
|
Filter by document category ID |
is_contract
|
Filter by contract status (0 or 1) |
contract_status
|
Filter by contract status value |
esign_status
|
Filter by e-signature status |
sort
|
Sort field (document_number, created_at, updated_at, contract_status, esign_status) |
order
|
Sort direction (ASC or DESC, default: DESC) |
include
|
Include related data (line_items) |
Request Schema
Create (POST)
| Parameter | Type | Required | Description |
|---|---|---|---|
entity_type
|
string | Yes | Entity type for the document (required; currently only event_participant) |
entity_id
|
integer | Yes | Entity ID for the document (required; a record that does not exist returns 404) |
template_id
|
integer | No | Document template ID (required if no category_id). Exactly this active template is used; if category_id is sent as well, the template must belong to that category |
category_id
|
integer | No | Document category ID (required if no template_id). Without template_id, the first template whose conditions match is used, otherwise the default template |
metadata
|
object | No | Additional metadata as key-value pairs |
Update (PATCH)
| Parameter | Type | Required | Description |
|---|---|---|---|
content
|
string | No | New content as HTML (disallowed elements such as scripts are removed; empty content: 422). Only for documents that are not locked |
metadata
|
object|null | No | Additional data as a JSON object (at most 64 KB); null removes it. Only for documents that are not locked |
contract_status
|
string | No | Contract status (draft, pending_signature, active, terminated); contracts only. On locked contracts only the permitted steps; the 409 answer lists them in "allowed" |
Response Schema
| Field | Type |
|---|---|
id
|
integer |
category_id
|
integer|null |
category_name
|
string|null |
document_number
|
string|null |
entity_type
|
string|null |
entity_id
|
integer|null |
template_id
|
integer|null |
content
|
string |
metadata
|
object|null |
esign_status
|
string |
is_contract
|
boolean |
contract_status
|
string|null |
created_at
|
string |
updated_at
|
string |
Code Examples
curl -X GET "https://your-tenant.plandocket.com/api/v1/documents" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
<?php
$apiKey = 'YOUR_API_KEY';
$baseUrl = 'https://your-tenant.plandocket.com';
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $baseUrl . '/api/v1/documents',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
],
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
const apiKey = 'YOUR_API_KEY';
const baseUrl = 'https://your-tenant.plandocket.com';
const response = await fetch(`${baseUrl}/api/v1/documents`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
},
});
const data = await response.json();
console.log(data);
import requests
api_key = 'YOUR_API_KEY'
base_url = 'https://your-tenant.plandocket.com'
headers = {
'Authorization': f'Bearer {api_key}',
}
response = requests.get(f'{base_url}/api/v1/documents', headers=headers)
data = response.json()
print(data)
Sample Response
{
"data": [
{
"id": 1,
"category_id": 1,
"category_name": "string",
"document_number": "string",
"entity_type": "string",
"entity_id": 1,
"template_id": 1,
"content": "string",
"metadata": {},
"esign_status": "string",
"is_contract": true,
"contract_status": "string",
"created_at": "2026-01-15T10:00:00+01:00",
"updated_at": "2026-01-15T10:00:00+01:00"
}
],
"meta": {
"current_page": 1,
"per_page": 25,
"total": 1,
"total_pages": 1
}
}