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.

PropertyValue
URL/api/personas/{persona_id}/upload
HTTP MethodPOST
ProtocolREST (multipart/form-data)

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token
Content-TypestringYesmultipart/form-data

Path Parameters

ParameterTypeDescription
persona_idstringUUID of the AI Employee

Form Data

FieldTypeRequiredDescription
filefileYesThe 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

FieldTypeDescription
file_idstringUUID of the uploaded file
statusstringUpload 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.

PropertyValue
URL/api/personas/{persona_id}/get_presigned_url
HTTP MethodPOST
ProtocolREST (HTTP/JSON)

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token
Content-TypestringYesapplication/json

Request Body

FieldTypeRequiredDescription
file_idstringYesUUID 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

FieldTypeDescription
presigned_urlstringTime-limited URL for file download
expires_atstringISO 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).

Last updated: Jul 3, 2026