What is AsyncAPI? A minimal 3.0 document, linted and rendered
Last checked and updated
AsyncAPI is a specification for describing message-driven APIs in a YAML or JSON file. Where an OpenAPI document lists the requests a server answers, an AsyncAPI document lists the channels an application uses, the messages that travel on them, and the operations the application performs: it sends to a channel or receives from one. The current major version is 3 (3.0.0, and 3.1.0 since January 2026); 2.x documents can still be linted and rendered, and the migration page shows the changes.
Events, not requests
The two specifications say what they describe in their first lines. OpenAPI 3.1.1: "a standard, programming language-agnostic interface description for HTTP APIs". AsyncAPI 3.0.0: "a project used to describe message-driven APIs in a machine-readable format. It's protocol-agnostic, so you can use it for APIs that work over any protocol (e.g., AMQP, MQTT, WebSockets, Kafka, STOMP, HTTP, Mercure, etc)."
| OpenAPI | AsyncAPI 3.0 | |
|---|---|---|
| Describes | HTTP requests and their responses | Messages sent to and received from channels |
| Main unit | A path and a method: GET /orders/{id} | A channel (orders.created) and an operation on it |
| Who acts | A client calls; the server answers | The application sends (action: send) or receives (action: receive) |
| Where it runs | An HTTP server | A broker or any server: AMQP, MQTT, Kafka, WebSocket... |
| Payload schemas | Schema Object | Schema Object, or another format (Avro, ...) through a Multi Format Schema Object |
An AsyncAPI document describes one application from its own side. The specification is explicit that the other side is not the mirror image: "It's NOT RECOMMENDED to derive a receiver AsyncAPI document from a sender one or vice versa."
A minimal AsyncAPI 3.0 document
An order service that sends one event:
asyncapi: 3.0.0
info:
title: Orders events
version: 1.0.0
channels:
orderCreated:
address: orders.created
messages:
orderCreated:
payload:
type: object
properties:
orderId:
type: string
total:
type: number
operations:
publishOrderCreated:
action: send
channel:
$ref: '#/channels/orderCreated'
Three parts do the work. channels.orderCreated is the channel: its key is an identifier inside the document, and address is the name on the broker. messages lists what may travel on it, here one message with a JSON payload. operations.publishOrderCreated says that this application sends to that channel; channel must be a $ref to it. The only required fields in the root object are asyncapi and info, and info needs title and version. Channels, operations and messages builds the structure up part by part.
What a linter says about it
The document is valid, so a linter reports no errors, only advice:
$ apigit lint asyncapi.yaml
asyncapi.yaml
1:1 warn asyncapi-servers AsyncAPI object must have non-empty "servers" object.
1:11 info asyncapi-latest-version The latest version is not used. You should update to the "3.1.0" version. (asyncapi)
2:6 warn asyncapi-3-tags AsyncAPI document must have non-empty "tags" array. (info)
2:6 warn asyncapi-info-contact Info object must have "contact" object. (info)
2:6 warn asyncapi-info-description Info "description" must be present and non-empty string. (info)
2:6 warn asyncapi-info-license Info object must have "license" object. (info)
18:23 warn asyncapi-3-operation-description Operation "description" must be present and non-empty string. (operations.publishOrderCreated)
7 problems (0 errors, 6 warnings, 1 info, 0 hints)
The exit code is 0: by default only errors fail the run. The warnings come from Spectral's AsyncAPI rules, which ask for what a reader of the documentation needs (a description, a contact, a server to connect to) rather than what the specification requires. With a description, a contact, a license, a tag, a server and an operation description added, one finding is left:
$ apigit lint asyncapi.yaml
asyncapi.yaml
1:11 info asyncapi-latest-version The latest version is not used. You should update to the "3.1.0" version. (asyncapi)
1 problem (0 errors, 0 warnings, 1 info, 0 hints)
and with asyncapi: 3.1.0 the same file prints No problems found. Lint an AsyncAPI file has every rule with its fix.
How it renders
Rendered as documentation (here with apigit preview, which uses the viewer of APIGit's published pages), the complete version of the file shows the title, version and description; the contact, the license and the server broker.example.com:5672; then the channel orders.created with "Accepts the following message:", the orderCreated payload as a table of fields with a generated sample ({"orderId": "string", "total": 0}), and the operation publishOrderCreated under Send, with its description. Publish AsyncAPI documentation shows the commands.
Where to go next
- AsyncAPI channels, operations and messages: each part, and the lint finding when it is wrong
- Migrate from AsyncAPI 2.6 to 3.0: the same API in both versions
- GraphQL and OpenAPI in one repository: an AsyncAPI file can sit beside them, linted and published the same way