Skip to main content
View as Markdown

Send Messages - Messaging

Send Messages​

6.1 Send to Individual Users​

POST /api/v1/message/send
Content-Type: application/json
Authorization: Bearer <KS>
{
"receiverType": "user",
"userIds": ["user1@example.com", "user2@example.com"],
"appGuid": "app-guid-from-registry",
"templateId": "template-id",
"type": "email",
"msgParams": {
"recipient": {"type": "User", "value": "Message.userId"},
"eventName": {"type": "String", "value": "Annual Conference 2025"},
"joinLink": {
"type": "MagicLink",
"value": {
"baseURL": "https://events.example.com/join",
"expiry": 48,
"privileges": "actionslimit:2"
}
}
},
"session": "invitation-batch-2025-q4"
}
FieldTypeRequiredDescription
receiverTypestringYes"user" or "group"
userIdsstring[]If userKaltura user IDs (email-based)
groupIdsstring[]If groupGroup IDs to send to
appGuidstringYesApp Registry GUID
templateIdstringYesEmail template ID
typestringYes"email"
msgParamsobjectYesToken values — name → {type, value}
sessionstringNoGrouping label for tracking (e.g., "weekly-digest")
adminTagsstringNoComma-separated tags
attachmentsarrayNoEmail attachments (see section 6.3)
customHeadersobjectNoCustom email headers (overrides template headers)

The msgParams map provides runtime values for each token defined in the template's msgParamsMap. For User type tokens, set value to "Message.userId" to auto-resolve from each recipient's Kaltura profile.

Response example:

{
"id": "6621a3f0b2c4d5e6f7890abc",
"bulkId": "bulk_6621a3f0",
"partnerId": 123456,
"appGuid": "app-guid-from-registry",
"templateId": "template-id",
"type": "email",
"receiverType": "user",
"status": "sending",
"session": "invitation-batch-2025-q4",
"createdAt": "2026-04-09T12:00:00.000Z",
"updatedAt": "2026-04-09T12:00:00.000Z"
}

The response returns a bulk message object. The id is the internal message ID and bulkId is the external tracking identifier used with message/stats and message/list. The status starts as "sending" and transitions through the lifecycle described in section 7.

curl -X POST "$KALTURA_MESSAGING_URL/message/send" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{
"receiverType": "user",
"userIds": ["attendee@example.com"],
"appGuid": "'$APP_GUID'",
"templateId": "'$TEMPLATE_ID'",
"type": "email",
"msgParams": {
"recipient": {"type": "User", "value": "Message.userId"},
"eventName": {"type": "String", "value": "Q4 Town Hall"}
}
}'

6.2 Send to Groups​

Set receiverType to "group" and provide groupIds instead of userIds:

curl -X POST "$KALTURA_MESSAGING_URL/message/send" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{
"receiverType": "group",
"groupIds": ["all-employees"],
"appGuid": "'$APP_GUID'",
"templateId": "'$TEMPLATE_ID'",
"type": "email",
"msgParams": {
"recipient": {"type": "User", "value": "Message.userId"},
"eventName": {"type": "String", "value": "Company All-Hands"}
}
}'

6.3 Attachments​

Include file attachments with Base64-encoded content:

{
"attachments": [
{
"fileName": "agenda.pdf",
"content": "JVBERi0xLjQKJcfs...",
"mimeType": "application/pdf",
"disposition": "attachment"
}
]
}
FieldTypeRequiredDescription
fileNamestringYesDisplay name of the attachment
contentstringYesBase64-encoded file content
mimeTypestringYesMIME type (e.g., application/pdf, text/calendar)
dispositionstringYes"attachment" or "inline"
contentIdstringNoContent ID for inline images referenced in HTML