Files
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-data POST to url. Include every key/value from fields as form fields first, then the file itself as the last field named file. The upload goes straight to S3; it does not pass through this API. A successful upload returns HTTP 204 from S3.
- Mark the upload complete — call POST /api/files/upload-complete with the fileId from 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, knowledge, or template, and attachEntityId is the channel id, aptlet uuid, knowledge doc id, or communication template id respectively. The target must exist (scoped to your company) or the request is rejected. The file is stored under that entity's folder.
post/api/files/upload-url
Request
- Base URLhttps://core-api.getaptly.com
- Auth
- API key in header x-token
- or API key in header Authorization
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"name": "invoice.pdf",
"extension": "pdf",
"size": 20480,
"contentType": "application/pdf",
"attachEntityType": "channel",
"attachEntityId": "7f3c2a1b9d4e5f6a7b8c9d0e"
}Response
Presigned upload policy.
Changes
No recorded changes to this operation across all 1 revision of this API.