Overview
Uploads a new document to the store at a specified path, creating a new document family or adding content to an existing one. This endpoint supports multipart file uploads with metadata.Endpoint
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
orgSlug | string | Yes | Organization slug |
slug | string | Yes | Store slug |
version | string | No | Store version (optional, uses current version if not specified) |
** | string | Yes | File path within the store (part of URL path) |
Form Data Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | Yes* | The file to upload |
document | file | No | Alternative document file parameter |
path | string | No | Override path from URL |
documentVersion | string | No | Version identifier for this document |
metadata | object | No | Additional metadata key-value pairs |
file or document parameter must be provided
Special Import Mode
If the path ends with.dfm, the endpoint will import a Kodexa Document Family format file instead of creating a new document.
Example Usage
Upload a PDF invoice
Upload with path parameter
Upload to specific version
Using Python SDK
Import a .dfm file
Response
Returns aDocumentFamily object containing:
Path Handling
The file path can be specified in two ways:-
URL Path: Include the path directly in the URL after
/fs/- Example:
/api/stores/my-org/invoices/fs/2024/invoice.pdf
- Example:
-
Query Parameter: Use the
pathparameter- Example:
/api/stores/my-org/invoices/fs?path=2024/invoice.pdf
- Example:
path parameter takes precedence.
Document Versioning
- Each upload creates a new
ContentObjectwithin theDocumentFamily - Use
documentVersionto label different versions - The latest content object becomes the active version
- Previous versions are preserved for audit history
Metadata
Custom metadata can be attached during upload:- Passed as form data with
metadata[key]=valueformat - Stored with the document family
- Searchable and retrievable with the document
- Useful for categorization, classification, and filtering
Content Type Detection
The content type is automatically detected from:- File extension
- File content analysis (if extension is missing)
- Falls back to
application/octet-stream
Error Responses
- 400 Bad Request: Missing required file parameter
- 404 Not Found: Store or version not found
- 413 Payload Too Large: File exceeds size limits
- 415 Unsupported Media Type: Invalid file type for store configuration
