POST /messages
content_type
field determines the message format and required fields:
"content_type": "text"
)
content
fieldaudio/*, image/*, application/pdf, etc.
)
filename
fieldField | Type | Required | Description |
---|---|---|---|
conversation | string | Yes | ID of the conversation |
content | string | Conditional | Message text (required for text messages) |
content_type | string | Yes | Message format (see Supported Types) |
filename | string | Conditional | File path/name (required for media) |
metadata | object | No | Custom message data |
channel | string | No | Defaults to “api” |
Type | Content Type | Required Fields | Max Size | Description |
---|---|---|---|---|
Text | text | content | 4KB | Plain text messages |
Audio | audio/* | filename | 10MB | Voice messages, audio files |
Image | image/* | filename | 5MB | Photos and images |
application/pdf | filename | 10MB | PDF documents | |
Excel | application/xlsx | filename | 10MB | Excel spreadsheets |
CSV | text/csv | filename | 5MB | CSV data files |
200
: Message sent successfully400
: Validation error401
: Invalid or missing API key422
: Missing organization ID500
: Server errorPOST /media/presigned-url
Headers:
${PRESIGNED_URL}
with the URL received from Step 1, and adjust the file path to your local file
location.
File Type | Content Type | Storage Folder |
---|---|---|
Audio | audio/* | audio/ |
Image | image/* | images/ |
application/pdf | pdfs/ | |
Excel | application/xlsx | xlsx/ |
CSV | text/csv | csv/ |
YYYYMMDD_HHMMSS_original_filename
422
: Missing organization ID400
: Invalid file type or unsupported operation500
: Server error during URL generationmetadata
field in messages serves several critical functions:
workflow_instance_status
field:
Available Status Values
Status | Description |
---|---|
RUNNING | Workflow is actively executing tasks |
PAUSED | Workflow execution has been temporarily suspended |
COMPLETED | All tasks have successfully finished |
FAILED | Workflow stopped due to an error |
CANCELLED | Workflow was manually cancelled by user |
TERMINATED | Workflow stopped due to system intervention |
RUNNING
→ Any statusPAUSED
→ RUNNING
, CANCELLED
, TERMINATED
COMPLETED
(Terminal state)FAILED
(Terminal state)CANCELLED
(Terminal state)TERMINATED
(Terminal state)