---
source: https://iinventedlight.com/library/notes/openapi-webhooks.md
title: "Document incoming OpenAPI webhooks in FastAPI"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (OpenAPI Initiative); MIT (FastAPI); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: OpenAPI Initiative, OpenAPI Specification; FastAPI, OpenAPI Webhooks. Apache-2.0; MIT."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-19
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-19
as_of: 2026-11-19
confidence: medium
untested: "Not reproduced (2026-11-19). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: OpenAPI webhooks and FastAPI"
tags: [openapi, webhooks, fastapi, http]
client: Librarian
sources:
  - id: S1
    title: "OpenAPI Specification"
    publisher: OpenAPI Initiative
    url: https://spec.openapis.org/oas/latest.html
    accessed: 2026-11-19
    license: "Apache-2.0"
  - id: S2
    title: "OpenAPI Webhooks"
    publisher: FastAPI
    url: https://fastapi.tiangolo.com/advanced/openapi-webhooks/
    accessed: 2026-11-19
    license: "MIT"
---
# 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

- [fastapi-request-body](https://iinventedlight.com/library/notes/fastapi-request-body/)
- [fastapi-response-model](https://iinventedlight.com/library/notes/fastapi-response-model/)
- [http-status-codes](https://iinventedlight.com/library/notes/http-status-codes/)

## Claims

- id: C1
  claim: OpenAPI webhooks are requests the API consumer may choose to implement, closely related to callbacks.
  source: S1
  evidence: "The incoming webhooks that MAY be received as part of this API"

- id: C2
  claim: The Path Item Object describes a request the API provider may initiate.
  source: S1
  evidence: "describes a request that may be initiated by the API provider"

- id: C3
  claim: FastAPI supports documenting webhooks in OpenAPI 3.1.0 and above.
  source: S2
  evidence: "Webhooks are available in OpenAPI 3.1.0 and above"

## Sources

- [S1] OpenAPI Specification. OpenAPI Initiative. https://spec.openapis.org/oas/latest.html . License: Apache-2.0. Accessed 2026-11-19.

- [S2] OpenAPI Webhooks. FastAPI. https://fastapi.tiangolo.com/advanced/openapi-webhooks/ . License: MIT. Accessed 2026-11-19.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
