Send an outbound message to a phone number. A comment must be specified in the request.
Also supported on this endpoint:
- Whisper a Phone Number — use
whisper/whisper_attachmentsinstead ofcomment/attachments. - Message a Group Conversation — pass
phone_numberas an array plus requiredgroup_uuidfor a group-messaging department.
Body
Required
-
Department UUID. Required for group messaging; optional otherwise (defaults to first department).
-
Customer-visible message content (use for outbound SMS).
-
Agent-only whisper content.
-
Optional attachments for a customer-visible message.
-
Optional attachments for a whisper.
-
If set (e.g. "1"), resolve the conversation after sending.
POST
/api/conversations.json
curl \
--request POST 'https://application.textline.com/api/conversations.json' \
--header "Content-Type: application/json" \
--data '{
"phone_number": "(222) 222-2222",
"comment": {
"body": "hello world"
}
}'
Request examples
Message a phone number
{
"phone_number": "(222) 222-2222",
"comment": {
"body": "hello world"
}
}
{
"phone_number": "(222) 222-2222",
"whisper": {
"body": "whisper"
}
}
{
"phone_number": [
"(222) 222-2222",
"786-876-5309",
"+19497654321"
],
"group_uuid": "deb79a6a-0652-4e14-86f2-dc8c5c502369",
"comment": {
"body": "hello world"
}
}
Response examples (200)
{
"conversation": {
"customer": {
"avatar_url": "https://example.com/image.png",
"blocked": false,
"archived": false,
"name": "Chuck Finley",
"notes": "``",
"phone_number": "(222) 222-2222",
"reachable_by_sms": true,
"tags": [
"foo",
"bar"
],
"uuid": "deb79a6a-0652-4e14-86f2-dc8c5c502369",
"facebook_id": "null",
"custom_fields": {
"c43a1766-47e1-4c9c-a2cc-36bf424fcbc0": "Custom_Field_1_value",
"116bad5a-6233-472d-bcf0-199d53342a82": "null"
},
"consent_status": true,
"verified": true
},
"resolved": true,
"uuid": "84a2c56f-6b79-4764-811d-90880e2757b4"
},
"post": {
"assigned_to": {
"avatar_url": "https://example.com/image.png",
"name": "Chuck Finley",
"on_call": true,
"username": "ChuckF",
"uuid": "deb79a6a-0652-4e14-86f2-dc8c5c502369",
"email": "chuckf@textline.com",
"permission_level": "Admin",
"group_uuids": [
"21ca50a9-a85d-49d1-9266-0df69fd5a9ef",
"35c450e8-5b60-46e2-b691-481419462c16"
]
},
"attachments": [
{
"content_type": "image/jpeg",
"name": "my_photo.png",
"url": "https://example.com/image.png"
}
],
"body": "hello world",
"conversation_uuid": "84a2c56f-6b79-4764-811d-90880e2757b4",
"created_at": 1493923935,
"creator": {
"name `Chuck Finley`": "",
"type": "user"
},
"first_post": false,
"is_whisper": false,
"marked_as_resolved": false,
"message_type": "SMS",
"transferred_to": {
"avatar_url": "https://example.com/image.png",
"name": "Chuck Finley",
"on_call": true,
"username": "ChuckF",
"uuid": "deb79a6a-0652-4e14-86f2-dc8c5c502369",
"email": "chuckf@textline.com",
"permission_level": "Admin",
"group_uuids": [
"21ca50a9-a85d-49d1-9266-0df69fd5a9ef",
"35c450e8-5b60-46e2-b691-481419462c16"
]
},
"uuid": "deb79a6a-0652-4e14-86f2-dc8c5c502369"
},
"group": {
"name": "Sales",
"phone_number": "(222) 222-2222",
"uuid": "deb79a6a-0652-4e14-86f2-dc8c5c502369",
"is_sms_group": true
}
}