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

# Live push over Server-Sent Events (no inbound port)

> Hold this GET open to receive `audit.changed` events as they happen: a no-inbound-port way to receive pushes. No setup: it's a plain authenticated endpoint (your API key is all it needs). Each SSE frame is `event: audit.changed` with the SAME payload as a webhook and `id: <event id>`. Resume after a disconnect with the `Last-Event-ID` header (automatic in EventSource) or `?since=<id>`; a fresh connect streams new events only (`?since=0` replays all). Scoped to your active subscriptions. A `:` keepalive comment is sent about every 25s.



## OpenAPI

````yaml /api-reference/openapi.json get /stream
openapi: 3.1.0
info:
  title: Serialized Audit API
  version: 1.0.0
  description: Submit a contract address and chain, receive an instant risk verdict.
servers:
  - url: https://www.serializedaudit.io/api
security:
  - apiKey: []
paths:
  /stream:
    get:
      summary: Live push over Server-Sent Events (no inbound port)
      description: >-
        Hold this GET open to receive `audit.changed` events as they happen: a
        no-inbound-port way to receive pushes. No setup: it's a plain
        authenticated endpoint (your API key is all it needs). Each SSE frame is
        `event: audit.changed` with the SAME payload as a webhook and `id:
        <event id>`. Resume after a disconnect with the `Last-Event-ID` header
        (automatic in EventSource) or `?since=<id>`; a fresh connect streams new
        events only (`?since=0` replays all). Scoped to your active
        subscriptions. A `:` keepalive comment is sent about every 25s.
      operationId: streamEvents
      parameters:
        - name: since
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
          description: >-
            Resume from this event id (alternative to the Last-Event-ID header).
            Omit for new events only; 0 replays all.
      responses:
        '200':
          description: >-
            An event stream (text/event-stream). Each `audit.changed` frame's
            data is an AuditChangeEvent.
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/AuditChangeEvent'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AuditChangeEvent:
      type: object
      description: >-
        The payload POSTed to your webhook on every verdict change (and, each
        with an added integer `id`, what /events returns). type is always
        "audit.changed".
      properties:
        type:
          type: string
          enum:
            - audit.changed
        event_id:
          type: string
          description: Unique per change; dedupe on it (delivery is at-least-once).
        chain:
          type: string
        address:
          type: string
        audit_id:
          type:
            - integer
            - 'null'
        created_at:
          type: string
          format: date-time
        change:
          type: object
          description: Compact summary for cheap routing/alerting.
          properties:
            is_safe:
              type: object
              properties:
                before:
                  type:
                    - boolean
                    - 'null'
                after:
                  type:
                    - boolean
                    - 'null'
                changed:
                  type: boolean
            owner_changed:
              type: boolean
            vulns:
              type: object
              properties:
                added:
                  type: integer
                removed:
                  type: integer
                changed:
                  type: integer
        audit:
          oneOf:
            - $ref: '#/components/schemas/Audit'
            - type: 'null'
          description: >-
            The complete new verdict, identical to a /audit-contract `audit`
            object, projected to your response profile. null if the change left
            no audit.
        diff:
          type: object
          description: Which findings moved.
          properties:
            added:
              type: array
              items:
                $ref: '#/components/schemas/Vulnerability'
            removed:
              type: array
              items:
                $ref: '#/components/schemas/Vulnerability'
            changed:
              type: array
              items:
                type: object
                properties:
                  before:
                    $ref: '#/components/schemas/Vulnerability'
                  after:
                    $ref: '#/components/schemas/Vulnerability'
                  fields:
                    type: array
                    items:
                      type: string
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
    Audit:
      type: object
      required:
        - isSafe
        - description
        - address
        - chain
        - vulnerabilities
      description: The audit result.
      properties:
        isSafe:
          type: boolean
          description: >-
            The overall verdict, your decision boundary. true means no
            holder-harming risk was active at audit time. Combines the token
            verdict and, if present, the hook verdict.
        isTokenSafe:
          type: boolean
          description: >-
            Verdict for the token contract itself, ignoring any associated pool
            hook.
        isHookSafe:
          type:
            - boolean
            - 'null'
          description: >-
            Verdict for the associated Uniswap v4 pool hook, or null when the
            token has no hook.
        description:
          type: string
          description: >-
            A short, human-readable explanation of the verdict, safe to show in
            a UI.
        vulnerabilities:
          type: array
          description: The detected risks. Empty when the contract is safe.
          items:
            $ref: '#/components/schemas/Vulnerability'
        name:
          type:
            - string
            - 'null'
          description: Token name, when available.
        symbol:
          type:
            - string
            - 'null'
          description: Token symbol, when available.
        address:
          type: string
          description: The audited contract address (echoed back).
        chain:
          type: string
          description: The chain symbol (echoed back).
        sourceType:
          type: string
          enum:
            - verified
            - decompiled
            - b20
            - none
          description: >-
            How the analyzed code was obtained: verified (published source),
            decompiled (reconstructed from bytecode), b20 (a Base native B20
            token with no bytecode; the verdict is read deterministically from
            on-chain flags), or none.
        isProxy:
          type: boolean
          description: >-
            Whether the contract is a proxy. When true, the verdict already
            reflects its implementation.
        implementationAddress:
          type:
            - string
            - 'null'
          description: >-
            For a proxy, the implementation contract that was audited; null
            otherwise.
        hookAddress:
          type:
            - string
            - 'null'
          description: Address of the associated Uniswap v4 pool hook, when present.
        hookAudit:
          oneOf:
            - $ref: '#/components/schemas/HookAudit'
            - type: 'null'
          description: >-
            The audit of the associated pool hook, or null when there is no
            hook.
        createdAt:
          type: string
          format: date-time
          description: ISO timestamp of when this audit was produced.
        auditSystemVersion:
          type: string
          description: >-
            The version of the audit system that produced this result. Useful to
            gate on newly added fields.
        latestAuditSystemVersion:
          type: string
          description: >-
            The latest audit system version. If it differs from
            auditSystemVersion, the result refreshes to the latest on the next
            visit.
        b20Flags:
          type:
            - object
            - 'null'
          description: >-
            Live on-chain flag snapshot for a Base-native B20 token. null on
            every other sourceType.
          properties:
            is_b20:
              type: boolean
              description: Always true on a B20 row.
            initialized:
              type: boolean
            variant:
              type:
                - string
                - 'null'
              enum:
                - asset
                - stablecoin
                - null
              description: B20 variant, or null if unknown.
            paused_features:
              type: array
              items:
                type: integer
              description: >-
                PausableFeature enum values currently paused: 0=TRANSFER,
                1=MINT, 2=BURN.
            policy_sender:
              type: string
              description: >-
                Transfer-policy id (uint64 decimal string). '0' = ALWAYS_ALLOW
                (open).
            policy_receiver:
              type: string
              description: As policy_sender, receiver scope.
            policy_executor:
              type: string
              description: As policy_sender, executor scope.
            policy_mint:
              type: string
              description: As policy_sender, mint scope.
            multiplier:
              type:
                - string
                - 'null'
              description: >-
                Rebase multiplier (asset variant), WAD decimal string; 1e18 =
                neutral. null when absent/unreadable.
            supply_cap:
              type:
                - string
                - 'null'
              description: >-
                uint256 decimal string; type(uint128).max = uncapped.
                Informational.
    Vulnerability:
      type: object
      required:
        - type
        - impact
        - description
      properties:
        type:
          type: string
          description: >-
            Risk category. See Risk Categories for the full list. Treat as an
            open set and handle unknown values gracefully.
          examples:
            - UnlimitedMinting
            - HiddenFees
            - LiquidityDrain
        impact:
          type: string
          enum:
            - critical
            - warning
            - info
          description: How severely this risk affects a holder.
        description:
          type: string
          description: Plain-language explanation of the risk.
        code:
          type: string
          description: A representative snippet of the relevant code for this risk.
        codes:
          type: array
          items:
            type: string
          description: >-
            All relevant snippets when several functions share this risk. `code`
            is the first of them. Present only when more than one applies.
        mitigated:
          type:
            - boolean
            - 'null'
          description: >-
            Whether this specific risk is currently neutralized (e.g. the
            controlling owner has renounced). null when not applicable.
        gateReason:
          type:
            - string
            - 'null'
          description: >-
            Human-readable explanation of the current state, e.g. "Owner
            renounced" or "MINTER_ROLE has 2 active holders". Display-ready.
    HookAudit:
      type: object
      description: Audit of an associated Uniswap v4 pool hook.
      properties:
        isSafe:
          type:
            - boolean
            - 'null'
          description: Verdict for the hook.
        description:
          type:
            - string
            - 'null'
          description: Human-readable summary of the hook verdict.
        vulnerabilities:
          type: array
          items:
            $ref: '#/components/schemas/Vulnerability'
          description: Risks detected in the hook.
        address:
          type:
            - string
            - 'null'
          description: The hook contract address.
        isDecompiled:
          type: boolean
          description: >-
            Whether the hook verdict came from decompiled bytecode (no verified
            source).
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Auth-Key
      description: Your secret API key. Create one from your dashboard.

````