openapi: 3.1.0
info:
  title: RerunLab Polling-to-Events API
  version: 1.0.0
  description: Private beta. Human-provided API keys. HTTPS JSON GET polling,
    durable inbox and signed webhooks. No automatic agent wake-up or autonomous
    billing.
servers:
  - url: https://api.rerunlab.com/v1
security:
  - bearerAuth: []
paths:
  /projects:
    get:
      operationId: Listprojects
      summary: List projects
      description: "Required key scope: watches:read."
      parameters:
        - &a2
          name: cursor
          in: query
          required: false
          schema: &a1
            type: string
        - &a3
          name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    post:
      operationId: Createproject
      summary: Create project
      description: "Required key scope: watches:write."
      parameters: []
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Project"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                name: *a1
              required:
                - name
  /watches:
    get:
      operationId: Listwatches
      summary: List watches
      description: "Required key scope: watches:read."
      parameters:
        - *a2
        - *a3
        - name: project_id
          in: query
          required: false
          schema: *a1
        - name: state
          in: query
          required: false
          schema: *a1
        - name: health
          in: query
          required: false
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    post:
      operationId: Createwatch
      summary: Create watch
      description: "Required key scope: watches:write."
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Watch"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WatchInput"
  /watches/{id}:
    get:
      operationId: Getwatch
      summary: Get watch
      description: "Required key scope: watches:read."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Watch"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    patch:
      operationId: Updatewatch
      summary: Update watch
      description: "Required key scope: watches:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
        - name: If-Match
          in: header
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Watch"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WatchPatch"
    delete:
      operationId: Deletewatch
      summary: Delete watch
      description: "Required key scope: watches:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Watch"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /watches/{id}/pause:
    post:
      operationId: pausewatch
      summary: pause watch
      description: "Required key scope: watches:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Watch"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties: {}
              required: []
  /watches/{id}/resume:
    post:
      operationId: resumewatch
      summary: resume watch
      description: "Required key scope: watches:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Watch"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties: {}
              required: []
  /watches/{id}/restart:
    post:
      operationId: restartwatch
      summary: restart watch
      description: "Required key scope: watches:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Watch"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                expires_at:
                  type:
                    - string
                    - "null"
                  format: date-time
              required: []
  /watches/{id}/check:
    post:
      operationId: checkwatch
      summary: check watch
      description: "Required key scope: watches:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Watch"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties: {}
              required: []
  /watches/preview:
    post:
      operationId: Previewsource
      summary: Preview source
      description: "Required key scope: watches:write."
      parameters: []
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  value: {}
                  hash: *a1
                  matched:
                    type:
                      - boolean
                      - "null"
                  counts_as_check: &a4
                    type: boolean
                  baseline_created:
                    const: false
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WatchInput"
  /watches/{id}/checks:
    get:
      operationId: Listchecks
      summary: List checks
      description: "Required key scope: watches:read."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
        - *a2
        - *a3
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /events:
    get:
      operationId: Listevents
      summary: List events
      description: "Required key scope: events:read."
      parameters:
        - *a2
        - *a3
        - name: project_id
          in: query
          required: false
          schema: *a1
        - name: watch_id
          in: query
          required: false
          schema: *a1
        - name: type
          in: query
          required: false
          schema: *a1
        - name: start
          in: query
          required: false
          schema:
            enum:
              - latest
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EventPage"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /events/{id}:
    get:
      operationId: Getevent
      summary: Get event
      description: "Required key scope: events:read."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Event"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /deliveries:
    get:
      operationId: Listdeliveries
      summary: List deliveries
      description: "Required key scope: deliveries:read."
      parameters:
        - *a2
        - *a3
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /deliveries/{id}:
    get:
      operationId: Getdelivery
      summary: Get delivery
      description: "Required key scope: deliveries:read."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Delivery"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /deliveries/{id}/replay:
    post:
      operationId: Replaydelivery
      summary: Replay delivery
      description: "Required key scope: deliveries:replay."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
        - name: Idempotency-Key
          in: header
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Delivery"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties: {}
              required: []
  /usage:
    get:
      operationId: Getusage
      summary: Get usage
      description: "Required key scope: usage:read."
      parameters: []
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Usage"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /credentials:
    get:
      operationId: Listcredentials
      summary: List credentials
      description: "Required key scope: credentials:write."
      parameters:
        - *a2
        - *a3
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    post:
      operationId: CreateCredential
      summary: Create Credential
      description: "Required key scope: credentials:write."
      parameters: []
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Credential"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CredentialInput"
  /credentials/{id}:
    patch:
      operationId: UpdateCredential
      summary: Update Credential
      description: "Required key scope: credentials:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Credential"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CredentialPatch"
    delete:
      operationId: DeleteCredential
      summary: Delete Credential
      description: "Required key scope: credentials:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                disable_watches: *a4
              required: []
  /endpoints:
    get:
      operationId: Listendpoints
      summary: List endpoints
      description: "Required key scope: endpoints:read."
      parameters:
        - *a2
        - *a3
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    post:
      operationId: CreateEndpoint
      summary: Create Endpoint
      description: "Required key scope: endpoints:write."
      parameters: []
      security:
        - bearerAuth: []
      responses:
        "201":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Endpoint"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EndpointInput"
  /endpoints/{id}:
    patch:
      operationId: UpdateEndpoint
      summary: Update Endpoint
      description: "Required key scope: endpoints:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Endpoint"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EndpointPatch"
    delete:
      operationId: DeleteEndpoint
      summary: Delete Endpoint
      description: "Required key scope: endpoints:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties: {}
              required: []
  /endpoints/{id}/verify:
    post:
      operationId: verifydestination
      summary: verify destination
      description: "Required key scope: endpoints:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Endpoint"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties: {}
              required: []
  /endpoints/{id}/test:
    post:
      operationId: testdestination
      summary: test destination
      description: "Required key scope: endpoints:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  synthetic: *a4
                  http_status:
                    type: integer
                  succeeded: *a4
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties: {}
              required: []
  /endpoints/{id}/rotate-secret:
    post:
      operationId: rotatesecretdestination
      summary: rotate-secret destination
      description: "Required key scope: endpoints:write."
      parameters:
        - name: id
          in: path
          required: true
          schema: *a1
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Endpoint"
        "400":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "403":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "410":
          description: Retained history has expired.
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: Rate or check limit exceeded. Honor Retry-After.
          headers:
            Retry-After:
              schema: *a1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: Structured error
          headers: {}
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties: {}
              required: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
  schemas:
    Error:
      type: object
      additionalProperties: false
      properties:
        error:
          type: object
          additionalProperties: false
          properties:
            code: *a1
            message: *a1
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
            - details
        request_id: *a1
      required:
        - error
    Source:
      type: object
      additionalProperties: false
      properties:
        url: &a8
          type: string
          format: uri
          description: Public HTTPS GET URL, port 443; secrets masked on reads.
        credential_id: &a9
          type:
            - string
            - "null"
        headers: &a10
          type: object
          maxProperties: 5
          additionalProperties:
            type: string
            maxLength: 1024
      required:
        - url
    Trigger:
      oneOf:
        - type: object
          additionalProperties: false
          properties:
            type:
              const: change
          required:
            - type
        - type: object
          additionalProperties: false
          properties:
            type:
              const: condition
            operator:
              enum:
                - eq
                - neq
                - gt
                - gte
                - lt
                - lte
            value: {}
            fire_on_initial_match: *a4
            stop_after_match: *a4
          required:
            - type
            - operator
            - value
    WatchInput:
      type: object
      additionalProperties: false
      properties: &a5
        project_id: *a1
        name:
          type: string
          minLength: 1
          maxLength: 100
        source:
          $ref: "#/components/schemas/Source"
        selector:
          type: string
          description: RFC 6901 JSON Pointer; empty selects root.
        trigger:
          $ref: "#/components/schemas/Trigger"
        interval_seconds:
          type: integer
          minimum: 60
          maximum: 604800
        expires_at:
          type:
            - string
            - "null"
          format: date-time
        endpoint_id:
          type:
            - string
            - "null"
        metadata:
          type: object
          additionalProperties: true
        operational_webhooks: *a4
      required:
        - project_id
        - name
        - source
        - selector
        - trigger
        - interval_seconds
    Watch:
      type: object
      properties:
        id: *a1
        version: *a1
        lifecycle:
          enum:
            - active
            - paused
            - completed
            - expired
            - quota_paused
            - disabled
            - deleted
        health:
          enum:
            - initializing
            - healthy
            - degraded
            - failing
        source:
          $ref: "#/components/schemas/SourceRead"
        trigger:
          $ref: "#/components/schemas/Trigger"
        selector: *a1
        interval_seconds:
          type: integer
        next_due_at:
          type:
            - string
            - "null"
          format: date-time
        expires_at:
          type:
            - string
            - "null"
          format: date-time
    Event:
      type: object
      required:
        - id
        - type
        - schema_version
        - sequence
        - watch_id
        - watch_generation
        - data
      properties:
        id: *a1
        type:
          enum:
            - watch.changed
            - watch.matched
            - watch.failing
            - watch.recovered
            - watch.disabled
            - watch.expired
            - watch.quota_paused
        schema_version:
          const: 2026-09-01
        workspace_id: *a1
        project_id: *a1
        watch_id: *a1
        watch_generation:
          type: integer
        sequence:
          type: integer
        watch_sequence:
          type: integer
        observed_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        data:
          type: object
          properties:
            selector: *a1
            before_present: *a4
            before: {}
            after: {}
            error_code: *a1
        metadata:
          type: object
          additionalProperties: true
    EventPage:
      type: object
      additionalProperties: false
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Event"
        next_cursor: *a1
        has_more: *a4
        server_time:
          type: string
          format: date-time
      required:
        - data
        - next_cursor
        - has_more
        - server_time
    Delivery:
      type: object
      properties:
        id: *a1
        event_id: *a1
        state:
          enum:
            - pending
            - in-flight
            - retrying
            - succeeded
            - failed
            - expired
            - canceled
        attempt_count:
          type: integer
        attempts:
          type: array
          items:
            type: object
        last_error:
          type:
            - string
            - "null"
        last_status:
          type:
            - integer
            - "null"
        endpoint_revision:
          type: integer
        next_attempt_at:
          type:
            - string
            - "null"
        deadline_at: *a1
    Usage:
      type: object
      properties:
        plan:
          enum:
            - free
            - builder
            - pro
        used:
          type: integer
        remaining:
          type: integer
        limit:
          type: integer
        period_start: *a1
        period_end: *a1
        enabled_watches:
          type: integer
        watch_limit:
          type: integer
        estimated_checks_per_30_days:
          type: integer
        limits:
          type: object
        no_automatic_overages:
          const: true
    CredentialInput:
      type: object
      additionalProperties: false
      properties: &a6
        project_id: *a1
        name: *a1
        origin: *a1
        kind:
          enum:
            - bearer
            - api_key
        header_name: *a1
        value:
          type: string
          writeOnly: true
          minLength: 1
          maxLength: 4096
      required:
        - project_id
        - name
        - origin
        - kind
        - value
    EndpointInput:
      type: object
      additionalProperties: false
      properties: &a7
        project_id: *a1
        name: *a1
        url:
          type: string
          format: uri
      required:
        - project_id
        - name
        - url
    Page:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
        next_cursor:
          type:
            - string
            - "null"
        has_more: *a4
    WatchPatch:
      type: object
      additionalProperties: false
      properties: *a5
      required: []
    CredentialPatch:
      type: object
      additionalProperties: false
      properties: *a6
      required:
        - value
    EndpointPatch:
      type: object
      additionalProperties: false
      properties: *a7
      required: []
    SourceRead:
      type: object
      additionalProperties: false
      properties:
        url: *a8
        credential_id: *a9
        headers: *a10
        hostname: *a1
      required:
        - url
        - hostname
    Project:
      type: object
      additionalProperties: false
      properties:
        id: *a1
        name: *a1
      required:
        - id
        - name
    Credential:
      type: object
      properties:
        id: *a1
        name: *a1
        origin: *a1
        kind:
          enum:
            - bearer
            - api_key
        header_name: *a1
        revision:
          type: integer
        updated_at: *a1
        dependent_watches:
          type: integer
    Endpoint:
      type: object
      properties:
        id: *a1
        name: *a1
        url:
          type:
            - string
            - "null"
        state:
          enum:
            - unverified
            - verified
            - disabled
        revision:
          type:
            - integer
            - "null"
        verified_at:
          type:
            - string
            - "null"
        signing_secret:
          type:
            - string
            - "null"
          description: Only returned on creation or rotation; save immediately.
        previous_secret_valid_until: *a1
