@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api The Mercure protocol
@version 0.3.2
@auth Bearer bearer | ApiKey mercureAuthorization in cookie
@endpoints 5
@toc .well-known(5)

@endpoint GET /.well-known/mercure
@desc Subscribe to updates
@required {topic: [str] # The topic to get updates from, can be a URI template (RFC6570).}
@optional {Last-Event-ID: str # The last received event id, to retrieve missed events., Last-Event-ID: str # The last received event id, to retrieve missed events, takes precedence over the query parameter.}
@returns(200) Event stream opened.
@errors {400: Missing topic parameter or invalid URI template., 401: Not authorized (missing or invalid JWT).}

@endpoint POST /.well-known/mercure
@desc Publish an update
@returns(200) The id of this update
@errors {400: Invalid request, 401: Not authorized (missing or invalid JWT).}

@endpoint GET /.well-known/mercure/subscriptions
@desc Active subscriptions
@returns(200) The list of active subscriptions
@errors {401: Not authorized (missing or invalid JWT).}

@endpoint GET /.well-known/mercure/subscriptions/{topic}
@desc Active subscriptions for the given topic
@required {topic: str}
@returns(200) The list of active subscriptions
@errors {401: Not authorized (missing or invalid JWT).}

@endpoint GET /.well-known/mercure/subscriptions/{topic}/{subscriber}
@desc Active subscription for the given topic and subscriber
@required {topic: str, subscriber: str}
@returns(200) The list of active subscriptions
@errors {401: Not authorized (missing or invalid JWT).}

@end
