Get a presigned URL for a direct file upload
First step of the direct file-upload flow. Issues a presigned S3 POST policy and records a pending upload.
Uploading a file takes three steps:
- Get a URL — call this endpoint. It returns
{ fileId, url, fields }. - Upload directly to S3 — send a
multipart/form-dataPOSTtourl. Include every key/value fromfieldsas form fields first, then the file itself as the last field namedfile. The upload goes straight to S3; it does not pass through this API. A successful upload returns HTTP204from S3. - Mark the upload complete — call
POST /api/files/upload-completewith thefileIdfrom step 1. This records the file and returns its download URL.
The presigned policy enforces the content type and a 1 byte–50 MB size
range. Both extension and contentType must be on the accepted lists.
attachEntityType is channel, aptlet, or knowledge, and
attachEntityId is the channel id, aptlet uuid, or knowledge doc id
respectively. The target must exist (scoped to your company) or the
request is rejected. The file is stored under that entity’s folder.
Authorizations
Body
Original file name.
"invoice.pdf"
File extension (lowercase, no dot). Must be an accepted extension.
"pdf"
File size in bytes. Must be 1–52428800 (50 MB).
20480
MIME type. Must be an accepted content type.
"application/pdf"
The kind of entity the file is attached to.
channel, aptlet, knowledge "channel"
The channel id (channel), aptlet uuid (aptlet), or knowledge doc id (knowledge) the file belongs to. Must exist within your company.
"7f3c2a1b9d4e5f6a7b8c9d0e"