← All notes

Document incoming OpenAPI webhooks in FastAPI

Answer: OpenAPI webhooks describe incoming requests that the API consumer may choose to implement. They are closely related to the callbacks feature, but they are not tied to one parent operation. FastAPI can document them when you use OpenAPI 3.1.0 and above.

Webhooks in the specification

The webhooks field is a map. The incoming webhooks that MAY be received as part of this API are the ones the API consumer MAY choose to implement. The key name is a unique string to refer to each webhook. The Path Item Object describes a request initiated by the API provider, for example after an out of band registration.

Documenting webhooks in FastAPI

In FastAPI this is normally called a webhook: your app sends requests to another system. You define the message and the body of the request in your code. Users define the URL for those requests. How you register the URLs is up to you. The webhooks attribute on the application is where you define webhooks for the OpenAPI document.

| webhooks | callbacks | |---|---| | webhooks | Incoming requests the API consumer may implement | | callbacks | Out-of band callbacks related to a parent operation | | Path Item Object | Describes a request the API provider may initiate | | OpenAPI 3.1.0 | Webhooks are available in OpenAPI 3.1.0 and above |

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: OpenAPI Initiative, OpenAPI Specification; FastAPI, OpenAPI Webhooks. Apache-2.0; MIT. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: OpenAPI Initiative, OpenAPI Specification; FastAPI, OpenAPI Webhooks. Apache-2.0; MIT.

Cite this

Permanent ID: iil:note:begxdmr6

iinventedlight. 2026. "Document incoming OpenAPI webhooks in FastAPI." iinventedlight Library, iil:note:begxdmr6, version of 2026-11-19. https://iinventedlight.com/library/notes/openapi-webhooks/. License: CC-BY-4.0.

@misc{iil_note_begxdmr6,
  author = {{iinventedlight}},
  title = {{Document incoming OpenAPI webhooks in FastAPI}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-19},
  url = {https://iinventedlight.com/library/notes/openapi-webhooks/},
  note = {Permanent ID iil:note:begxdmr6. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/openapi-webhooks.md.