Miscellaneous APIs
This page documents utility API endpoints for file operations.
Upload File
Upload a file to the Ema platform. The file is processed asynchronously.
| Property | Value |
|---|
| URL | /api/personas/{persona_id}/upload |
| HTTP Method | POST |
| Protocol | REST (multipart/form-data) |
| Header | Type | Required | Description |
|---|
Authorization | string | Yes | Bearer token |
Content-Type | string | Yes | multipart/form-data |
Path Parameters
| Parameter | Type | Description |
|---|
persona_id | string | UUID of the AI Employee |
| Field | Type | Required | Description |
|---|
file | file | Yes | The file to upload |
Example
curl -X POST https://your-instance.ema.co/api/personas/<persona_id>/upload \
-H "Authorization: Bearer <access_token>" \
-F "[email protected]"
Response
| Field | Type | Description |
|---|
file_id | string | UUID of the uploaded file |
status | string | Upload status |
Processing
Uploaded files are processed asynchronously. The processing pipeline may include:
- File format detection and validation
- Text extraction (for PDFs, documents, etc.)
- Indexing for search and retrieval
- Thumbnail generation (for images)
Get Pre-Signed URL
Generate a pre-signed URL for direct file download from cloud storage.
| Property | Value |
|---|
| URL | /api/personas/{persona_id}/get_presigned_url |
| HTTP Method | POST |
| Protocol | REST (HTTP/JSON) |
| Header | Type | Required | Description |
|---|
Authorization | string | Yes | Bearer token |
Content-Type | string | Yes | application/json |
Request Body
| Field | Type | Required | Description |
|---|
file_id | string | Yes | UUID of the file |
Example
curl -X POST https://your-instance.ema.co/api/personas/<persona_id>/get_presigned_url \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"file_id": "<file-uuid>"
}'
Response
| Field | Type | Description |
|---|
presigned_url | string | Time-limited URL for file download |
expires_at | string | ISO 8601 expiration timestamp |
The pre-signed URL grants temporary access to the file without requiring authentication. URLs typically expire after a short period (e.g., 15 minutes).