API Reference
MessagesPOST

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/messages

Headers

X-Api-Key
stringrequired

Workspace API key. The workspace is resolved from this header.

Content-Type
stringrequired

Use application/json when sending a JSON request body.

Path parameters

This endpoint has no path parameters.

Request body

account_id
stringrequired

Provider account that sends the message.

to
objectrequired

Recipient target with id and type.

message
objectrequired

Normalized message payload. Text uses message.text; media uses message.url.

provider_data
object

Provider-specific options such as parse_mode.

Response body

message_id
string

UnifyPort message identifier (msg_...) for the accepted message.

account_id
string

Provider account this response refers to.

status
string

Acceptance status; accepted means the message was queued for delivery to the provider.

provider_ref
string

Provider-side message reference, once the provider assigns one.

Responses

200
200 OK

Request succeeded. See the example response body.

400
Bad Request

The request body, path, or parameters are invalid.

401
Unauthorized

The X-Api-Key header is missing or invalid.

409
Conflict

The requested operation conflicts with an existing provider account or resource.

500
Internal Server Error

The 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"
  }
}