POST
/
public
/
messages
curl --request POST \
  --url https://web-api.clerk.chat/public/messages \
  --header 'Content-Type: application/json' \
  --header 'apiKey: <api-key>' \
  --data '{
  "sender": "+1415456789",
  "mediaUrls": [
    "https://example.com/image.jpg"
  ],
  "recipients": [
    "+9134567654"
  ],
  "body": "Hello, world!",
  "sentByName": "Clerk"
}'
{
  "data": {
    "id": 1,
    "body": "Hello, world!",
    "conversationId": "1",
    "userId": "1",
    "campaignMessageId": 1,
    "campaignId": 1,
    "channelId": "00000000-0000-0000-0000-000000000000",
    "inboxId": "00000000-0000-0000-0000-000000000000",
    "inbound": true,
    "members": [
      "+1415456789"
    ],
    "sender": "+1415456789",
    "senderType": "user",
    "status": "delivered",
    "error": "<string>",
    "sentByName": "Clerk",
    "errorCode": 123,
    "created": "2021-01-01T00:00:00.000Z",
    "updated": "2021-01-01T00:00:00.000Z",
    "seen": true,
    "externalId": "external-id",
    "segments": 1,
    "timestamp": "2021-01-01T00:00:00.000Z"
  }
}

Authorizations

apiKey
string
header
required

Body

application/json
sender
string
required

The Clerk phone number or identifier the message should be sent from

Example:

"+1415456789"

mediaUrls
string[]
required

The media URLs to send with the message

Example:
["https://example.com/image.jpg"]
recipients
string[]
required

The recipients of the message

Example:
["+9134567654"]
body
string
required

The message text

Example:

"Hello, world!"

sentByName
string

The name of the sender displayed in the UI

Example:

"Clerk"

Response

201
application/json
The sent message
data
object
required

Represents a message resource