tiempoAPI reference
Start here

Build a booking app with Claude Code, Cursor or Lovable

Ask a coding agent for a salon or court-booking app and it will write its own scheduler: a table of appointments and a check for overlaps before each insert. That works in the demo and double-books in production, when two customers check at the same moment, when a payment takes longer than expected, or when the clocks change. Here’s why.

Give the agent Tiempo instead. Two things help it get it right first time: a rules file in your project, and a prompt that says what Tiempo is for.

The rules file

It tells the agent where Tiempo’s docs are, how your app’s ideas map onto it (shops are accounts, staff are resources, a service is a duration), the booking flow, and the mistakes to avoid. It’s plain HTTP, so it works in any language and framework.

Download it into your project, or copy it from here:

curl -o AGENTS.md https://tiempo.one/tiempo-rules.md

Where it goes

  • Claude Code: save it as CLAUDE.md in the project root, or keep it as AGENTS.md and add the line @AGENTS.md to your CLAUDE.md.
  • Cursor: add it as a project rule, .cursor/rules/tiempo.mdc, with alwaysApply: true.
  • Codex, Zed and other agents that read AGENTS.md: keep it in the project root.
  • Lovable, Bolt and v0: paste it into the project’s knowledge or instructions. Keep the Tiempo key in a server-side secret (an edge function or API route), never in the browser.

A starter prompt

Name Tiempo, point at llms.txt, and describe the flow in your own words: who the businesses are, what gets booked, and when payment happens. Get a test key from sign-up and put it in TIEMPO_KEY before the agent starts.

For classes, courts or a chain of shops, swap in the matching guide: classes, courts and rooms, multi-location.

Check what it built

Agents drift. Before you ship, check that the code:

  • Gets open times from POST /v1/availability, and has no overlap query or slot table of its own.
  • Holds before taking payment and confirms after, so two customers paying at once can’t both win the slot.
  • Sends an Idempotency-Key on every POST and handles 409 booking_conflict by offering other times.
  • Keeps the key on the server, and verifies Tiempo-Signature on webhooks before trusting them.
  • Stores times as UTC instants and converts with the business’s timezone only for display.

Then run the race yourself: the test harness in the dashboard books the same slot twice and shows the refusal. The testing guide has more.