> ## 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.

# Catalog

> New, changed and deleted events and markets, one `catalog_change` frame per entity carrying its current state. Send `{ action: "subscribe", channel: "catalog", venues?, entities? }`; no user auth required, and the app's disabled venues and categories apply. Subscribing again replaces the filter.

**Live only, no replay.** Subscribe first, then catch up with `GET /catalog/changes` (same item shape) from your last `changedAt` minus a minute, then apply buffered frames. Apply an item when its `(version, changedAt)` is newer than what you hold for `(entity, id)`; duplicates around the catch-up are expected. On `stream_interrupted` listing `catalog`, catch up over REST again.



## AsyncAPI

````yaml openapi/asyncapi.json catalog
id: catalog
title: Catalog
description: >-
  New, changed and deleted events and markets, one `catalog_change` frame per
  entity carrying its current state. Send `{ action: "subscribe", channel:
  "catalog", venues?, entities? }`; no user auth required, and the app's
  disabled venues and categories apply. Subscribing again replaces the filter.


  **Live only, no replay.** Subscribe first, then catch up with `GET
  /catalog/changes` (same item shape) from your last `changedAt` minus a minute,
  then apply buffered frames. Apply an item when its `(version, changedAt)` is
  newer than what you hold for `(entity, id)`; duplicates around the catch-up
  are expected. On `stream_interrupted` listing `catalog`, catch up over REST
  again.
servers:
  - id: production
    protocol: wss
    host: ws.agg.market
    bindings: []
    variables: []
address: /
parameters: []
bindings: []
operations:
  - &ref_2
    id: subscribeCatalog
    title: Subscribe catalog
    description: Subscribe to (or unsubscribe from) catalog changes
    type: send
    messages:
      - &ref_4
        id: subscribe
        payload:
          - name: Subscribe to catalog changes
            description: >-
              Subscribe (or unsubscribe) to new, changed and deleted events and
              markets
            type: object
            properties:
              - name: action
                type: string
                required: true
              - name: channel
                type: string
                description: catalog
                required: true
              - name: venues
                type: array
                description: Only changes for these venues (deletes always pass)
                required: false
                properties:
                  - name: item
                    type: string
                    required: false
              - name: entities
                type: array
                description: Only these entity kinds (default both)
                required: false
                properties:
                  - name: item
                    type: string
                    required: false
              - name: id
                type: anyOf
                description: >-
                  Optional request id, echoed on the ack and on errors caused by
                  this frame
                required: false
        headers: []
        jsonPayloadSchema:
          title: CatalogSubscribe
          type: object
          required:
            - action
            - channel
          properties:
            action:
              anyOf:
                - const: subscribe
                  type: string
                  x-parser-schema-id: <anonymous-schema-394>
                - const: unsubscribe
                  type: string
                  x-parser-schema-id: <anonymous-schema-395>
              x-parser-schema-id: <anonymous-schema-393>
            channel:
              const: catalog
              type: string
              x-parser-schema-id: <anonymous-schema-396>
            venues:
              description: Only changes for these venues (deletes always pass)
              type: array
              items:
                type: string
                x-parser-schema-id: <anonymous-schema-398>
              x-parser-schema-id: <anonymous-schema-397>
            entities:
              description: Only these entity kinds (default both)
              type: array
              items:
                anyOf:
                  - const: event
                    type: string
                    x-parser-schema-id: <anonymous-schema-401>
                  - const: market
                    type: string
                    x-parser-schema-id: <anonymous-schema-402>
                x-parser-schema-id: <anonymous-schema-400>
              x-parser-schema-id: <anonymous-schema-399>
            id:
              description: >-
                Optional request id, echoed on the ack and on errors caused by
                this frame
              anyOf:
                - type: string
                  x-parser-schema-id: <anonymous-schema-404>
                - type: number
                  x-parser-schema-id: <anonymous-schema-405>
              x-parser-schema-id: <anonymous-schema-403>
          x-parser-schema-id: <anonymous-schema-392>
        title: Subscribe to catalog changes
        description: >-
          Subscribe (or unsubscribe) to new, changed and deleted events and
          markets
        example: |-
          {
            "action": "subscribe",
            "channel": "catalog",
            "venues": [
              "string"
            ],
            "entities": [
              "event"
            ],
            "id": "string"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: catalog
  - &ref_1
    id: receiveCatalogChange
    title: Receive catalog change
    description: Current state of a created, updated or deleted event or market
    type: receive
    messages:
      - &ref_3
        id: catalogChange
        payload:
          - name: Catalog change
            description: >-
              One event or market's current state. op is created, updated or
              deleted; deletes carry only the id. Same item shape as GET
              /catalog/changes.
            type: object
            properties:
              - name: type
                type: string
                description: catalog_change
                required: true
              - name: entity
                type: string
                required: true
              - name: id
                type: string
                required: true
              - name: op
                type: string
                required: true
              - name: version
                type: number
                description: Structural version; increases on every structural write
                required: true
              - name: changedAt
                type: string
                description: ISO time of the latest structural change
                required: true
              - name: venue
                type: string
                description: Null only on deletes
                required: true
              - name: event
                type: object
                required: false
                properties:
                  - name: id
                    type: string
                    required: true
                  - name: venue
                    type: string
                    required: true
                  - name: externalIdentifier
                    type: string
                    required: true
                  - name: title
                    type: string
                    required: true
                  - name: slug
                    type: string
                    required: true
                  - name: status
                    type: string
                    required: true
                  - name: startDate
                    type: string
                    required: true
                  - name: endDate
                    type: string
                    required: true
                  - name: createdAt
                    type: string
                    required: true
                  - name: categories
                    type: array
                    required: true
                    properties:
                      - name: id
                        type: string
                        required: true
                      - name: name
                        type: string
                        required: true
                  - name: matched
                    type: boolean
                    description: Matched or verified to at least one other venue
                    required: true
                  - name: clusterAnchorId
                    type: string
                    description: >-
                      The matched cluster's anchor id (the row list endpoints
                      fold members into); equals `id` for the anchor, null when
                      unmatched. Anchors can change — key storage on `id`.
                    required: true
                  - name: clusterVenues
                    type: array
                    description: >-
                      Venues in the matched cluster; just this venue when
                      unmatched
                    required: true
                    properties:
                      - name: item
                        type: string
                        required: false
              - name: market
                type: object
                required: false
                properties:
                  - name: id
                    type: string
                    required: true
                  - name: venueEventId
                    type: string
                    required: true
                  - name: venue
                    type: string
                    required: true
                  - name: externalIdentifier
                    type: string
                    required: true
                  - name: question
                    type: string
                    required: true
                  - name: shortTitle
                    type: string
                    required: true
                  - name: status
                    type: string
                    required: true
                  - name: startDate
                    type: string
                    required: true
                  - name: endDate
                    type: string
                    required: true
                  - name: createdAt
                    type: string
                    required: true
                  - name: outcomes
                    type: array
                    required: true
                    properties:
                      - name: id
                        type: string
                        description: >-
                          venueMarketOutcomeId — subscribe orderbook/trades with
                          it
                        required: true
                      - name: label
                        type: string
                        required: true
                      - name: title
                        type: string
                        required: true
                  - name: categories
                    type: array
                    description: The parent event's categories
                    required: true
                    properties:
                      - name: id
                        type: string
                        required: true
                      - name: name
                        type: string
                        required: true
                  - name: matched
                    type: boolean
                    description: Matched or verified to at least one other venue
                    required: true
                  - name: clusterAnchorId
                    type: string
                    description: >-
                      The matched cluster's anchor id (the row list endpoints
                      fold members into); equals `id` for the anchor, null when
                      unmatched. Anchors can change — key storage on `id`.
                    required: true
                  - name: clusterVenues
                    type: array
                    description: >-
                      Venues in the matched cluster; just this venue when
                      unmatched
                    required: true
                    properties:
                      - name: item
                        type: string
                        required: false
        headers: []
        jsonPayloadSchema:
          title: CatalogChange
          type: object
          required:
            - type
            - entity
            - id
            - op
            - version
            - changedAt
            - venue
          properties:
            type:
              const: catalog_change
              type: string
              x-parser-schema-id: <anonymous-schema-407>
            entity:
              anyOf:
                - const: event
                  type: string
                  x-parser-schema-id: <anonymous-schema-409>
                - const: market
                  type: string
                  x-parser-schema-id: <anonymous-schema-410>
              x-parser-schema-id: <anonymous-schema-408>
            id:
              type: string
              x-parser-schema-id: <anonymous-schema-411>
            op:
              anyOf:
                - const: created
                  type: string
                  x-parser-schema-id: <anonymous-schema-413>
                - const: updated
                  type: string
                  x-parser-schema-id: <anonymous-schema-414>
                - const: deleted
                  type: string
                  x-parser-schema-id: <anonymous-schema-415>
              x-parser-schema-id: <anonymous-schema-412>
            version:
              description: Structural version; increases on every structural write
              type: number
              x-parser-schema-id: <anonymous-schema-416>
            changedAt:
              description: ISO time of the latest structural change
              type: string
              x-parser-schema-id: <anonymous-schema-417>
            venue:
              description: Null only on deletes
              anyOf:
                - type: string
                  x-parser-schema-id: <anonymous-schema-419>
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-420>
              x-parser-schema-id: <anonymous-schema-418>
            event:
              type: object
              required:
                - id
                - venue
                - externalIdentifier
                - title
                - slug
                - status
                - startDate
                - endDate
                - createdAt
                - categories
                - matched
                - clusterAnchorId
                - clusterVenues
              properties:
                id:
                  type: string
                  x-parser-schema-id: <anonymous-schema-422>
                venue:
                  type: string
                  x-parser-schema-id: <anonymous-schema-423>
                externalIdentifier:
                  type: string
                  x-parser-schema-id: <anonymous-schema-424>
                title:
                  type: string
                  x-parser-schema-id: <anonymous-schema-425>
                slug:
                  anyOf:
                    - type: string
                      x-parser-schema-id: <anonymous-schema-427>
                    - type: 'null'
                      x-parser-schema-id: <anonymous-schema-428>
                  x-parser-schema-id: <anonymous-schema-426>
                status:
                  type: string
                  x-parser-schema-id: <anonymous-schema-429>
                startDate:
                  type: string
                  x-parser-schema-id: <anonymous-schema-430>
                endDate:
                  anyOf:
                    - type: string
                      x-parser-schema-id: <anonymous-schema-432>
                    - type: 'null'
                      x-parser-schema-id: <anonymous-schema-433>
                  x-parser-schema-id: <anonymous-schema-431>
                createdAt:
                  type: string
                  x-parser-schema-id: <anonymous-schema-434>
                categories:
                  type: array
                  items:
                    type: object
                    required:
                      - id
                      - name
                    properties:
                      id:
                        type: string
                        x-parser-schema-id: <anonymous-schema-437>
                      name:
                        type: string
                        x-parser-schema-id: <anonymous-schema-438>
                    x-parser-schema-id: <anonymous-schema-436>
                  x-parser-schema-id: <anonymous-schema-435>
                matched:
                  description: Matched or verified to at least one other venue
                  type: boolean
                  x-parser-schema-id: <anonymous-schema-439>
                clusterAnchorId:
                  description: >-
                    The matched cluster's anchor id (the row list endpoints fold
                    members into); equals `id` for the anchor, null when
                    unmatched. Anchors can change — key storage on `id`.
                  anyOf:
                    - type: string
                      x-parser-schema-id: <anonymous-schema-441>
                    - type: 'null'
                      x-parser-schema-id: <anonymous-schema-442>
                  x-parser-schema-id: <anonymous-schema-440>
                clusterVenues:
                  description: >-
                    Venues in the matched cluster; just this venue when
                    unmatched
                  type: array
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-444>
                  x-parser-schema-id: <anonymous-schema-443>
              x-parser-schema-id: <anonymous-schema-421>
            market:
              type: object
              required:
                - id
                - venueEventId
                - venue
                - externalIdentifier
                - question
                - shortTitle
                - status
                - startDate
                - endDate
                - createdAt
                - outcomes
                - categories
                - matched
                - clusterAnchorId
                - clusterVenues
              properties:
                id:
                  type: string
                  x-parser-schema-id: <anonymous-schema-446>
                venueEventId:
                  type: string
                  x-parser-schema-id: <anonymous-schema-447>
                venue:
                  type: string
                  x-parser-schema-id: <anonymous-schema-448>
                externalIdentifier:
                  type: string
                  x-parser-schema-id: <anonymous-schema-449>
                question:
                  type: string
                  x-parser-schema-id: <anonymous-schema-450>
                shortTitle:
                  anyOf:
                    - type: string
                      x-parser-schema-id: <anonymous-schema-452>
                    - type: 'null'
                      x-parser-schema-id: <anonymous-schema-453>
                  x-parser-schema-id: <anonymous-schema-451>
                status:
                  type: string
                  x-parser-schema-id: <anonymous-schema-454>
                startDate:
                  type: string
                  x-parser-schema-id: <anonymous-schema-455>
                endDate:
                  anyOf:
                    - type: string
                      x-parser-schema-id: <anonymous-schema-457>
                    - type: 'null'
                      x-parser-schema-id: <anonymous-schema-458>
                  x-parser-schema-id: <anonymous-schema-456>
                createdAt:
                  type: string
                  x-parser-schema-id: <anonymous-schema-459>
                outcomes:
                  type: array
                  items:
                    type: object
                    required:
                      - id
                      - label
                      - title
                    properties:
                      id:
                        description: >-
                          venueMarketOutcomeId — subscribe orderbook/trades with
                          it
                        type: string
                        x-parser-schema-id: <anonymous-schema-462>
                      label:
                        type: string
                        x-parser-schema-id: <anonymous-schema-463>
                      title:
                        anyOf:
                          - type: string
                            x-parser-schema-id: <anonymous-schema-465>
                          - type: 'null'
                            x-parser-schema-id: <anonymous-schema-466>
                        x-parser-schema-id: <anonymous-schema-464>
                    x-parser-schema-id: <anonymous-schema-461>
                  x-parser-schema-id: <anonymous-schema-460>
                categories:
                  description: The parent event's categories
                  type: array
                  items:
                    type: object
                    required:
                      - id
                      - name
                    properties:
                      id:
                        type: string
                        x-parser-schema-id: <anonymous-schema-469>
                      name:
                        type: string
                        x-parser-schema-id: <anonymous-schema-470>
                    x-parser-schema-id: <anonymous-schema-468>
                  x-parser-schema-id: <anonymous-schema-467>
                matched:
                  description: Matched or verified to at least one other venue
                  type: boolean
                  x-parser-schema-id: <anonymous-schema-471>
                clusterAnchorId:
                  description: >-
                    The matched cluster's anchor id (the row list endpoints fold
                    members into); equals `id` for the anchor, null when
                    unmatched. Anchors can change — key storage on `id`.
                  anyOf:
                    - type: string
                      x-parser-schema-id: <anonymous-schema-473>
                    - type: 'null'
                      x-parser-schema-id: <anonymous-schema-474>
                  x-parser-schema-id: <anonymous-schema-472>
                clusterVenues:
                  description: >-
                    Venues in the matched cluster; just this venue when
                    unmatched
                  type: array
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-476>
                  x-parser-schema-id: <anonymous-schema-475>
              x-parser-schema-id: <anonymous-schema-445>
          x-parser-schema-id: <anonymous-schema-406>
        title: Catalog change
        description: >-
          One event or market's current state. op is created, updated or
          deleted; deletes carry only the id. Same item shape as GET
          /catalog/changes.
        example: |-
          {
            "type": "catalog_change",
            "entity": "event",
            "id": "string",
            "op": "created",
            "version": 0,
            "changedAt": "string",
            "venue": "polymarket",
            "event": {
              "id": "string",
              "venue": "polymarket",
              "externalIdentifier": "0xabc123",
              "title": "string",
              "slug": "string",
              "status": "string",
              "startDate": "string",
              "endDate": "string",
              "createdAt": "string",
              "categories": [
                {
                  "id": "string",
                  "name": "string"
                }
              ],
              "matched": true,
              "clusterAnchorId": "string",
              "clusterVenues": [
                "string"
              ]
            },
            "market": {
              "id": "string",
              "venueEventId": "evt_xyz789",
              "venue": "polymarket",
              "externalIdentifier": "0xabc123",
              "question": "string",
              "shortTitle": "string",
              "status": "string",
              "startDate": "string",
              "endDate": "string",
              "createdAt": "string",
              "outcomes": [
                {
                  "id": "string",
                  "label": "Yes",
                  "title": "string"
                }
              ],
              "categories": [
                {
                  "id": "string",
                  "name": "string"
                }
              ],
              "matched": true,
              "clusterAnchorId": "string",
              "clusterVenues": [
                "string"
              ]
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: catalogChange
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
receiveOperations:
  - *ref_2
sendMessages:
  - *ref_3
receiveMessages:
  - *ref_4
extensions:
  - id: x-parser-unique-object-id
    value: catalog
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.