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

# Watch this account for changes

> Server-sent events, one connection per open tab. Every message arrives on the default `message` event and its `type` field says what moved; it carries no state of its own, so the client reads the resource back over its own route. A `heartbeat` every twenty seconds keeps the connection off an idle proxy's timer and tells a client that has heard nothing that it is still connected.



## OpenAPI

````yaml /openapi.json get /api/events
openapi: 3.1.0
info:
  title: ownsi API
  description: >-
    Prove ownership of a domain with a TXT record, and read a zone before anyone
    signs in.


    Two surfaces, and they behave differently on purpose:


    - `GET /api/zones/:name` is public. It streams what DNS answers, in the
    order DNS answers it,
      and writes nothing. No account, no key.
    - Everything under `/api/domains`, `/api/claims` and `/api/verifications`
    belongs to an
      account and needs a session cookie.

    A lookup that failed never carries records, and a claim that has not been
    checked never carries a

    diagnosis: both are tagged unions, so the shape tells you which case you are
    in. Errors are always

    `{ error: { code, message, docsUrl } }` with a stable `code`.
  version: 0.1.0
servers:
  - url: https://ownsi.dev
    description: The origin the front end and the API share
security: []
tags:
  - name: Zones
    description: >-
      Reading a zone the way a visitor sees it: the delegation first, so the
      provider can be named, then how long publishing is likely to take. Public,
      rate limited per IP.
  - name: Domains
    description: >-
      A name on an account, and nothing else — no status, no token. It is what a
      claim is opened against. Session required.
  - name: Claims
    description: >-
      The episode: one token, one seven-day window, one outcome. A claim is
      never reopened, so the list of them is the account's history. Session
      required.
  - name: Events
    description: >-
      One stream per open tab, telling an account's screens what moved. It
      carries no state: a message names the resource, the client reads it back.
      Session required.
  - name: Proof
    description: >-
      A proved claim, shared. A link carries its own slug — never the DNS token
      — and resolves for seven days at `/p/:slug`, where the page states one
      moment and reads no DNS. Session required to publish one.
  - name: Verifications
    description: >-
      The process behind a claim: the runs it has made, the named diagnosis of
      the last one, and when the next lands. Session required.
paths:
  /api/events:
    get:
      tags:
        - Events
      summary: Watch this account for changes
      description: >-
        Server-sent events, one connection per open tab. Every message arrives
        on the default `message` event and its `type` field says what moved; it
        carries no state of its own, so the client reads the resource back over
        its own route. A `heartbeat` every twenty seconds keeps the connection
        off an idle proxy's timer and tells a client that has heard nothing that
        it is still connected.
      operationId: getApiEvents
      responses:
        '200':
          description: The stream, open until the client closes it.
          content:
            text/event-stream:
              schema:
                anyOf:
                  - type: object
                    required:
                      - type
                    properties:
                      type:
                        const: heartbeat
                        type: string
                  - type: object
                    required:
                      - type
                      - verificationId
                      - claimId
                    properties:
                      type:
                        const: verification.ran
                        type: string
                      verificationId:
                        type: string
                      claimId:
                        type: string
                  - type: object
                    required:
                      - type
                      - claimId
                      - domainId
                    properties:
                      type:
                        const: claim.ended
                        type: string
                      claimId:
                        type: string
                      domainId:
                        type: string
                  - type: object
                    required:
                      - type
                      - domainId
                    properties:
                      type:
                        const: domain.archived
                        type: string
                      domainId:
                        type: string
        '401':
          description: No session.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                      - docsUrl
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      docsUrl:
                        type: string

````