> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agg.market/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To integrate AGG, start with Quickstart: REST (https://docs.agg.market/quickstart/rest), then Order lifecycle & statuses (https://docs.agg.market/concepts/order-lifecycle).
> Track every trade until it reaches a terminal status. Before retrying a failed or timed-out call, read Errors, retries & idempotency (https://docs.agg.market/concepts/errors).
> The API reference is generated from https://docs.agg.market/openapi/openapi.json.

# App-events

> Every user event of the connection's app, for backends. Requires an `x-app-api-key` issued for this app on the handshake. Send `{ action: "subscribe", channel: "app-events", resumeFrom? }`. Frames match the user-event channel, always carry `userId`, and are stamped with the app stream's `eventId`.



## AsyncAPI

````yaml openapi/asyncapi.json app-events
id: app-events
title: App-events
description: >-
  Every user event of the connection's app, for backends. Requires an
  `x-app-api-key` issued for this app on the handshake. Send `{ action:
  "subscribe", channel: "app-events", resumeFrom? }`. Frames match the
  user-event channel, always carry `userId`, and are stamped with the app
  stream's `eventId`.
servers:
  - id: production
    protocol: wss
    host: ws.agg.market
    bindings: []
    variables: []
address: /
parameters: []
bindings: []
operations: []
sendOperations: []
receiveOperations: []
sendMessages: []
receiveMessages: []
extensions:
  - id: x-parser-unique-object-id
    value: app-events
securitySchemes:
  - id: appId
    name: appId
    type: userPassword
    description: >-
      App-level auth: pass appId as a query parameter on connect. Required for
      all connections. Browsers are admitted by an Origin on the app's allowed
      origins; servers by the apiKey scheme instead.
    extensions: []
  - id: apiKey
    name: x-app-api-key
    type: httpApiKey
    description: >-
      Optional server-to-server auth on the handshake; any supplied key must be
      valid and replaces the Origin check. Without a key, an allowed Origin is
      required even when the app has requireApiKey for REST. WebSocket key
      enforcement is currently deferred. Needed for the app-events channel.
      Never send from a browser.
    in: header
    extensions: []
  - id: jwt
    name: jwt
    type: http
    description: >-
      User-level auth: send { action: 'authenticate', token } after connected (a
      token query param still works but is deprecated). Required for
      user-specific events (orders, balances). Same JWT as the REST API.
    scheme: bearer
    bearerFormat: JWT
    extensions: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.