Skip to content

Send message

Request

Sends a real message to a real person. There is no test mode. The send is queued and the response is data.messageId with data.status "queued"; delivery outcome arrives later on the message itself. message is the channel payload — a text message is { "type": "text", "text": "Hello" }. connectionId must be a connection on this account, and channel rules still apply (for example the WhatsApp 24-hour window and Instagram not being able to open a conversation).

Security
bearerAuth(Required scopes: inbox.messages:write) or oauth2(Required scopes: inbox.messages:write)
Headers
Idempotency-Keystring, <= 255 characters^[\x21-\x7e]{1,255}$

Optional. A unique value of your own, up to 255 printable characters without spaces — a UUID is ideal. The first request carrying it is processed; any later request with the same key returns that first response instead of repeating the work, for 24 hours. A replayed response carries Idempotency-Replayed: true. Reuse the key when you retry after a timeout, and change it when you mean to send again.

Bodyapplication/jsonrequired
chatIdstring^[0-9a-fA-F]{24}$required
Example:"507f1f77bcf86cd799439011"
connectionIdstring^[0-9a-fA-F]{24}$required
Example:"507f191e810c19729de860ea"
messageobjectrequired

Channel message payload. A text message is { "type": "text", "text": "Hello" }.

Example:
{ "type": "text", "text": "Hello" }
connectionConfigobject

Per-send channel overrides. Leave it out unless support has given you the keys to set.

curl -i -X POST \
  https://developer.iclosed.io/_mock/openapi/uinbox/v1/modules/messages/v1/messages/send \
  -H 'Authorization: Bearer <YOUR_API key_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: string' \
  -d '{
    "chatId": "507f1f77bcf86cd799439011",
    "connectionId": "507f191e810c19729de860ea",
    "message": {
      "type": "text",
      "text": "Hello"
    }
  }'

Responses

The send was accepted and queued.

Bodyapplication/json
dataobjectrequired
Response
{ "data": { "messageId": "string", "status": "queued" } }