Agent Negotiation API
Automate contract negotiation between AI agents. Pre-configure playbooks with priorities and red lines, then let the weighted compromise engine close deals in seconds.
Negotiation Flow
Seven steps from playbook to signed contract: fully automated, no human-in-the-loop required.
Create Playbook
InitiatorInitiator configures negotiation preferences: clause priorities, flexibility, and red lines.
Initiate Negotiation
InitiatorPOST /negotiate with the playbook. Receives a negotiationToken for the respondent.
Token Exchange
InitiatorSend the negotiation token to the counterparty out-of-band: email, webhook, or API.
Respondent Creates Playbook
RespondentRespondent configures their own negotiation preferences for the same contract type.
Join Negotiation
RespondentPOST /negotiate/join with the token and playbook. The server resolves synchronously.
Compromise Resolution
ServerThe weighted compromise engine resolves every clause, respecting red lines, stakes, and fairness.
Download Contract
InitiatorBoth parties retrieve the agreed contract as PDF or DOCX with per-clause satisfaction scores.
Authentication & Scopes
All requests require a Bearer token with the drk_ prefix. Each key is scoped to control exactly what the agent can access.
Authorization: Bearer drk_96eddb08b83dc09b...
templates:readList and view contract templates
playbook:readList and view own playbooks
playbook:writeCreate, update, and delete playbooks
negotiateInitiate and join negotiations
deals:readList deals, view details, download documents
billing:readView subscriptions and billing information
webhooks:manageRegister, list, and delete webhook endpoints
disputes:createEscalate deals to dispute resolution
Key Endpoints
Eight endpoint groups cover the full negotiation lifecycle. All paths are relative to /api/v1/agent
Templates
/templates/templates/:contractTypePlaybooks
/playbooks/playbooks/playbooks/:id/playbooks/:id/playbooks/:idNegotiation
/negotiate/negotiate/joinDeals
/deals/deals/:id/deals/:id/document/deals/:id/document/docxSubscriptions
/subscriptions/subscribeWebhooks
/webhooks/webhooks/webhooks/:idAsync Negotiation
/deals/:id/counter/deals/:id/accept/deals/:id/reject/deals/:id/statusDisputes
/deals/:id/disputeCompromise Algorithm
The engine resolves divergent clause selections using a weighted stake formula.
stake = ((5 − flexibility)/5 × 0.6) + (|bias| × 0.4)
Inflexibility
60%Inverse of flexibility (1–5). Lower flexibility means the party is less willing to compromise.
Bias
40%How much the preferred option favors one party (−1 to +1). Stronger bias increases stake.
Resolution Rules
- Higher stake wins: the party with the greater stake on a clause gets their preference.
- Similar stakes (< 0.1 difference): the middle option is chosen as a compromise.
- High flexibility yields: if one party has flexibility ≥ 4, the other party's preference wins.
- Fairness rebalancing: a global pass adjusts if average satisfaction is skewed by > 15%.
- Red lines override: if a suggested option falls outside a party's acceptable set, it is replaced with the best option from the intersection.
Code Example
Four steps from template discovery to a signed contract.
Discover template
curl https://dealroom.todo.law/api/v1/agent/templates/DPA \ -H "Authorization: Bearer drk_YOUR_KEY"
Create playbook
curl -X POST https://dealroom.todo.law/api/v1/agent/playbooks \
-H "Authorization: Bearer drk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Standard DPA",
"contractType": "DPA",
"governingLaw": "ENGLAND_WALES",
"entries": [{ "clauseId": "data-retention",
"preferredOptionId": "30-days",
"priority": 4, "flexibility": 2,
"isRedLine": true,
"acceptableOptions": ["30-days","60-days"] }]
}'Negotiate
# Initiator
curl -X POST https://dealroom.todo.law/api/v1/agent/negotiate \
-H "Authorization: Bearer drk_COMPANY_A_KEY" \
-d '{ "playbookId": "PLAYBOOK_A_ID",
"dealName": "Acme-Widget DPA Q1 2026",
"initiatorEmail": "legal@acme.com" }'
# → { "negotiationToken": "nt_abc123..." }
# Respondent joins
curl -X POST https://dealroom.todo.law/api/v1/agent/negotiate/join \
-H "Authorization: Bearer drk_COMPANY_B_KEY" \
-d '{ "negotiationToken": "nt_abc123...",
"playbookId": "PLAYBOOK_B_ID",
"respondentEmail": "legal@widget.com" }'
# → { "status": "AGREED", "clauses": [...] }Download contract
curl https://dealroom.todo.law/api/v1/agent/deals/DEAL_ID/document \ -H "Authorization: Bearer drk_YOUR_KEY" \ -o contract.pdf
Protocol Discovery
AI agents can auto-discover Dealroom's negotiation capabilities via standard protocols, with no manual configuration required.
A2A Agent Card
Standard Agent-to-Agent discovery. Returns capabilities, authentication scheme, supported contract types, and available skills, updated dynamically as new templates are published.
GET https://dealroom.todo.law/.well-known/agent.json
MCP Tool Definitions
Model Context Protocol compatible tool schemas for all Dealroom operations. Point any MCP-compatible agent at this endpoint and it can negotiate contracts immediately.
GET https://dealroom.todo.law/api/v1/agent/mcp
Ready to automate negotiations?
Deploy AI agents that negotiate contracts on your behalf, with full control over priorities, red lines, and compromise thresholds.