PlatformXeDocs
Get API Key

Documents

API reference for creating, managing, and organizing fixed-storage documents.

The Documents service provides fixed storage for structured documents -- contracts, identity documents, policies, invoices, and other files that need access control, versioning, and retention management. Unlike media storage (for images and transient files), fixed storage is designed for documents with compliance and governance requirements.

Base URL

All document endpoints are under /api/v1/storage/fixed/documents.

Scope: storage:read for reads, storage:upload for creates, storage:delete for deletes.

Create a document

POST /api/v1/storage/fixed/documents

Request body

FieldTypeRequiredDescription
titlestringYesDocument title
descriptionstringNoDocument description
categorystringYesDocument category (see categories below)
fileTypestringYesFile type: MD, PDF, DOCX, XLSX, IMAGE, or OTHER
spacestringYesPERSONAL or INTERNAL
folderIdstringNoID of the folder to place the document in
contentstringNoMarkdown content (for MD file type)
fileUrlstringNoURL of the uploaded file
fileNamestringNoOriginal filename
fileMimeTypestringNoMIME type of the file
fileSizenumberNoFile size in bytes
entityTypestringNoRelated entity type (e.g., BOOKING, PROPERTY)
entityIdstringNoRelated entity ID
accessLevelstringNoAccess level: SUPER_ADMIN, MANAGEMENT, FINANCE, HR, OPERATIONS, or ALL. Default: ALL
visibilitystringNoVisibility: PRIVATE, SHARED, or PORTAL. Default: PRIVATE
allowedGroupsstring[]NoGroups that can access this document
allowedEntitiesstring[]NoSpecific entity IDs with access
retentionTypestringNoNONE, STANDARD, EXTENDED, LEGAL, or PERMANENT. Default: STANDARD
retentionUntilstringNoISO 8601 date for retention expiry
deletableBystringNoWho can delete: OWNER, ADMIN, SUPER_ADMIN, or NONE

Document categories

IDENTITY_DOCUMENT, CONTRACT, INVOICE, RECEIPT, POLICY, REPORT, CERTIFICATE, LICENSE, INSURANCE, TAX_DOCUMENT, BANK_DOCUMENT, PAYSLIP, OFFER_LETTER, NDA, MEMO, TRAINING_MATERIAL, SOP, MEETING_NOTES, LEGAL, COMPLIANCE, OTHER

Response

{
  "success": true,
  "data": {
    "id": "doc_abc123",
    "title": "Employment Contract - Ade Bakare",
    "category": "CONTRACT",
    "fileType": "PDF",
    "space": "INTERNAL",
    "accessLevel": "HR",
    "visibility": "SHARED",
    "version": 1,
    "retentionType": "LEGAL",
    "deletableBy": "SUPER_ADMIN",
    "isLatest": true,
    "canDelete": false,
    "deletionRequiresOverride": true,
    "createdAt": "2026-04-05T10:00:00.000Z",
    "updatedAt": "2026-04-05T10:00:00.000Z"
  }
}

List documents

GET /api/v1/storage/fixed/documents

Query parameters

ParameterTypeDescription
ownerTypestringFilter by owner type: ADMIN, AGENT, PARTNER, SYSTEM
ownerIdstringFilter by owner ID
spacestringFilter by space: PERSONAL or INTERNAL
categorystringFilter by document category
fileTypestringFilter by file type
visibilitystringFilter by visibility
folderIdstringFilter by folder
searchstringFull-text search on title and description
pagenumberPage number (default: 1)
limitnumberResults per page (default: 20, max: 100)

Response

{
  "success": true,
  "data": {
    "documents": [...],
    "total": 42,
    "page": 1,
    "limit": 20,
    "totalPages": 3
  }
}

Get a document

GET /api/v1/storage/fixed/documents/:documentId

Returns the full document record including metadata, access counts, and retention information.

Update a document

PATCH /api/v1/storage/fixed/documents/:documentId

Request body

FieldTypeDescription
titlestringUpdated title
descriptionstringUpdated description
categorystringUpdated category
contentstringUpdated markdown content (MD files)
accessLevelstringUpdated access level
visibilitystringUpdated visibility
retentionTypestringUpdated retention type
retentionUntilstringUpdated retention expiry
isArchivedbooleanArchive or unarchive the document

All fields are optional. Only provided fields are updated.

Delete a document

DELETE /api/v1/storage/fixed/documents/:documentId

Performs a soft delete. Documents with deletableBy: "NONE" or restricted deletableBy settings may require a deletion override before deletion is permitted.

Examples

Create a contract document

curl

curl -X POST https://api.platformxe.com/api/v1/storage/fixed/documents \
  -H "Content-Type: application/json" \
  -H "x-api-key: pxk_live_your_api_key_here" \
  -d '{
    "title": "Employment Contract - Ade Bakare",
    "category": "CONTRACT",
    "fileType": "PDF",
    "space": "INTERNAL",
    "fileUrl": "https://cdn.platformxe.com/org_123/contracts/ade-bakare.pdf",
    "fileName": "ade-bakare-contract.pdf",
    "fileMimeType": "application/pdf",
    "fileSize": 245760,
    "accessLevel": "HR",
    "visibility": "SHARED",
    "retentionType": "LEGAL",
    "deletableBy": "SUPER_ADMIN"
  }'

TypeScript SDK

import { PlatformXe } from '@caldera/platformxe-sdk';

const px = new PlatformXe({ apiKey: 'pxk_live_your_api_key_here' });

const doc = await px.documents.create({
  title: 'Employment Contract - Ade Bakare',
  category: 'CONTRACT',
  fileType: 'PDF',
  space: 'INTERNAL',
  fileUrl: 'https://cdn.platformxe.com/org_123/contracts/ade-bakare.pdf',
  fileName: 'ade-bakare-contract.pdf',
  fileMimeType: 'application/pdf',
  fileSize: 245760,
  accessLevel: 'HR',
  visibility: 'SHARED',
  retentionType: 'LEGAL',
  deletableBy: 'SUPER_ADMIN',
});

console.log(doc.id);
// "doc_abc123"

Python SDK

from platformxe import PlatformXe

px = PlatformXe(api_key="pxk_live_your_api_key_here")

doc = px.documents.create({
    "title": "Employment Contract - Ade Bakare",
    "category": "CONTRACT",
    "fileType": "PDF",
    "space": "INTERNAL",
    "fileUrl": "https://cdn.platformxe.com/org_123/contracts/ade-bakare.pdf",
    "accessLevel": "HR",
    "visibility": "SHARED",
    "retentionType": "LEGAL",
    "deletableBy": "SUPER_ADMIN"
})

List documents in a folder

const result = await px.documents.list({
  folderId: 'fld_contracts',
  category: 'CONTRACT',
  page: 1,
  limit: 50,
});

console.log(result.total);
// 12

Search documents

curl "https://api.platformxe.com/api/v1/storage/fixed/documents?search=employment&category=CONTRACT" \
  -H "x-api-key: pxk_live_your_api_key_here"

Update access level

await px.documents.update('doc_abc123', {
  accessLevel: 'MANAGEMENT',
  visibility: 'PORTAL',
});

Error responses

CodeDescription
BAD_REQUESTMissing required fields or invalid category/file type
NOT_FOUNDDocument does not exist or has been deleted
FORBIDDENAPI key lacks required scope or access level is insufficient
DELETION_REQUIRES_OVERRIDEDocument cannot be deleted without an approved override
RATE_LIMITEDRate limit exceeded