§ For agents · Calendar API

A calendar API built for AI agents.

AgentDraft is the calendar API your agent calls when it has to share a calendar with other agents. One HTTP request commits a booking; the conflict engine resolves races against every other agent on the same calendar deterministically and returns a typed 409 to whichever agents lose.

Updated


§ 01The shortest possible example

Commit a booking. The endpoint accepts a slot and an agent key, runs the conflict engine, and either writes the booking or tells the agent who outranked it.

# pip install agentdraft
from agentdraft import Client, Conflict

agent = Client(api_key="avs_live_...")

try:
    booking = agent.bookings.create(
        user_id="u_abc",
        start="2026-06-01T14:00:00Z",
        end="2026-06-01T14:30:00Z",
        title="Intro call",
    )
    # 201 COMMITTED — exactly one agent reaches here per slot
except Conflict as c:
    # 409 — c.winning_agent / c.winning_priority / c.audit_id
    # fall back: pick another slot, ask the user, or wait.
    ...

TypeScript, REST, LangChain, and MCP examples are in the docs.


§ 02Why a calendar API for AI agents at all

Calendar APIs were designed for one writer at a time. Google Calendar, Microsoft Graph, CalDAV — none of them expose a slot-level compare-and-swap. An agent's "check availability" and an agent's "commit booking" are two separate network calls, and other agents can complete their own check-and-write between them. Two agents both pass the availability check; both succeed in writing; the human ends up with overlapping events. We call that a multi-agent calendar collision and it gets more common every month.

AgentDraft is a thin coordination layer in front of whichever calendar your agents already write to. The atomic guarantee lives at the storage layer (DynamoDB conditional writes), not in application code, so the check is the write. Every booking is a single TransactWriteItems across one row per time bucket — exactly one writer wins per slot, every loser gets a typed 409 carrying the winner's identity, priority, and audit reference.


§ 03What the API surface looks like
EndpointWhat it does
GET /v1/availabilityList the slots open to this agent between two times. Excludes any hold that outranks this agent.
POST /v1/bookingsRun the conflict engine and commit a booking. Returns 201 COMMITTED or 409 Conflict.
POST /v1/holdsReserve a slot tentatively while the agent confirms with a human. Expires automatically.
POST /v1/webhooks/bookingSubscribe to booking.committed, booking.evicted, booking.cancelled. HMAC-signed.
GET /v1/auditRead the append-only audit log. Holds, commits, evictions, rule changes — all of it.

Full reference in the docs; the formal contract is on the protocol spec page.


§ 04Where it fits in the stack
agent-1 ────┐
agent-2 ────┼──▶  AgentDraft  ──▶  Google / M365 / CalDAV
agent-3 ────┘    (coordinate)     (store)

Every agent that needs to write to a user's calendar calls AgentDraft first. The conflict engine resolves the race; exactly one agent gets 201 COMMITTED back. That agent's write propagates to the underlying calendar through whichever connector the user is on. The losing agents never reach the calendar at all, so the availability surfaces stay coherent.


§ 05Frequently asked
How is this different from the Google Calendar API or the Calendly API?

Google Calendar and Calendly were built for one writer at a time. Neither exposes a slot-level compare-and-swap, so two agents that both pass an availability check can both succeed in writing. AgentDraft sits in front of them and resolves the race with a storage-level conditional write — the check is the write.

Which frameworks does it work with?

Any framework that can make an HTTP call. First-party SDKs for Python and TypeScript; agentdraft-langchain for LangChain, LangGraph, CrewAI, and AutoGen; an MCP server (agentdraft-mcp) for Claude Desktop, Cursor, and Cline.

Do I have to migrate my calendar to AgentDraft?

No. AgentDraft connects to the calendar you already use — Google Calendar, Microsoft 365, Apple iCloud via CalDAV, Fastmail, generic CalDAV. The winner's write propagates to whichever calendar the user is on; AgentDraft is not a calendar store.

What happens when an agent loses a race?

The losing agent gets HTTP 409 with the winner's id, priority, and an audit reference. With the LangChain ConflictAwareBookingTool this comes back as a plain-language message the LLM can react to — usually by picking another slot or asking the user.

What does it cost?

Individual starts at $10/month, and Team is $25/month for shared priority resolution. Meters mailboxes and bookings together — see pricing.


§ 06Further reading