Skip to main content
Called by script.js when an agent submits a form or when a page view is detected from a known AI user-agent. Also callable directly from your own code.

Request

POST https://openhermit.com/api/events
Content-Type: application/json
{
  "api_key": "YOUR_API_KEY",
  "event_type": "completion",
  "action_tool_name": "contact_form",
  "agent_name": "Claude",
  "page_url": "https://yoursite.com/contact"
}
FieldTypeRequiredDescription
api_keystringYesYour website’s API key
event_typestringYesview, completion, or error
action_tool_namestringNoThe tool_name of the action being tracked
agent_namestringNoName of the AI agent (from user-agent detection)
page_urlstringNoURL of the page the event occurred on

Event types

TypeWhen it’s sent
viewAn AI agent is detected on a page
completionA form is successfully submitted
errorA form submission fails

Response

{
  "success": true,
  "agent_prompt": "Form submitted. Our team responds within 24 hours.",
  "next_actions": [
    {
      "url": "https://calendly.com/example/30min",
      "label": "Book a meeting"
    }
  ]
}
The response includes any configured success_prompt (on completion) or failure_prompt (on error) so your code can forward it to the agent.

CORS

Accepts cross-origin requests (Access-Control-Allow-Origin: *).