Send text message
Sends a normalized text message through the selected provider account. provider_data can carry provider-specific fields such as reply_to and parse_mode.
https://api.unifyport.ai/v1/messagesHeaders
X-Api-KeyWorkspace API key. The workspace is resolved from this header.
Content-TypeUse application/json when sending a JSON request body.
Path parameters
This endpoint has no path parameters.
Request body
account_idProvider account that sends the message.
toRecipient target with id and type.
messageNormalized message payload. Text uses message.text; media uses message.url.
provider_dataProvider-specific options such as parse_mode.
Response body
message_idUnifyPort message identifier (msg_...) for the accepted message.
account_idProvider account this response refers to.
statusAcceptance status; accepted means the message was queued for delivery to the provider.
provider_refProvider-side message reference, once the provider assigns one.
Responses
200Request succeeded. See the example response body.
400The request body, path, or parameters are invalid.
401The X-Api-Key header is missing or invalid.
409The requested operation conflicts with an existing provider account or resource.
500The service encountered an unexpected error.
Request
curl -X POST https://api.unifyport.ai/v1/messages \
-H "X-Api-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"account_id": "acc_example",
"to": {
"id": "user_example",
"type": "user"
},
"message": {
"type": "text",
"text": "Hello from UnifyPort"
},
"provider_data": {
"parse_mode": "markdown"
}
}'Response
{
"data": {
"message_id": "msg_example",
"account_id": "acc_example",
"status": "accepted",
"provider_ref": "provider_msg_example"
}
}