Documentation Index Fetch the complete documentation index at: https://docs.docinject.com/llms.txt
Use this file to discover all available pages before exploring further.
Use these endpoints to build and modify documents programmatically. A document is a container — you create it first, then add sections, steps, and sub-steps as nodes to build out the content hierarchy.
You can only delete documents that have status: "draft". Published and archived documents cannot be deleted through the API.
Create a document
POST https://api.docinject.io/api/v1/documents
Creates a blank draft document. After creation, add nodes using the node endpoints to build the content.
Request body
Version label for this document, for example 1.0 or Q3-2025.
Department or team this document belongs to.
Example request
curl -X POST "https://api.docinject.io/api/v1/documents" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Incident Response Playbook",
"version": "1.0",
"department": "Engineering"
}'
Response
Returns 201 Created with the new document object.
{
"id" : "doc_01hzab1c2d3e4f5g6h7j8k9l" ,
"organization_id" : "org_01habcdefghijklmnopqrstu" ,
"created_by" : "usr_01ha1b2c3d4e5f6g7h8i9j0k" ,
"editor_id" : null ,
"parent_doc_id" : null ,
"title" : "Incident Response Playbook" ,
"version" : "1.0" ,
"department" : "Engineering" ,
"status" : "draft" ,
"published_at" : null ,
"created_at" : "2025-05-24T11:00:00.000Z" ,
"updated_at" : "2025-05-24T11:00:00.000Z" ,
"nodes" : []
}
Update a document
PATCH https://api.docinject.io/api/v1/documents/{doc_id}
Updates the metadata of an existing document. Send only the fields you want to change.
When updating a revision draft, the new version must differ from the version of the document it was revised from. The API returns 400 Bad Request if the values match.
Path parameters
The ID of the document to update.
Request body
New department or team name.
Example request
curl -X PATCH "https://api.docinject.io/api/v1/documents/doc_01hzab1c2d3e4f5g6h7j8k9l" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"version": "1.1", "department": "Platform Engineering"}'
Response
Returns 200 OK with the updated document object.
{
"id" : "doc_01hzab1c2d3e4f5g6h7j8k9l" ,
"organization_id" : "org_01habcdefghijklmnopqrstu" ,
"created_by" : "usr_01ha1b2c3d4e5f6g7h8i9j0k" ,
"editor_id" : null ,
"parent_doc_id" : null ,
"title" : "Incident Response Playbook" ,
"version" : "1.1" ,
"department" : "Platform Engineering" ,
"status" : "draft" ,
"published_at" : null ,
"created_at" : "2025-05-24T11:00:00.000Z" ,
"updated_at" : "2025-05-24T12:30:00.000Z" ,
"nodes" : []
}
Delete a document
DELETE https://api.docinject.io/api/v1/documents/{doc_id}
Permanently deletes a draft document. This action cannot be undone.
Path parameters
The ID of the document to delete.
Example request
curl -X DELETE "https://api.docinject.io/api/v1/documents/doc_01hzab1c2d3e4f5g6h7j8k9l" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
Returns 204 No Content on success. Returns 400 Bad Request if the document is not in draft status.
Add a node
POST https://api.docinject.io/api/v1/documents/{doc_id}/nodes
Adds a section, step, or sub-step to a document. Nodes follow a strict hierarchy: sections are top-level, steps are children of sections, and sub-steps are children of steps.
node_typeRequired parent_id Must be a child of sectionNone — omit parent_id — stepRequired A section node sub_stepRequired A step node
Path parameters
The ID of the document to add the node to.
Request body
Type of node to create. One of section, step, or sub_step.
Sort position among sibling nodes. Lower values appear first.
ID of the parent node. Required for step and sub_step node types. Must be omitted for section.
Example request
curl (section)
curl (step)
curl -X POST "https://api.docinject.io/api/v1/documents/doc_01hzab1c2d3e4f5g6h7j8k9l/nodes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"node_type": "section",
"title": "Detection and Triage",
"order": 1
}'
Response
Returns 201 Created with the new node object.
{
"id" : "node_01ha1b2c3d4e5f6g" ,
"document_id" : "doc_01hzab1c2d3e4f5g6h7j8k9l" ,
"parent_id" : null ,
"node_type" : "section" ,
"title" : "Detection and Triage" ,
"content" : null ,
"order" : 1 ,
"created_by" : "usr_01ha1b2c3d4e5f6g7h8i9j0k" ,
"created_at" : "2025-05-24T11:05:00.000Z" ,
"updated_at" : "2025-05-24T11:05:00.000Z" ,
"children" : []
}
Update a node
PATCH https://api.docinject.io/api/v1/documents/{doc_id}/nodes/{node_id}
Updates the title, content, or order of a node. Send only the fields you want to change.
Path parameters
The ID of the node to update.
Request body
Rich text content as structured JSON.
New sort position among sibling nodes.
Example request
curl -X PATCH "https://api.docinject.io/api/v1/documents/doc_01hzab1c2d3e4f5g6h7j8k9l/nodes/node_01ha1b2c3d4e5f6g" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Detection, Triage, and Escalation"}'
Response
Returns 200 OK with the updated node object.
Delete a node
DELETE https://api.docinject.io/api/v1/documents/{doc_id}/nodes/{node_id}
Deletes a node and all of its descendants. Deleting a section removes all steps and sub-steps beneath it.
Path parameters
The ID of the node to delete.
Example request
curl -X DELETE "https://api.docinject.io/api/v1/documents/doc_01hzab1c2d3e4f5g6h7j8k9l/nodes/node_01ha1b2c3d4e5f6g" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
Returns 204 No Content on success.
Reorder nodes
POST https://api.docinject.io/api/v1/documents/{doc_id}/nodes/reorder
Updates the order value of multiple nodes in a single request. Use this to reorder siblings after a drag-and-drop operation without making one request per node.
Path parameters
Request body
Array of node order updates. The ID of the node to update.
New sort position for this node.
Example request
curl -X POST "https://api.docinject.io/api/v1/documents/doc_01hzab1c2d3e4f5g6h7j8k9l/nodes/reorder" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"nodes": [
{ "node_id": "node_01ha1b2c3d4e5f6g", "order": 2 },
{ "node_id": "node_01hb2c3d4e5f6g7h", "order": 1 }
]
}'
Response
Returns 204 No Content on success.