JavaScript SDK: swarmhit.inbox.chats.messages.send(chatId, params)
Sends as the chat's sender account, or from the mailbox on an email chat (a reply in the same thread, to the address that last wrote). Email chats take text only for now: attachments or a voiceMessage on one is a 400.
Authorization
bearerAuth An API key created on the Access tokens page.
In: header
Path Parameters
Header Parameters
Unique key per action (e.g. a UUID). Reusing it replays the first response instead of sending again, so a retry can't double-send. Read only by the endpoints that list it. A key is scoped to the endpoint and the account (or chat) it acts on, and kept for 24 hours. Only a successful response is stored and replayed: a 4xx frees the key, while a 5xx keeps it (the action may have gone out; retry with a new key). So does a 400 passing on a LinkedIn, WhatsApp or mail provider failure (code provider-unreachable, provider-408 for the provider's own timeout, or provider- and a 5xx status such as provider-502), unless the request provably never reached the provider (its connection never opened): the action may have gone out. A retry with the same key then gets 409 idempotency_failed. The request body is not compared, so a reused key replays the first response even if the body differs.
length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/inbox/chats/string/messages" \ -H "Content-Type: application/json" \ -d '{ "text": "Thanks for connecting! Happy to share more." }'{ "data": { "ok": true, "messageId": "string", "campaignLead": { "id": "string", "status": "pending" } }}Mark a chat read POST
**JavaScript SDK:** [`swarmhit.inbox.chats.markRead(chatId)`](/smart-api/sdk/methods#inbox.chats) Clears the unread count for the chat (and every sibling thread of the same person), locally and on LinkedIn.
Star or unstar a chat POST
**JavaScript SDK:** [`swarmhit.inbox.chats.setFavorite(chatId, params)`](/smart-api/sdk/methods#inbox.chats)