# Send Message

Use the **POST /client/send-message/** endpoint to send either a call or notification message based on the input parameters. You can handle the sending of a message associated with a specific call or notification, based on whether the `is_call` parameter is true or false.

***

#### Parameters

**Request Body:**

| Name                | Type    | Description                                              | Required |
| ------------------- | ------- | -------------------------------------------------------- | -------- |
| `ownerId`           | string  | Unique identifier for the message owner.                 | No       |
| `ownerName`         | string  | Name of the message owner.                               | Yes      |
| `ownerEmail`        | string  | Email address of the message owner.                      | No       |
| `email`             | string  | The recipient's email address.                           | No       |
| `meeting_id`        | string  | Unique identifier for the meeting.                       | No       |
| `call_token`        | string  | Token associated with the call, if applicable.           | Yes      |
| `owner_fcm`         | string  | FCM token of the owner, used for push notifications.     | Yes      |
| `fcm_token`         | string  | FCM token of the recipient, used for push notifications. | Yes      |
| `is_call`           | boolean | Indicates if the message is for a call.                  | Yes      |
| `is_cancelled_call` | boolean | Indicates if the call is cancelled.                      | No       |
| `is_voice`          | boolean | Indicates if the message is a voice message.             | Yes      |
| `initiate_id`       | string  | Unique identifier for the message initiation.            | No       |
| `owner_image`       | string  | URL of the image associated with the message owner.      | No       |

***

#### Example Request Body:

```json
{
  "ownerId": "12345",
  "ownerName": "John Doe",
  "ownerEmail": "johndoe@example.com",
  "email": "recipient@example.com",
  "meeting_id": "meeting123",
  "call_token": "callToken123",
  "owner_fcm": "ownerFCMToken",
  "fcm_token": "recipientFCMToken",
  "is_call": true,
  "is_cancelled_call": false,
  "is_voice": false,
  "initiate_id": "initiate123",
  "owner_image": "https://example.com/owner_image.jpg"
}
```

***

#### Responses

**201 Created**

**Description:** The message was successfully created and sent.

**Example Response:**

```json
{
  "ownerId": "12345",
  "ownerName": "John Doe",
  "ownerEmail": "johndoe@example.com",
  "email": "recipient@example.com",
  "meeting_id": "meeting123",
  "call_token": "callToken123",
  "owner_fcm": "ownerFCMToken",
  "fcm_token": "recipientFCMToken",
  "is_call": true,
  "is_cancelled_call": false,
  "is_voice": false,
  "initiate_id": "initiate123",
  "owner_image": "https://example.com/owner_image.jpg"
}
```
