PUT
/Document/File
When to Use
- Replace member statements with corrected information
- Update KYC/AML documentation with renewed identification
- Replace trust deeds, corporate constitutions, or investment mandates with updated versions
- Convert draft documents to final versions
Prerequisites
- Target document must have existing file content (use POST /Document/File for initial uploads)
Considerations
- PUT completely replaces existing file content with no version history
- Previous file version is permanently removed and cannot be recovered
- System creates comprehensive audit records including replacement reason and user authorization
- Replacement files undergo complete security scanning
Description
Replaces the existing file content of a document record with new binary file data. This operation completely overwrites the previous file content and updates the document metadata with new file information.
Secure File Replacement & Version Control Process
- Document & Permission Validation: System verifies document exists, has current file content, user has modification permissions, and document is not under legal hold restrictions
- Comprehensive Security Scanning: Replacement file undergoes virus scanning, malware detection, content analysis, and format validation using enterprise security infrastructure
- Audit Trail Creation: Complete audit record created including original file metadata, replacement justification, user authorization, and timestamp before any changes
- Secure Content Replacement: Previous file securely deleted from encrypted storage, replacement file stored with AES-256 encryption, and metadata updated with new file characteristics
- Post-Replacement Validation: System validates successful storage, updates access permissions, triggers any required notifications, and confirms audit trail completion
⚠️ Permanent Operation: File replacement is irreversible. Previous versions cannot be recovered. Ensure proper authorization and backup procedures before replacement.
POST vs PUT Behavior: Unlike POST /Document/File (which performs upsert: update OR create), PUT strictly requires an existing document record and performs update-only operations. Use POST for initial uploads or when document existence is uncertain; use PUT for explicit file replacement when you need guaranteed update-only semantics.
Required Headers - See Authentication
| Header | Value | Description |
|---|---|---|
| Content-Type | multipart/form-data | Request content type for file uploads |
| Authorization | {accessToken} | Bearer token for API access |
| Version | 2.0 | API version identifier |
Request Body (multipart/form-data)
| Parameter | Type | Required | Description |
|---|---|---|---|
DocumentID |
integer | The native 7G identifier for the document record with existing file content to replace. | |
ExternalDocumentId |
string | Your external system identifier for the document record with existing file content to replace. | |
file |
binary | The binary file content to replace the existing file. Supports various formats depending on document type and system configuration. |
DocumentID
The native 7G identifier for the document record with existing file content to replace.
ExternalDocumentId
Your external system identifier for the document record with existing file content to replace.
file
The binary file content to replace the existing file. Supports various formats depending on document type and system configuration.
🔒 Compliance & Risk Management
- Permanent Replacement: Previous file versions are permanently deleted and cannot be recovered through API or system recovery
- Regulatory Impact: Replacing compliance documents may require regulatory notification and member disclosure per Australian financial services law
- Audit Requirements: Complete audit trail maintained for 7+ years including replacement reason, authorization, and business impact assessment
- Privacy Obligations: Replacement files inherit Privacy Act 1988 obligations - ensure appropriate data handling and security measures
Example Requests
bash
# Replace file in document by ID
curl -X PUT 'https://api.7g.com.au/Document/File' \
-H "Authorization: {accessToken}" \
-H "Version: 2.0" \
-F "DocumentID=12345" \
-F "file=@/path/to/updated_statement.pdf"
# Replace file in document by external ID
curl -X PUT 'https://api.7g.com.au/Document/File' \
-H "Authorization: {accessToken}" \
-H "Version: 2.0" \
-F "ExternalDocumentId=INV-STMT-2024-001" \
-F "file=@/path/to/corrected_document.pdf"Response Examples
json
{
"result": true,
"message": "File uploaded successfully",
"recordCount": 1,
"data": {
"documentID": 12345,
"externalDocumentId": null,
"documentTypeID": 1,
"name": "Investor Statement Q4 2024",
"code": "INV-STMT-Q4-2024",
"description": "Quarterly investment statement (corrected)",
"password": null,
"ordinal": 1,
"productID": 100,
"externalProductId": null,
"bizEntityID": 5678,
"externalBizEntityId": null,
"organisationID": null,
"externalOrganisationId": null,
"showInDocumentsInPortal": true,
"isPublic": false
}
}