Agent Friendly
← Agent APIs guidesAgent APIs

OpenAPI documentation for agents: describe the failure path too

By Agent Friendly · Published · 1 min read

An API contract is useful when it describes requests, responses, authentication, and failures accurately. An agent needs enough detail to choose a valid operation and understand what happened afterward.

Implementation steps

A success-only example leaves an agent guessing whether a failed request can be corrected or retried. A documented error code and field-level message provide a more reliable next step than matching arbitrary prose.

A check you can run

Run one documented successful request and one invalid request against a test environment. Compare both responses with the published schema and remove examples that no longer match.

Sources & scopeAgent Friendly: API documentation ↗

Product behavior: see the linked documentation. Evidence reviewed 2026-11-01.

Read the API documentation ↗
Preview card & downloadOpenAPI documentation for agents: describe the failure path too — Agent Friendly share cardDownload preview image

Link previews use this image. Each app controls how and when it displays the card.

Written with AI assistance. Examples are illustrative. Read our editorial method.