Public
Send a message
Send a message to a contact
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
Body
The Clerk phone number or identifier the message should be sent from
"+1415456789"
The media URLs to send with the message
["https://example.com/image.jpg"]
The recipients of the message
["+9134567654"]
The message text
"Hello, world!"
The name of the sender displayed in the UI
"Clerk"
Response
Represents a message resource
The ID of the resource
1
The message text
"Hello, world!"
The associated Conversation ID
"1"
Whether the message was received (true) or sent (false)
true
The phone numbers or identifiers of message participants
["+1415456789"]
The phone number or identifier of the message sender
"+1415456789"
The type of sender
ai_pipeline
, assistant
, user
, campaign
, campaign_message
, workflow
"user"
The status of the message
sending
, scheduled
, sent
, delivered
, failed
, read
"delivered"
The date and time the resource was created
"2021-01-01T00:00:00.000Z"
The date and time the resource was last updated
"2021-01-01T00:00:00.000Z"
Whether the message has been seen
true
Number of SMS message segments used by the message
1
The timestamp associated with the message
"2021-01-01T00:00:00.000Z"
The ID of the user who created the resource
"1"
The ID of the campaign message
1
The associated Campaign ID
1
The associated Channel ID
"00000000-0000-0000-0000-000000000000"
The associated Inbox ID
"00000000-0000-0000-0000-000000000000"
The error message if the message failed to send
The name of the sender displayed in the UI
"Clerk"
The error code if the message failed to send
123
The external ID of the resource
"external-id"
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"
}
}