Send an Agent Event
Send AI Visibility agent events to Hardal.
curl -X POST "https://analytics.usehardal.com/agent-events" \
-H "Content-Type: application/json" \
-H "Tenant-Id: YOUR_TENANT_ID" \
-d '{
"path": "/local-test",
"ip": "87.250.224.230",
"userAgent": "Mozilla/5.0 (compatible; YandexNews/4.0; +http://yandex.com/bots)",
"eventTime": "2026-04-29T15:12:17.836Z",
"sourceId": "hardal"
}'
import requests
import json
url = "https://analytics.usehardal.com/agent-events"
headers = {
"Content-Type": "application/json",
"Tenant-Id": "YOUR_TENANT_ID"
}
data = {
"path": "/local-test",
"ip": "87.250.224.230",
"userAgent": "Mozilla/5.0 (compatible; YandexNews/4.0; +http://yandex.com/bots)",
"eventTime": "2026-04-29T15:12:17.836Z",
"sourceId": "hardal"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://analytics.usehardal.com/agent-events", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Tenant-Id": "YOUR_TENANT_ID"
},
body: JSON.stringify({
"path": "/local-test",
"ip": "87.250.224.230",
"userAgent": "Mozilla/5.0 (compatible; YandexNews/4.0; +http://yandex.com/bots)",
"eventTime": "2026-04-29T15:12:17.836Z",
"sourceId": "hardal"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"path": "/local-test",
"ip": "87.250.224.230",
"userAgent": "Mozilla/5.0 (compatible; YandexNews/4.0; +http://yandex.com/bots)",
"eventTime": "2026-04-29T15:12:17.836Z",
"sourceId": "hardal"
}`)
req, err := http.NewRequest("POST", "https://analytics.usehardal.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.usehardal.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": "/local-test",
"ip": "87.250.224.230",
"userAgent": "Mozilla/5.0 (compatible; YandexNews/4.0; +http://yandex.com/bots)",
"eventTime": "2026-04-29T15:12:17.836Z",
"sourceId": "hardal"
}'
response = http.request(request)
puts response.body
{}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
POST
/agent-events
POST
Base URLstring
Target server for requests. Edit to use your own host.
Content-Typestring
RequiredThe media type of the request body
Options: application/json
header
Tenant-Idstring
RequiredYour Tenant ID from the Hardal dashboard.
pathstring
RequiredRequested path on the website.
ipstring
RequiredVisitor IP address.
userAgentstring
RequiredRaw User-Agent header from the request.
eventTimestring
RequiredRequest time in ISO 8601 format.
Format: date-time
sourceIdstring
RequiredYour Source ID from the Hardal dashboard.
Request Preview
Response
Response will appear here after sending the request
Headers
Body
application/json
userAgentstring
RequiredRaw User-Agent header from the request.
Example:
Mozilla/5.0 (compatible; YandexNews/4.0; +http://yandex.com/bots)Responses
Agent event received successfully.
Invalid request — missing required field or malformed payload.
Missing or invalid Tenant ID.
Was this page helpful?