# st.sendMessage

This action allows you to send a message to a person.

## Constraints

> ⏺️ **Root Start:** allowed, when `personUrl` or `threadId` parameter is provided.

> ⬆️ **Parent Actions:** [st.openPersonPage](/docs/action-st-open-person-page).

> ⬇️ **Child Actions:** [st.manageConversation](/docs/action-st-manage-conversation).

## Parameters

```json
{
  "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"
  }
}
```

- `label` (optional) – custom label for tracking this action in workflow completion.
- `personUrl` (required for root start unless `threadId` is provided, forbidden for parent start) – [public or hashed](/faq/what-are-hashed-url-and-public-url) 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](/docs/monitoring-inbox) or [conversation polling](/docs/working-with-conversations), or read from the address bar of an open conversation — the `<id>` in `linkedin.com/messaging/thread/<id>`. Provide either `personUrl` or `threadId`; if both are given, `threadId` takes 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](/docs/action-st-manage-conversation) is allowed as a child, and it acts on the conversation this message was sent into, so its `threadId` must be omitted — only `operation` is provided.

> 💡 Replying by `threadId` sends 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

1. **Successful message sending:**

```json
{
  "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.

2. **Failed message sending:**

```json
{
  "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.
  - `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.
