Documents
Business+Generate and manage documents.
Required scopes:
documents
Feature flag:
documents
Endpoints
GET
/api/v1/documents
List all documents
GET
/api/v1/documents/{id}
Retrieve a single document
POST
/api/v1/documents
Generate a new document
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
| Parameter | Type | Required | Description |
|---|---|---|---|
entity_type
|
string | Yes | Entity type for the document (required) |
entity_id
|
integer | Yes | Entity ID for the document (required) |
template_id
|
integer | No | Document template ID (required if no category_id) |
category_id
|
integer | No | Document category ID (required if no template_id) |
metadata
|
object | No | Additional metadata as key-value pairs |
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 "Content-Type: 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,
'Content-Type: application/json',
],
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
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}`,
'Content-Type': 'application/json',
},
});
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}',
'Content-Type': 'application/json',
}
response = requests.get(f'{base_url}/api/v1/documents', headers=headers)
data = response.json()
print(data)
Sample Response
200 OK
{
"data": {
"document_id": 1,
"created_at": 1704067200,
"updated_at": 1704067200
},
"meta": {
"request_id": "req_abc123"
}
}