Direct Upload Paths: Spec Compliance & Lambda Bypass
Direct Upload Paths: Spec Compliance & Lambda Bypass
Introduced in v0.1.72
Overview
The myProp specification requires that certain file uploads — generic document uploads and maintenance-request attachments — are posted directly to the AgentOS /v1/corporate/peopleportal/... API endpoints, bypassing the AWS Lambda intermediary layer entirely.
Prior to v0.1.72, the application was routing these uploads through tRPC and /v3/ document endpoints instead. This release corrects that deviation and aligns the upload implementation with the original specification.
Why Direct Uploads?
Lambda functions impose execution time limits that are incompatible with large or slow file uploads. The original spec accounts for this by defining direct HTTP upload paths with a dedicated 120-second timeout, giving uploads the headroom they need without worrying about Lambda cold-start or execution caps.
Affected Upload Endpoints
The following endpoints are now called directly from the client-side upload functions:
Generic Object Upload
POST {baseURL}/v1/corporate/peopleportal/letmcletting/{clientName}/uploads/generic/{objectOID}
Use case: Attaching documents to generic AgentOS objects (e.g. tenancies, properties, landlord records).
| Parameter | Location | Description |
|---|---|---|
clientName | Path | The agency's LetMC client name |
objectOID | Path | The OID of the target AgentOS object |
api_key | Header | Agency API key — must be a header, not a query param |
Maintenance Request Upload
POST {baseURL}/v1/corporate/peopleportal/{shortName}/{clientName}/uploads/{personID}/maintenance-request
Use case: Attaching photos or supporting documents to a maintenance request submitted by a tenant.
| Parameter | Location | Description |
|---|---|---|
shortName | Path | Agency short name |
clientName | Path | The agency's LetMC client name |
personID | Path | The ID of the person submitting the request |
api_key | Header | Agency API key — must be a header, not a query param |
Implementation Details
Location
All direct upload functions live in:
src/lib/letmc/document.ts
Request Configuration
// Example shape of a direct upload request
const response = await fetch(uploadUrl, {
method: 'POST',
headers: {
'api_key': apiKey, // ✅ Header — NOT a query parameter
'Content-Type': '...',
},
body: formData,
signal: AbortSignal.timeout(120_000), // 120-second timeout
});
Multi-File Staggering
When uploading multiple files in a single operation, a 500 ms delay is introduced between each file upload. This prevents request flooding on the AgentOS server.
for (const file of files) {
await uploadFile(file);
await delay(500); // stagger: 500ms between uploads
}
Authentication
⚠️ Important: The
api_keymust be passed as an HTTP request header, not as a URL query parameter.
Previous implementations (and some third-party AgentOS integrations) incorrectly appended ?api_key=... to the query string. This is not accepted by the direct upload endpoints and will result in an authentication failure.
Correct:
POST /v1/corporate/peopleportal/letmcletting/myagency/uploads/generic/abc123
api_key: your-api-key-here
Incorrect:
POST /v1/corporate/peopleportal/letmcletting/myagency/uploads/generic/abc123?api_key=your-api-key-here
Timeout Behaviour
All direct upload requests carry a 120-second timeout. If a request has not completed within this window, it will be aborted. Users should be notified of the failure so they can retry. Large files on slow connections should be accounted for in UX error messaging.