> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# Send a message as an agent

POST https://api.brevo.com/v3/conversations/messages
Content-Type: application/json

Send a message as an agent to an existing visitor's conversation. You must provide either `agentId` alone, or all three of `agentEmail` + `agentName` + `receivedFrom` to identify the agent.

Reference: https://developers.brevo.com/reference/send-a-message-as-an-agent

## Authentication

- `api-key` header (required) — The API key should be passed in the request headers as `api-key` for authentication.
- `Authorization` header (bearer token, required) — OAuth 2.0 client_credentials (machine-to-machine) grant. Exchange your app's client_id/client_secret for a short-lived Bearer token.

## Request

### Body (application/json)

This endpoint expects an object.

- `text` (string, required) — Message text.
- `visitorId` (string, required) — Visitor's ID received from a webhook or generated by you to bind an existing user account to Conversations.
- `agentEmail` (string, optional) — Agent's email address. When sending messages from a standalone system, it's hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address.
- `agentId` (string, optional) — Agent ID. It can be found on the agent's page or received from a webhook. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required).
- `agentName` (string, optional) — Agent's name.
- `receivedFrom` (string, optional) — Mark your messages to distinguish messages created by you from the others.

## Response

### 200

Newly created message is returned as a response.

- `agentId` (string, optional) — ID of the agent on whose behalf the message was sent (only in messages sent by an agent).
- `agentName` (string, optional) — Agent’s name as displayed to the visitor. Only in the messages sent by an agent.
- `agentUserpic` (string, optional) — Only set if the agent has uploaded a profile picture.
- `attachments` (list of ConversationsMessageAttachmentsItems, optional) — An array of file attachments.
- `bcc` (list of ConversationsMessageBccItems, optional) — An array containing details of the blind carbon copy (BCC) recipients (applicable only to messages in email threads).
- `cc` (list of ConversationsMessageCcItems, optional) — An array containing details of the carbon copy (CC) recipients (applicable only to messages in email threads).
- `createdAt` (long, optional) — Timestamp in milliseconds.
- `file` (ConversationsMessageFile, optional)
- `forwardedToSourceStatus` (ConversationsMessageForwardedToSourceStatus, optional) — Status of the message forwarding to the source.
- `from` (ConversationsMessageFrom, optional) — An object containing details about the email sender (applicable only to messages in email threads).
- `html` (string, optional) — The HTML content of the message.
- `id` (string, optional) — Message ID. It can be used for further manipulations with the message.
- `integrations` (ConversationsMessageIntegrations, optional) — Integration details.
- `isBot` (boolean, optional) — `true` for automated messages generated by an AI bot.
- `isMissed` (boolean, optional) — `true` for missed and offline messages.
- `isMissedByVisitor` (boolean, optional) — `true` for unread agent’s messages in finished chats.
- `isPushed` (boolean, optional) — `true` for pushed messages
- `isTrigger` (boolean, optional) — `true` for automatic messages from “Targeted chats & triggers” and API (https://developers.brevo.com/docs/javascript-api-reference#sendautomessage)
- `rawUnsafeHtml` (string, optional) — Unescaped HTML content of the message (may include unsafe HTML).
- `receivedFrom` (string, optional) — In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop.
- `replyTo` (ConversationsMessageReplyTo, optional) — An object containing details of the reply-to email address (applicable only to messages in email threads).
- `sourceMessageId` (string, optional) — The ID of the message assigned by the integration source.
- `subject` (string, optional) — The subject line of the email message (only for messages sent to email threads).
- `text` (string, optional) — Message text or name of the attached file
- `to` (list of ConversationsMessageToItems, optional) — An array containing details of the recipients (applicable only to messages in email threads).
- `type` (enum, optional) — `"agent"` for agents’ messages, `"visitor"` for visitors’ messages.
  - Allowed values: `agent`, `visitor`
- `isSentViaJsApi` (boolean, optional) — ‘`true` if the message was sent via JavaScript API.’
- `messageType` (string, optional) — The type of message content (e.g. for integration-specific message types).
- `isForward` (boolean, optional) — ‘`true` if the message is a forwarded message.’
- `source` (ConversationsMessageSource, optional) — Source information for the message.
- `visitorId` (string, optional) — visitor’s ID

## Errors

### 400 Bad Request Error

bad request

- `code` (enum, required) — Error code displayed in case of a failure
  - Allowed values: `invalid_parameter`, `missing_parameter`, `out_of_range`, `campaign_processing`, `campaign_sent`, `document_not_found`, `not_enough_credits`, `permission_denied`, `duplicate_parameter`, `duplicate_request`, `method_not_allowed`, `unauthorized`, `account_under_validation`, `not_acceptable`, `bad_request`, `unprocessable_entity`, `Domain does not exist`, `Contact email not found`, `Attribute not found`, `Category id not found`, `Invalid parameters passed`, `Record(s) for identifier not found`, `Returned when query params are invalid`, `Returned when invalid data posted`, `Feed not found`, `Campaign ID not found`, `api-key not found`, `DMARC policy requires domain authentication`, `DNS records not properly configured`, `Invalid OTP code provided`, `OTP code has expired`, `Domain already exists in your account`, `The sum of all IP weights must equal 100`, `Authentication failed`, `Insufficient credits`, `Request already processed`
- `message` (string, required) — Readable message associated to the failure

## Types

### ConversationsMessageAttachmentsItems

- `name` (string, optional) — The name of the file.
- `link` (string, optional) — The URL of the file.
- `mimeType` (string, optional) — The MIME type of the file.
- `isImage` (boolean, optional) — `true` for images.
- `isSticker` (boolean, optional) — `true` for sticker files.
- `isInline` (boolean, optional) — `true` for inline files.
- `inlineId` (string, optional) — The ID of the inline file.
- `size` (long, optional) — The size of the file in bytes.
- `imageInfo` (ConversationsMessageAttachmentsItemsImageInfo, optional) — Image information (only present for image files).
- `isAllowedFileType` (boolean, optional) — Whether the file extension is allowed for download.

### ConversationsMessageBccItems

- `email` (string, optional)
- `name` (string, optional)

### ConversationsMessageCcItems

- `email` (string, optional)
- `name` (string, optional)

### ConversationsMessageFile

- `name` (string, optional) — Name of the file.
- `link` (string, optional) — URL of the file.
- `mimeType` (string, optional) — MIME type of the file.
- `isImage` (boolean, optional) — Whether the file is an image.
- `isSticker` (boolean, optional) — Whether the file is a sticker.
- `isInline` (boolean, optional) — Whether the file is inline.
- `inlineId` (string, optional) — The ID of the inline file.
- `size` (long, optional) — Size in bytes.
- `imageInfo` (ConversationsMessageFileImageInfo, optional) — Image info, present when the file is an image.
- `isAllowedFileType` (boolean, optional) — Whether the file extension is allowed for download.

### ConversationsMessageForwardedToSourceStatus

Status of the message forwarding to the source.

- `error` (string, optional)
- `isSuccess` (boolean, optional)

### ConversationsMessageFrom

An object containing details about the email sender (applicable only to messages in email threads).

- `email` (string, optional)
- `name` (string, optional)

### ConversationsMessageIntegrations

Integration details.

### ConversationsMessageReplyTo

An object containing details of the reply-to email address (applicable only to messages in email threads).

- `email` (string, optional)
- `name` (string, optional)

### ConversationsMessageToItems

- `email` (string, optional)
- `name` (string, optional)

### ConversationsMessageSource

Source information for the message.

### ConversationsMessageAttachmentsItemsImageInfo

Image information (only present for image files).

- `width` (long, optional) — Width of the image in pixels.
- `height` (long, optional) — Height of the image in pixels.
- `previewLink` (string, optional) — URL of the image preview.

### ConversationsMessageFileImageInfo

Image info, present when the file is an image.

- `width` (long, optional) — Width of the image in pixels.
- `height` (long, optional) — Height of the image in pixels.
- `previewLink` (string, optional) — URL of the image preview.

## Examples

### response

**Response**

```json
{
  "agentId": "d9nKoegKSjmCtyK78",
  "createdAt": 1482512803740,
  "html": "Hello! How can I help you?",
  "id": "eYBEm3gq3zc5ayE2g",
  "isMissed": false,
  "isMissedByVisitor": false,
  "isPushed": false,
  "isTrigger": false,
  "receivedFrom": "SuperAwesomeHelpdesk",
  "text": "Hello! How can I help you?",
  "type": "agent",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg"
}
```

**SDK Code**

```python response
import requests

url = "https://api.brevo.com/v3/conversations/messages"

headers = {"api-key": "<api-key>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript response
const url = 'https://api.brevo.com/v3/conversations/messages';
const options = {method: 'POST', headers: {'api-key': '<api-key>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/conversations/messages"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("api-key", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby response
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/conversations/messages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
```

```java response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/conversations/messages")
  .header("api-key", "<api-key>")
  .asString();
```

```php response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.brevo.com/v3/conversations/messages', [
  'headers' => [
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp response
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/conversations/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<api-key>");
IRestResponse response = client.Execute(request);
```

```swift response
import Foundation

let headers = ["api-key": "<api-key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/conversations/messages")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Basic use

**Request**

```json
{
  "text": "Hello! How can I help you?",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
  "agentId": "d9nKoegKSjmCtyK78"
}
```

**Response**

```json
{
  "agentId": "d9nKoegKSjmCtyK78",
  "createdAt": 1482512803740,
  "html": "Hello! How can I help you?",
  "id": "eYBEm3gq3zc5ayE2g",
  "isMissed": false,
  "isMissedByVisitor": false,
  "isPushed": false,
  "isTrigger": false,
  "receivedFrom": "SuperAwesomeHelpdesk",
  "text": "Hello! How can I help you?",
  "type": "agent",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg"
}
```

**SDK Code**

```python Basic use
import requests

url = "https://api.brevo.com/v3/conversations/messages"

payload = {
    "text": "Hello! How can I help you?",
    "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
    "agentId": "d9nKoegKSjmCtyK78"
}
headers = {
    "api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Basic use
const url = 'https://api.brevo.com/v3/conversations/messages';
const options = {
  method: 'POST',
  headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"text":"Hello! How can I help you?","visitorId":"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg","agentId":"d9nKoegKSjmCtyK78"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Basic use
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/conversations/messages"

	payload := strings.NewReader("{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentId\": \"d9nKoegKSjmCtyK78\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Basic use
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/conversations/messages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentId\": \"d9nKoegKSjmCtyK78\"\n}"

response = http.request(request)
puts response.read_body
```

```java Basic use
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/conversations/messages")
  .header("api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentId\": \"d9nKoegKSjmCtyK78\"\n}")
  .asString();
```

```php Basic use
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.brevo.com/v3/conversations/messages', [
  'body' => '{
  "text": "Hello! How can I help you?",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
  "agentId": "d9nKoegKSjmCtyK78"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp Basic use
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/conversations/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<api-key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentId\": \"d9nKoegKSjmCtyK78\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Basic use
import Foundation

let headers = [
  "api-key": "<api-key>",
  "Content-Type": "application/json"
]
let parameters = [
  "text": "Hello! How can I help you?",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
  "agentId": "d9nKoegKSjmCtyK78"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/conversations/messages")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### agentEmail + agentName + receivedFrom

**Request**

```json
{
  "text": "Hello! How can I help you?",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
  "agentEmail": "liz@getwear.com",
  "agentName": "Liz",
  "receivedFrom": "SuperAwesomeHelpdesk"
}
```

**Response**

```json
{
  "agentId": "d9nKoegKSjmCtyK78",
  "createdAt": 1482512803740,
  "html": "Hello! How can I help you?",
  "id": "eYBEm3gq3zc5ayE2g",
  "isMissed": false,
  "isMissedByVisitor": false,
  "isPushed": false,
  "isTrigger": false,
  "receivedFrom": "SuperAwesomeHelpdesk",
  "text": "Hello! How can I help you?",
  "type": "agent",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg"
}
```

**SDK Code**

```python agentEmail + agentName + receivedFrom
import requests

url = "https://api.brevo.com/v3/conversations/messages"

payload = {
    "text": "Hello! How can I help you?",
    "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
    "agentEmail": "liz@getwear.com",
    "agentName": "Liz",
    "receivedFrom": "SuperAwesomeHelpdesk"
}
headers = {
    "api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript agentEmail + agentName + receivedFrom
const url = 'https://api.brevo.com/v3/conversations/messages';
const options = {
  method: 'POST',
  headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"text":"Hello! How can I help you?","visitorId":"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg","agentEmail":"liz@getwear.com","agentName":"Liz","receivedFrom":"SuperAwesomeHelpdesk"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go agentEmail + agentName + receivedFrom
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/conversations/messages"

	payload := strings.NewReader("{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentEmail\": \"liz@getwear.com\",\n  \"agentName\": \"Liz\",\n  \"receivedFrom\": \"SuperAwesomeHelpdesk\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby agentEmail + agentName + receivedFrom
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/conversations/messages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentEmail\": \"liz@getwear.com\",\n  \"agentName\": \"Liz\",\n  \"receivedFrom\": \"SuperAwesomeHelpdesk\"\n}"

response = http.request(request)
puts response.read_body
```

```java agentEmail + agentName + receivedFrom
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/conversations/messages")
  .header("api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentEmail\": \"liz@getwear.com\",\n  \"agentName\": \"Liz\",\n  \"receivedFrom\": \"SuperAwesomeHelpdesk\"\n}")
  .asString();
```

```php agentEmail + agentName + receivedFrom
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.brevo.com/v3/conversations/messages', [
  'body' => '{
  "text": "Hello! How can I help you?",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
  "agentEmail": "liz@getwear.com",
  "agentName": "Liz",
  "receivedFrom": "SuperAwesomeHelpdesk"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp agentEmail + agentName + receivedFrom
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/conversations/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<api-key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentEmail\": \"liz@getwear.com\",\n  \"agentName\": \"Liz\",\n  \"receivedFrom\": \"SuperAwesomeHelpdesk\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift agentEmail + agentName + receivedFrom
import Foundation

let headers = [
  "api-key": "<api-key>",
  "Content-Type": "application/json"
]
let parameters = [
  "text": "Hello! How can I help you?",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
  "agentEmail": "liz@getwear.com",
  "agentName": "Liz",
  "receivedFrom": "SuperAwesomeHelpdesk"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/conversations/messages")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### receivedFrom

**Request**

```json
{
  "text": "Hello! How can I help you?",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
  "agentId": "d9nKoegKSjmCtyK78",
  "receivedFrom": "SuperAwesomeHelpdesk"
}
```

**Response**

```json
{
  "agentId": "d9nKoegKSjmCtyK78",
  "createdAt": 1482512803740,
  "html": "Hello! How can I help you?",
  "id": "eYBEm3gq3zc5ayE2g",
  "isMissed": false,
  "isMissedByVisitor": false,
  "isPushed": false,
  "isTrigger": false,
  "receivedFrom": "SuperAwesomeHelpdesk",
  "text": "Hello! How can I help you?",
  "type": "agent",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg"
}
```

**SDK Code**

```python receivedFrom
import requests

url = "https://api.brevo.com/v3/conversations/messages"

payload = {
    "text": "Hello! How can I help you?",
    "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
    "agentId": "d9nKoegKSjmCtyK78",
    "receivedFrom": "SuperAwesomeHelpdesk"
}
headers = {
    "api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript receivedFrom
const url = 'https://api.brevo.com/v3/conversations/messages';
const options = {
  method: 'POST',
  headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"text":"Hello! How can I help you?","visitorId":"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg","agentId":"d9nKoegKSjmCtyK78","receivedFrom":"SuperAwesomeHelpdesk"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go receivedFrom
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/conversations/messages"

	payload := strings.NewReader("{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentId\": \"d9nKoegKSjmCtyK78\",\n  \"receivedFrom\": \"SuperAwesomeHelpdesk\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby receivedFrom
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/conversations/messages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentId\": \"d9nKoegKSjmCtyK78\",\n  \"receivedFrom\": \"SuperAwesomeHelpdesk\"\n}"

response = http.request(request)
puts response.read_body
```

```java receivedFrom
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/conversations/messages")
  .header("api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentId\": \"d9nKoegKSjmCtyK78\",\n  \"receivedFrom\": \"SuperAwesomeHelpdesk\"\n}")
  .asString();
```

```php receivedFrom
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.brevo.com/v3/conversations/messages', [
  'body' => '{
  "text": "Hello! How can I help you?",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
  "agentId": "d9nKoegKSjmCtyK78",
  "receivedFrom": "SuperAwesomeHelpdesk"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp receivedFrom
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/conversations/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<api-key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"text\": \"Hello! How can I help you?\",\n  \"visitorId\": \"kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg\",\n  \"agentId\": \"d9nKoegKSjmCtyK78\",\n  \"receivedFrom\": \"SuperAwesomeHelpdesk\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift receivedFrom
import Foundation

let headers = [
  "api-key": "<api-key>",
  "Content-Type": "application/json"
]
let parameters = [
  "text": "Hello! How can I help you?",
  "visitorId": "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
  "agentId": "d9nKoegKSjmCtyK78",
  "receivedFrom": "SuperAwesomeHelpdesk"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/conversations/messages")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```