---
title: "SendMessage"
slug: "api/session/operations/sendmessage"
sidebar:
  order: 165
---

<a id="ref-400a10abb4dd"></a>
<a id="ref-48e8ec8b7250"></a>
<a id="ref-7fe0f672188e"></a>
<a id="ref-8243c25feab7"></a>

## Synopsis

```text
SendMessageResult sendMessage(
    SessionId sessionId,
    ClientMessage[] messages
)
throws SessionServiceFault;
```

See also: [`SendMessageResult`](/pCon/configuratorOnline/specs/api/session/types/sendmessageresult#ref-5771f77168ff), [`SessionId`](/pCon/configuratorOnline/specs/api/session/types/sessionid#ref-02e397c8fdb4), [`ClientMessage`](/pCon/configuratorOnline/specs/api/session/types/clientmessage#ref-7f622e430491), [`SessionServiceFault`](/pCon/configuratorOnline/specs/api/session/faults/sessionservicefault)

If the specified session ID is not the NIL UUID, the [`keepAlive`](/pCon/configuratorOnline/specs/api/session/operations/keepalive) operation is called first and its result will be returned in the `sessionAlive` field of [SendMessageResult](/pCon/configuratorOnline/specs/api/session/types/sendmessageresult). (If `sessionId` is the NIL UUID, `sessionAlive` will be `false.`)

The operation calls `SessionManager.sendMessage()` to deliver the messages to the specified targets. Response messages, if any, are returned in field `messages` of [SendMessageResult](/pCon/configuratorOnline/specs/api/session/types/sendmessageresult)

Operation `sendMessage` should not be invoked with a session context ID. If it is, field `sessionAlive` of the return value is always be `false`, even if the corresponding session is alive, and the session context ID is passed as the first argument of method `IPlugin.sendMessage()`, which may confuse plugins.
