Skip to main content
POST
/
presence
/
register
Register Presence
curl --request POST \
  --url https://api.example.com/presence/register \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent_id": "<string>",
  "name": "<string>",
  "activity": "<string>",
  "resource_id": "<string>"
}
'
import requests

url = "https://api.example.com/presence/register"

payload = {
    "agent_id": "<string>",
    "name": "<string>",
    "activity": "<string>",
    "resource_id": "<string>"
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    agent_id: '<string>',
    name: '<string>',
    activity: '<string>',
    resource_id: '<string>'
  })
};

fetch('https://api.example.com/presence/register', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.example.com/presence/register",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'agent_id' => '<string>',
    'name' => '<string>',
    'activity' => '<string>',
    'resource_id' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

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

func main() {

	url := "https://api.example.com/presence/register"

	payload := strings.NewReader("{\n  \"agent_id\": \"<string>\",\n  \"name\": \"<string>\",\n  \"activity\": \"<string>\",\n  \"resource_id\": \"<string>\"\n}")

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

	req.Header.Add("Content-Type", "application/json")

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

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

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.example.com/presence/register")
  .header("Content-Type", "application/json")
  .body("{\n  \"agent_id\": \"<string>\",\n  \"name\": \"<string>\",\n  \"activity\": \"<string>\",\n  \"resource_id\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/presence/register")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"agent_id\": \"<string>\",\n  \"name\": \"<string>\",\n  \"activity\": \"<string>\",\n  \"resource_id\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "agent_id": "<string>",
  "name": "<string>",
  "organization_id": "<string>",
  "activity": "<string>",
  "resource_id": "<string>",
  "registered_at": "2023-11-07T05:31:56Z",
  "last_heartbeat": "2023-11-07T05:31:56Z"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}

Body

application/json

Request body for registering presence.

Attributes: agent_id: Unique identifier for the agent or session. agent_type: Type of agent connecting. name: Human-readable display name. activity: Optional current activity description. resource_id: Optional resource being worked on.

agent_id
string
required
agent_type
enum<string>
required

Type of agent connected to the platform.

Available options:
external,
internal,
human
name
string
required
activity
string | null
resource_id
string | null

Response

Successful Response

Presence registration for an active agent or human session.

Attributes: agent_id: Unique identifier for the connected agent or session. agent_type: Whether the agent is external (MCP), internal, or human. name: Human-readable display name. organization_id: Organization the agent belongs to. activity: Description of current activity, if any. resource_id: Resource the agent is currently working on, if any. registered_at: Timestamp when presence was first registered. last_heartbeat: Timestamp of the most recent heartbeat.

agent_id
string
required
agent_type
enum<string>
required

Type of agent connected to the platform.

Available options:
external,
internal,
human
name
string
required
organization_id
string
required
activity
string | null
resource_id
string | null
registered_at
string<date-time>
last_heartbeat
string<date-time>