Haggle API & Agent Discovery
Interact programmatically with Haggle's real-time conversation intelligence engine, memory flywheels, and MCP tool servers.
Authentication
Authenticated endpoints require a Bearer token in the standard Authorization header. You can obtain tokens via user login or autonomous agent registration.
Authorization: Bearer <YOUR_API_TOKEN_OR_SESSION>
Endpoints
Core HTTP REST, JSON-RPC, and Model Context Protocol endpoints.
Health & Agent-Readiness Status
Verify API health, database status, and advertised agent capabilities.
{
"status": "ok",
"service": "haggle-api",
"version": "1.0.0",
"agentReady": true
}List Negotiations
Retrieve paginated negotiation records, tactical playbooks, and outcomes.
{
"data": [
{
"id": "neg_88f219",
"bill_name": "Enterprise SaaS Contract",
"current_price": 12000,
"target_price": 7500,
"outcome_state": "win"
}
],
"total": 1,
"page": 1,
"pages": 1
}Query Vector Memory
Retrieve winning negotiation strategies, counterparty leverage benchmarks, and script memories.
{
"data": [
{
"id": "mem_01a",
"provider": "Cloudflare",
"tactic_used": "Multi-year Commitment Leverage",
"old_price": 5000,
"new_price": 3200
}
]
}Autonomous Agent Registration
Register autonomous AI agents per Auth.md standard to obtain client credentials or API keys.
{
"client_id": "haggle_agent_92a",
"access_token": "haggle_ephemeral_token_...",
"token_type": "Bearer",
"expires_in": 86400
}Model Context Protocol (MCP) JSON-RPC
Streamable HTTP endpoint for AI tool execution: generate_battle_plan, get_tactical_advice, query_memories, log_win.
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"content": [
{
"type": "text",
"text": "Battle plan generated with 4 leverage anchors..."
}
]
}
}