st.sendMessage
This action allows you to send a message to a person.
In the SDK this is the sendMessage method. It takes the parameters below except label and then, which exist only in workflow JSON. It returns no data: a failed action comes back in errors, with one of the error types below.
The SDK also takes manageConversation: it runs st.manageConversation on the same conversation right after the message is sent, so no threadId is needed for it.
In the CLI this is linkedin message send – the command is below, under Parameters.
Constraints
⏺️ Root Start: allowed, when
personUrlorthreadIdparameter is provided.
⬆️ Parent Actions: st.openPersonPage.
⬇️ Child Actions: st.manageConversation.
Parameters
{
"actionType": "st.sendMessage",
"label": "person1",
"personUrl": "https://www.linkedin.com/in/person1",
"text": "Hi! I'd love to connect and discuss some ideas.",
"then": {
"actionType": "st.manageConversation",
"operation": "archive"
}
}In AI assistants, the MCP server runs this action as the send_message tool.
In the CLI this is linkedin message send:
linkedin message send <person-url> <text>| Arg | Required | Description |
|---|---|---|
person-url | conditional | LinkedIn profile URL of the recipient. Optional when --thread-id is provided |
text | yes | Message text (up to 1900 characters) |
| Flag | Type | Description |
|---|---|---|
--thread-id | string | Reply into an existing conversation thread instead of passing person-url |
--manage | string | Manage the conversation right after sending, acting on the same thread. One of archive, unarchive, star, unstar, mute, unmute |
label(optional) – custom label for tracking this action in workflow completion.personUrl(required for root start unlessthreadIdis provided, forbidden for parent start) – public or hashed LinkedIn URL of the person you want to send a message to.threadId(optional) – identifier of an existing conversation thread to reply into, as returned by inbox polling, or read from the address bar of an open conversation — the<id>inlinkedin.com/messaging/thread/<id>. Provide eitherpersonUrlorthreadId; if both are given,threadIdtakes precedence.text– message text, must be up to 1900 characters.then(optional) – object or array of child actions to be executed within this action. Only st.manageConversation is allowed as a child, and it acts on the conversation this message was sent into, so itsthreadIdmust be omitted — onlyoperationis provided.
💡 Replying by
threadIdsends the message directly into a known conversation, which is convenient when reacting to an inbox event without resolving the person's profile URL first.
Result options
- Successful message sending:
{
"actionType": "st.sendMessage",
"label": "person1",
"success": true,
"data": {
"then": { ... }
}
}label– included only if specified in the action parameters.data.then– included only when child actions are provided; contains the results of their execution.
- Failed message sending:
{
"actionType": "st.sendMessage",
"label": "person1",
"success": false,
"error": {
"type": "personNotFound",
"message": "The provided URL is not an existing LinkedIn person."
}
}label– included only if specified in the action parameters.error.type– enum with the following possible values:personNotFound– provided URL is not an existing LinkedIn person.personLikelyChangedPublicUrl– the provided URL no longer opens, but this person appeared in your account's network events before, so they most likely changed their public URL. Retry with their hashed URL.selfProfileNotAllowed– action cannot be performed on your own profile.messagingNotAllowed– sending a message to the person is not allowed. This could happen for several reasons:- You are not connected to the person.
- LinkedIn has restricted your ability to send messages to the person, for example, due to reaching message limits or the person’s privacy settings.