Skip to content
Get started
V2 Reference
Chats

Create Chat

POST
/api/partner/v2/chats
curl --request POST \
--url https://api.linqapp.com/api/partner/v2/chats \
--header 'Content-Type: application/json' \
--header 'X-LINQ-INTEGRATION-TOKEN: <X-LINQ-INTEGRATION-TOKEN>' \
--data '{ "send_from": "+15175269229", "chat": { "display_name": "Sample Chat", "phone_numbers": [ "+13343284472", "+13344713465" ] }, "message": { "text": "Hello! This is a sample message from Linq API v2.", "idempotency_key": "msg-2024_01-23_abc123" } }'

Creates a new chat with the specified phone numbers, or returns an existing chat if one already exists with the same participants. At least one phone number must be provided.

Note: This endpoint uses “find or create” logic:

  • If a chat already exists with these participants, returns the existing chat (which may have many messages)
  • If no chat exists, creates a new chat with your initial message (will have message_count: 1)
Media type application/json
object
send_from
required

Phone number to send from. This must be one of your organization’s Linq phone numbers.

string
chat
required
object
display_name

Display name for the chat (optional)

string
phone_numbers
required

Phone numbers to include in the chat

Array<string>
>= 1 items
message
required

Initial message to send when creating the chat

object
text
required

Message text content

string
idempotency_key

Optional unique key to prevent duplicate messages. Must be alphanumeric and may include hyphens and underscores. If a message with this key was already sent, returns the existing message.

string
/^[a-zA-Z0-9_-]+$/
attachments

Optional file attachments to upload with the message. Files are uploaded as part of the multipart/form-data request. Include one field per file. Omit this field if not attaching files.

Array<string>
attachment_urls

Optional URLs of files to attach to the message. The API will download files from these URLs (must be publicly accessible). Uses a 30-second timeout per download. Can be used together with direct file uploads via attachments. Omit this field if not attaching files via URLs.

Array<string>
Examples

Basic message without attachments

{
"send_from": "+15175269229",
"chat": {
"display_name": "Sample Chat",
"phone_numbers": [
"+13343284472",
"+13344713465"
]
},
"message": {
"text": "Hello! This is a sample message from Linq API v2.",
"idempotency_key": "msg-2024_01-23_abc123"
}
}

Chat created successfully (or existing chat returned if already exists)

Media type application/json
object
data
object
id
integer
display_name
string
service
string
Allowed values: iMessage SMS RCS
group
boolean
chat_handles
Array<object>
object
id
integer
phone_number

The phone number or email identifier for this participant

string
service

The messaging service for this handle

string
Allowed values: iMessage SMS RCS
joined_at
string format: date-time
chat_messages

The initial message that was sent when creating the chat

object
id
integer
text
string
sent_at
string format: date-time
delivered_at

Timestamp when message was delivered. Initially null when message is pending, populated once delivered.

string format: date-time
nullable
delivery_status

Current delivery status. Starts as “pending”, changes to “delivered” once successfully delivered.

string
Allowed values: pending delivered rate_limit_exceeded paused
is_read
boolean
attachments

Array of attachments if any were included

Array<object>
object
id

Unique identifier for the attachment

string format: uuid
url
string
filename
string
mime_type
string
file_size
integer
Example
{
"data": {
"id": 45,
"display_name": "John Doe",
"service": "iMessage",
"group": false,
"chat_handles": [
{
"id": 123,
"phone_number": "+15551234567",
"service": "iMessage",
"joined_at": "2025-05-21T15:30:00.000-05:00"
},
{
"id": 124,
"phone_number": "+15559876543",
"service": "iMessage",
"joined_at": "2025-05-21T15:30:00.000-05:00"
}
],
"chat_messages": {
"id": 16470817,
"text": "Hello! This is a sample message from Linq API v2.",
"sent_at": "2025-10-23T13:07:55.019-05:00",
"delivered_at": null,
"delivery_status": "pending",
"is_read": false,
"attachments": [
{
"id": "abc12345-1234-5678-9abc-def012345678",
"url": "https://storage.googleapis.com/linq-files/attachments/abc123.pdf",
"filename": "document.pdf",
"mime_type": "application/pdf",
"file_size": 12345
}
]
}
}
}

Bad request - Invalid or missing parameters (client-side error). Please verify all required parameters are included and properly formatted.

Media type application/json

Standard error format used by most endpoints (render_error format)

object
errors
Array<object>
object
status
integer
code
string
title
string
detail
string
Example
{
"errors": [
{
"status": 400,
"code": "missing_phone",
"title": "Missing Phone",
"detail": "Missing required parameter: send_from"
}
]
}

Validation error

Media type application/json

Standard error format used by most endpoints (render_error format)

object
errors
Array<object>
object
status
integer
code
string
title
string
detail
string
Example
{
"errors": [
{
"status": 422,
"code": "invalid_params",
"title": "Invalid Params",
"detail": "Phone number is required"
}
]
}