Docs β€Ί AI agents & tools

Building with AI agents

How an agent discovers, authenticates and sends orders.

The API is designed so an AI agent can integrate with Dragonfly without a human in the loop: discover it, read a machine-readable contract, test in a sandbox, and send real orders once its merchant is approved.

Point your agent here

ResourceURLUse
llms.txtapi.trydragonfly.com/llms.txtOne-screen map of everything below.
Guide (markdown)api.trydragonfly.com/v1/docsPlain-text guide, ideal context for an LLM.
OpenAPI 3.1api.trydragonfly.com/v1/openapi.jsonExact request/response schemas; generate a client.
MCP serverapi.trydragonfly.com/v1/mcpTools for Claude and other MCP clients. See MCP server.
CLIapi.trydragonfly.com/v1/cliShell-friendly for coding agents. See CLI.
API indexapi.trydragonfly.com/v1JSON links to all of the above.

A prompt that works

text
You can send deliveries to Dragonfly. Read https://api.trydragonfly.com/llms.txt and
https://api.trydragonfly.com/v1/openapi.json. Use the API key in DRAGONFLY_API_KEY.
For each order: POST /v1/orders with our order number as externalId, the pickup,
the dropoff (address, name, mobile phone, delivery window with a time-zone offset).
Retry on network errors with the same externalId. Report the orderId and status.

Rules agents should follow

  • Use externalId = your own order number, so retries never double-book a driver.
  • Every stop needs a reachable contactPhone.
  • Send windows as ISO 8601 with an offset (2026-10-09T10:30:00-07:00).
  • On 400 VALIDATION_ERROR, read error.details[] (each entry has path and message), fix those fields and resend.
  • Don't poll more than once a minute per order. Prefer webhooks.
  • Never print or log the API key.

Sandbox first

An agent can create its own sandbox account and key in one call ("sandbox": true; see Quickstart) and exercise the full lifecycle before a human requests production access.

Something unclear or missing? Tell us.