Send Agent Events
Send request metadata to Hardal so AI Visibility can analyze AI agent, crawler, and bot traffic.
curl -X POST "https://analytics.yourdomain.com/agent-events" \
-H "Content-Type: application/json" \
-H "tenant-id: YOUR_TENANT_ID" \
-d '{
"path": "/pricing",
"ip": "66.249.66.1",
"userAgent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
"eventTime": "2026-04-29T15:12:17.836Z",
"sourceId": "YOUR_SOURCE_ID"
}'
import requests
import json
url = "https://analytics.yourdomain.com/agent-events"
headers = {
"Content-Type": "application/json",
"tenant-id": "YOUR_TENANT_ID"
}
data = {
"path": "/pricing",
"ip": "66.249.66.1",
"userAgent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
"eventTime": "2026-04-29T15:12:17.836Z",
"sourceId": "YOUR_SOURCE_ID"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://analytics.yourdomain.com/agent-events", {
method: "POST",
headers: {
"Content-Type": "application/json",
"tenant-id": "YOUR_TENANT_ID"
},
body: JSON.stringify({
"path": "/pricing",
"ip": "66.249.66.1",
"userAgent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
"eventTime": "2026-04-29T15:12:17.836Z",
"sourceId": "YOUR_SOURCE_ID"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"path": "/pricing",
"ip": "66.249.66.1",
"userAgent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
"eventTime": "2026-04-29T15:12:17.836Z",
"sourceId": "YOUR_SOURCE_ID"
}`)
req, err := http.NewRequest("POST", "https://analytics.yourdomain.com/agent-events", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("tenant-id", "YOUR_TENANT_ID")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://analytics.yourdomain.com/agent-events')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['tenant-id'] = 'YOUR_TENANT_ID'
request.body = '{
"path": "/pricing",
"ip": "66.249.66.1",
"userAgent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
"eventTime": "2026-04-29T15:12:17.836Z",
"sourceId": "YOUR_SOURCE_ID"
}'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"accepted": 42,
"events": [
{
"eventId": "123e4567-e89b-12d3-a456-426614174000",
"sourceId": "YOUR_SOURCE_ID"
}
]
},
"timestamp": "2024-12-25T10:00:00Z",
"path": "/agent-events",
"requestId": "example_string"
}
{}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
/agent-events
Target server for requests. Edit to use your own host.
The media type of the request body
Your Tenant ID from Setup in the Dashboard.
Requested path on the website.
IP address from the original incoming request.
Raw User-Agent header from the request.
Request time in ISO 8601 format.
Your Source ID from Setup in the Dashboard.
Request Preview
Response
Response will appear here after sending the request
Headers
Body
Raw User-Agent header from the request.
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)Responses
Send request metadata
Send request metadata to the agent-events endpoint so Hardal can classify AI agent, search bot, and crawler traffic. The reference and live playground below are generated from the API spec. An accepted crawler returns 202; a request filtered by the user-agent or IP checks returns an empty 204.