> 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.

# Sets agent's status to online for 2-3 minutes

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

Sets the agent's status to online for 2-3 minutes. We recommend pinging this endpoint every minute for as long as the agent has to be considered online. You must provide either `agentId` alone, or all three of `agentEmail` + `agentName` + `receivedFrom`.

Reference: https://developers.brevo.com/reference/sets-agents-status-to-online-for-23-minutes

## Authentication

- `api-key` header (required) — The API key should be passed in the request headers as `api-key` for authentication.

## Request

### Body (application/json)

- `agentEmail` (string, optional) — Agent's email address. When sending online pings 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. If there's no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically.
- `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

### 201

Status of the agent was set successfully. Response body will be empty.

## Examples

### Basic use

**Request**

```json
{
  "agentId": "d9nKoegKSjmCtyK78"
}
```

**Response**

```json
{}
```

**SDK Code**

```typescript Basic use
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.conversations.setsAgentsStatusToOnlineFor23Minutes({
        agentId: "d9nKoegKSjmCtyK78",
    });
}
main();

```

```python Basic use
from brevo import Brevo

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.conversations.sets_agents_status_to_online_for23minutes(
    agent_id="d9nKoegKSjmCtyK78",
)

```

```php Basic use
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Conversations\Requests\PostConversationsAgentOnlinePingRequest;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->conversations->setsAgentsStatusToOnlineFor23Minutes(
    new PostConversationsAgentOnlinePingRequest([
        'agentId' => 'd9nKoegKSjmCtyK78',
    ]),
);

```

```go Basic use
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"agentId\": \"d9nKoegKSjmCtyK78\"\n}")

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

	req.Header.Add("api-key", "<apiKey>")
	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/agentOnlinePing")

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

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\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/agentOnlinePing")
  .header("api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"agentId\": \"d9nKoegKSjmCtyK78\"\n}")
  .asString();
```

```csharp Basic use
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/conversations/agentOnlinePing");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"agentId\": \"d9nKoegKSjmCtyK78\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Basic use
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["agentId": "d9nKoegKSjmCtyK78"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/conversations/agentOnlinePing")! 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
{
  "agentEmail": "liz@getwear.com",
  "agentName": "Liz",
  "receivedFrom": "SuperAwesomeHelpdesk"
}
```

**Response**

```json
{}
```

**SDK Code**

```typescript agentEmail + agentName + receivedFrom
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.conversations.setsAgentsStatusToOnlineFor23Minutes({
        agentEmail: "liz@getwear.com",
        agentName: "Liz",
        receivedFrom: "SuperAwesomeHelpdesk",
    });
}
main();

```

```python agentEmail + agentName + receivedFrom
from brevo import Brevo

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.conversations.sets_agents_status_to_online_for23minutes(
    agent_email="liz@getwear.com",
    agent_name="Liz",
    received_from="SuperAwesomeHelpdesk",
)

```

```php agentEmail + agentName + receivedFrom
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Conversations\Requests\PostConversationsAgentOnlinePingRequest;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->conversations->setsAgentsStatusToOnlineFor23Minutes(
    new PostConversationsAgentOnlinePingRequest([
        'agentEmail' => 'liz@getwear.com',
        'agentName' => 'Liz',
        'receivedFrom' => 'SuperAwesomeHelpdesk',
    ]),
);

```

```go agentEmail + agentName + receivedFrom
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"agentEmail\": \"liz@getwear.com\",\n  \"agentName\": \"Liz\",\n  \"receivedFrom\": \"SuperAwesomeHelpdesk\"\n}")

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

	req.Header.Add("api-key", "<apiKey>")
	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/agentOnlinePing")

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

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\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/agentOnlinePing")
  .header("api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"agentEmail\": \"liz@getwear.com\",\n  \"agentName\": \"Liz\",\n  \"receivedFrom\": \"SuperAwesomeHelpdesk\"\n}")
  .asString();
```

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

var client = new RestClient("https://api.brevo.com/v3/conversations/agentOnlinePing");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\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": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "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/agentOnlinePing")! 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()
```