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

# Edit an alert

> Send only the fields to change, with the same names and nesting as GET; omitted fields are kept and null clears a field. expected.net_price, expected.total, invoiced, invoice_item, provenance, verdict and credit are read-only; change the verdict or credit with POST /v1/alerts/dismiss, /reopen, /credit or /uncredit. confidence takes level and reason. citations takes upsert and remove changes by source_ref.



## OpenAPI

````yaml /openapi.json patch /v1/alerts/{id}
openapi: 3.1.0
info:
  title: Watchdog API
  version: 1.0.0
  description: >-
    The Watchdog API is served from https://api.watchdog.no. Request bodies are
    limited to 2 MiB unless an endpoint says otherwise. Files are uploaded
    directly to storage, not through the API.
servers:
  - url: https://api.watchdog.no
    description: Watchdog API
security: []
paths:
  /v1/alerts/{id}:
    patch:
      tags:
        - Alerts
      summary: Edit an alert
      description: >-
        Send only the fields to change, with the same names and nesting as GET;
        omitted fields are kept and null clears a field. expected.net_price,
        expected.total, invoiced, invoice_item, provenance, verdict and credit
        are read-only; change the verdict or credit with POST
        /v1/alerts/dismiss, /reopen, /credit or /uncredit. confidence takes
        level and reason. citations takes upsert and remove changes by
        source_ref.
      operationId: updateAlert
      parameters:
        - name: X-Organization-Id
          in: header
          required: false
          schema:
            type: string
          description: >-
            The organization to act in. Required for personal API keys; list the
            organizations you can access with GET /v1/organizations.
        - name: If-Match
          in: header
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 4096
          description: >-
            Optional ETag from your last read or edit. If the resource changed
            since, the request fails with 412 and nothing changes.
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                citations:
                  type: object
                  properties:
                    upsert:
                      type: array
                      items:
                        type: object
                        properties:
                          source_ref:
                            type: integer
                            exclusiveMinimum: 0
                            maximum: 2147483647
                          source:
                            anyOf:
                              - type: object
                                properties:
                                  source_type:
                                    type: string
                                    enum:
                                      - document
                                  document_id:
                                    type: string
                                    format: uuid
                                required:
                                  - source_type
                                  - document_id
                                additionalProperties: false
                              - type: object
                                properties:
                                  source_type:
                                    type: string
                                    enum:
                                      - web
                                  url:
                                    type: string
                                    maxLength: 20000
                                required:
                                  - source_type
                                  - url
                                additionalProperties: false
                              - type: object
                                properties:
                                  source_type:
                                    type: string
                                    enum:
                                      - agreement_items
                                  item_ids:
                                    type: array
                                    items:
                                      type: string
                                      format: uuid
                                    minItems: 1
                                    maxItems: 100
                                required:
                                  - source_type
                                  - item_ids
                                additionalProperties: false
                              - type: object
                                properties:
                                  source_type:
                                    type: string
                                    enum:
                                      - user_context
                                  text:
                                    type: string
                                    minLength: 1
                                    maxLength: 20000
                                required:
                                  - source_type
                                  - text
                                additionalProperties: false
                          quote:
                            type:
                              - string
                              - 'null'
                            maxLength: 20000
                          text:
                            type:
                              - string
                              - 'null'
                            maxLength: 20000
                          section_title:
                            type:
                              - string
                              - 'null'
                            maxLength: 20000
                          context_before:
                            type:
                              - string
                              - 'null'
                            maxLength: 20000
                          context_after:
                            type:
                              - string
                              - 'null'
                            maxLength: 20000
                          title:
                            type:
                              - string
                              - 'null'
                            maxLength: 20000
                          citation:
                            anyOf:
                              - type: object
                                properties:
                                  id:
                                    type: string
                                    format: uuid
                                required:
                                  - id
                                additionalProperties: false
                              - type: object
                                properties:
                                  source:
                                    anyOf:
                                      - type: object
                                        properties:
                                          source_type:
                                            type: string
                                            enum:
                                              - document
                                          document_id:
                                            type: string
                                            format: uuid
                                        required:
                                          - source_type
                                          - document_id
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          source_type:
                                            type: string
                                            enum:
                                              - web
                                          url:
                                            type: string
                                            maxLength: 20000
                                        required:
                                          - source_type
                                          - url
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          source_type:
                                            type: string
                                            enum:
                                              - agreement_items
                                          item_ids:
                                            type: array
                                            items:
                                              type: string
                                              format: uuid
                                            minItems: 1
                                            maxItems: 100
                                        required:
                                          - source_type
                                          - item_ids
                                        additionalProperties: false
                                      - type: object
                                        properties:
                                          source_type:
                                            type: string
                                            enum:
                                              - user_context
                                          text:
                                            type: string
                                            minLength: 1
                                            maxLength: 20000
                                        required:
                                          - source_type
                                          - text
                                        additionalProperties: false
                                  quote:
                                    type:
                                      - string
                                      - 'null'
                                    maxLength: 20000
                                  text:
                                    type:
                                      - string
                                      - 'null'
                                    maxLength: 20000
                                  section_title:
                                    type:
                                      - string
                                      - 'null'
                                    maxLength: 20000
                                  context_before:
                                    type:
                                      - string
                                      - 'null'
                                    maxLength: 20000
                                  context_after:
                                    type:
                                      - string
                                      - 'null'
                                    maxLength: 20000
                                  title:
                                    type:
                                      - string
                                      - 'null'
                                    maxLength: 20000
                                required:
                                  - source
                                additionalProperties: false
                        required:
                          - source_ref
                        additionalProperties: false
                      maxItems: 100
                      default: []
                    remove:
                      type: array
                      items:
                        type: integer
                        exclusiveMinimum: 0
                        maximum: 2147483647
                      maxItems: 100
                      default: []
                  additionalProperties: false
                title:
                  type: string
                  minLength: 1
                  maxLength: 500
                explanation:
                  type:
                    - string
                    - 'null'
                  maxLength: 20000
                questions:
                  type: array
                  items:
                    type: string
                    maxLength: 2000
                  maxItems: 50
                impact_amount:
                  type:
                    - string
                    - 'null'
                  maxLength: 100
                  pattern: ^-?\d+(?:\.\d+)?$
                  description: >-
                    The amount the invoice is wrong by, in the invoice currency:
                    positive when it charges more than agreed. A change to
                    expected pricing recalculates it unless you send it too.
                confidence:
                  type: object
                  properties:
                    level:
                      type:
                        - string
                        - 'null'
                      enum:
                        - certain
                        - uncertain
                        - null
                    reason:
                      type:
                        - string
                        - 'null'
                      maxLength: 2000
                  additionalProperties: false
                expected:
                  type: object
                  properties:
                    base_price:
                      type:
                        - string
                        - 'null'
                      maxLength: 100
                      pattern: ^-?\d+(?:\.\d+)?$
                    quantity:
                      type:
                        - string
                        - 'null'
                      maxLength: 100
                      pattern: ^-?\d+(?:\.\d+)?$
                    discount:
                      type:
                        - string
                        - 'null'
                      maxLength: 100
                      pattern: ^-?\d+(?:\.\d+)?$
                    surcharge:
                      type:
                        - string
                        - 'null'
                      maxLength: 100
                      pattern: ^-?\d+(?:\.\d+)?$
                    adjustment_uplift:
                      type:
                        - string
                        - 'null'
                      maxLength: 100
                      pattern: ^-?\d+(?:\.\d+)?$
                    price_explanation:
                      type:
                        - string
                        - 'null'
                      maxLength: 20000
                    adjustment_explanation:
                      type:
                        - string
                        - 'null'
                      maxLength: 20000
                    product_code:
                      type:
                        - string
                        - 'null'
                      maxLength: 2000
                    description:
                      type:
                        - string
                        - 'null'
                      maxLength: 20000
                    unit:
                      type:
                        - string
                        - 'null'
                      maxLength: 2000
                  additionalProperties: false
              additionalProperties: false
      responses:
        '200':
          description: The alert.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
            ETag:
              schema:
                type: string
              required: true
              description: >-
                Version of the resource. Send it as If-Match to change it only
                if it has not changed since.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
        '400':
          description: >-
            The request is invalid. details lists up to 20 field errors. Request
            bodies are limited to 2 MiB.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_validation_error'
              example:
                error:
                  code: validation_error
                  message: >-
                    The request is invalid. details lists up to 20 field errors.
                    Request bodies are limited to 2 MiB.
                  request_id: req_example
        '401':
          description: The bearer token is missing or invalid.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
            WWW-Authenticate:
              schema:
                type: string
              required: false
              description: Bearer authentication challenge, when supplied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_invalid_token'
              example:
                error:
                  code: invalid_token
                  message: The bearer token is missing or invalid.
                  request_id: req_example
        '403':
          description: >-
            Access denied. The error code says why: forbidden, token_disabled,
            organization_required, insufficient_role or mfa_required.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Error_forbidden_token_disabled_organization_required_insufficient_role_mfa_required
              example:
                error:
                  code: forbidden
                  message: >-
                    Access denied. The error code says why: forbidden,
                    token_disabled, organization_required, insufficient_role or
                    mfa_required.
                  request_id: req_example
        '404':
          description: The resource does not exist in the current organization.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_not_found'
              example:
                error:
                  code: not_found
                  message: The resource does not exist in the current organization.
                  request_id: req_example
        '409':
          description: >-
            The alert belongs to a completed claim, or this status transition is
            incompatible.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_conflict'
              example:
                error:
                  code: conflict
                  message: >-
                    The alert belongs to a completed claim, or this status
                    transition is incompatible.
                  request_id: req_example
        '412':
          description: >-
            The resource changed since the ETag in If-Match was read. Nothing
            changed; read it again and retry.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_precondition_failed'
              example:
                error:
                  code: precondition_failed
                  message: >-
                    The resource changed since the ETag in If-Match was read.
                    Nothing changed; read it again and retry.
                  request_id: req_example
        '429':
          description: Too many requests. Wait for the Retry-After delay before retrying.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
            Retry-After:
              schema:
                type: string
                example: '60'
              required: true
              description: Seconds to wait before retrying the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_rate_limit_exceeded'
              example:
                error:
                  code: rate_limit_exceeded
                  message: >-
                    Too many requests. Wait for the Retry-After delay before
                    retrying.
                  request_id: req_example
        '500':
          description: >-
            Unexpected server failure. Include the request ID when contacting
            support.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_internal_error'
              example:
                error:
                  code: internal_error
                  message: >-
                    Unexpected server failure. Include the request ID when
                    contacting support.
                  request_id: req_example
        '503':
          description: >-
            Temporarily unavailable. Retry after the Retry-After delay, when
            provided.
          headers:
            X-Request-Id:
              schema:
                type: string
              required: true
              description: >-
                Request ID, also included in error bodies. Include it when
                contacting support.
            Cache-Control:
              schema:
                type: string
                enum:
                  - private, no-store
                  - private, no-store, no-transform
              required: false
              description: API responses are private and must not be cached.
            X-RateLimit-Limit:
              schema:
                type: string
                example: '500'
              required: false
              description: >-
                Requests allowed per minute for this credential, or failed API
                key attempts allowed per minute from this IP address.
            Retry-After:
              schema:
                type: string
                example: '60'
              required: true
              description: Seconds to wait before retrying the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_service_unavailable'
              example:
                error:
                  code: service_unavailable
                  message: >-
                    Temporarily unavailable. Retry after the Retry-After delay,
                    when provided.
                  request_id: req_example
      security:
        - ApiKeyBearer: []
components:
  schemas:
    Alert:
      allOf:
        - $ref: '#/components/schemas/AlertSummary'
        - type: object
          properties:
            price_item_ids:
              type: array
              items:
                type: string
                format: uuid
              description: >-
                Agreement prices the alert relies on. Read them with GET
                /v1/agreements/{id}/price-items?ids=.
            expected:
              type: object
              properties:
                base_price:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                quantity:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                discount:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                surcharge:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                adjustment_uplift:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                net_price:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                  readOnly: true
                  description: Calculated from the expected pricing fields.
                total:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                  readOnly: true
                  description: Calculated from expected net price and quantity.
                price_explanation:
                  type:
                    - string
                    - 'null'
                adjustment_explanation:
                  type:
                    - string
                    - 'null'
                product_code:
                  type:
                    - string
                    - 'null'
                description:
                  type:
                    - string
                    - 'null'
                unit:
                  type:
                    - string
                    - 'null'
              required:
                - base_price
                - quantity
                - discount
                - surcharge
                - adjustment_uplift
                - net_price
                - total
                - price_explanation
                - adjustment_explanation
                - product_code
                - description
                - unit
              description: >-
                The pricing the agreement gives for this line, as the check
                applied it. base_price is the agreed unit price before discount
                and surcharge; price_explanation says where it comes from.
            invoiced:
              type: object
              properties:
                base_price:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                net_price:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                quantity:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                discount:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                surcharge:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
                total:
                  type:
                    - string
                    - 'null'
                  pattern: ^-?\d+(?:\.\d+)?$
              required:
                - base_price
                - net_price
                - quantity
                - discount
                - surcharge
                - total
              readOnly: true
              description: Invoiced pricing when the alert was created.
            evidence:
              type: object
              properties:
                citations:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        properties:
                          source_ref:
                            type: integer
                            exclusiveMinimum: 0
                          citation_id:
                            type:
                              - string
                              - 'null'
                            format: uuid
                          available:
                            type: boolean
                            enum:
                              - true
                          source_type:
                            type: string
                            enum:
                              - document
                          document_id:
                            type: string
                            format: uuid
                          document_name:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                          section_title:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                          quote:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                            description: >-
                              The cited text as found in the document. Null when
                              only context_before and context_after locate it.
                          context_before:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                            description: Only with citation_context=true.
                          context_after:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                            description: Only with citation_context=true.
                          verification:
                            type:
                              - string
                              - 'null'
                            enum:
                              - verified
                              - corrected
                              - recovered
                              - unverified
                              - null
                            description: >-
                              verified: the quote was found in the document.
                              corrected: found after fixing the document or
                              wording. recovered: located by its context only.
                              unverified: not found.
                          original_quote:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                            description: >-
                              The check's wording when the quote was not found
                              verbatim (quote is null); null otherwise.
                        required:
                          - source_ref
                          - citation_id
                          - available
                          - source_type
                          - document_id
                          - document_name
                          - section_title
                          - quote
                          - verification
                          - original_quote
                      - type: object
                        properties:
                          source_ref:
                            type: integer
                            exclusiveMinimum: 0
                          citation_id:
                            type:
                              - string
                              - 'null'
                            format: uuid
                          available:
                            type: boolean
                            enum:
                              - true
                          source_type:
                            type: string
                            enum:
                              - web
                          url:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                          title:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                          quote:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                          text:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                          cited_at:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                        required:
                          - source_ref
                          - citation_id
                          - available
                          - source_type
                          - url
                          - title
                          - quote
                          - text
                          - cited_at
                      - type: object
                        properties:
                          source_ref:
                            type: integer
                            exclusiveMinimum: 0
                          citation_id:
                            type:
                              - string
                              - 'null'
                            format: uuid
                          available:
                            type: boolean
                            enum:
                              - true
                          source_type:
                            type: string
                            enum:
                              - agreement_items
                          item_ids:
                            type: array
                            items:
                              type: string
                              format: uuid
                        required:
                          - source_ref
                          - citation_id
                          - available
                          - source_type
                          - item_ids
                      - type: object
                        properties:
                          source_ref:
                            type: integer
                            exclusiveMinimum: 0
                          citation_id:
                            type:
                              - string
                              - 'null'
                            format: uuid
                          available:
                            type: boolean
                            enum:
                              - true
                          source_type:
                            type: string
                            enum:
                              - user_context
                          text:
                            type:
                              - string
                              - 'null'
                            maxLength: 10000
                        required:
                          - source_ref
                          - citation_id
                          - available
                          - source_type
                          - text
                      - type: object
                        properties:
                          source_ref:
                            type:
                              - integer
                              - 'null'
                            exclusiveMinimum: 0
                          citation_id:
                            type:
                              - string
                              - 'null'
                            format: uuid
                          source_type:
                            type:
                              - string
                              - 'null'
                          available:
                            type: boolean
                            enum:
                              - false
                          reason:
                            type: string
                            enum:
                              - source_unavailable
                        required:
                          - source_ref
                          - citation_id
                          - source_type
                          - available
                          - reason
                truncated:
                  type: boolean
                  description: True when excerpts were cut at 10,000 characters.
              required:
                - citations
                - truncated
          required:
            - price_item_ids
            - expected
            - invoiced
            - evidence
    Error_validation_error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_error
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_invalid_token:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_token
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_forbidden_token_disabled_organization_required_insufficient_role_mfa_required:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - forbidden
                - token_disabled
                - organization_required
                - insufficient_role
                - mfa_required
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_not_found:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - not_found
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_conflict:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - conflict
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_precondition_failed:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - precondition_failed
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_rate_limit_exceeded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - rate_limit_exceeded
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_internal_error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - internal_error
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    Error_service_unavailable:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - service_unavailable
            message:
              type: string
            request_id:
              type: string
            description:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - code
                  - field
                  - message
              maxItems: 20
            workflow_run_id:
              type: string
              format: uuid
            import_id:
              type: string
              format: uuid
            existing_party:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - supplier
                    - recipient
                id:
                  type: string
                  format: uuid
              required:
                - type
                - id
          required:
            - code
            - message
            - request_id
      required:
        - error
    AlertSummary:
      type: object
      properties:
        id:
          type: string
          format: uuid
        title:
          type:
            - string
            - 'null'
        explanation:
          type:
            - string
            - 'null'
        verdict:
          type: string
          enum:
            - pending
            - accepted
            - dismissed
          description: >-
            The decision on the finding, independent of claim membership and
            credit.
        credit:
          type:
            - object
            - 'null'
          properties:
            at:
              type: string
              format: date-time
            source:
              type: string
              enum:
                - credit_note
                - user
            credit_note_id:
              type:
                - string
                - 'null'
              format: uuid
              description: >-
                Matched credit-note provenance, if available. Null for a user
                credit.
          required:
            - at
            - source
            - credit_note_id
          description: Supplier credit, independent of the verdict and claim.
        correction_type:
          type: string
          enum:
            - modify_item
            - modify_invoice
            - add_item
        confidence:
          type: object
          properties:
            level:
              type:
                - string
                - 'null'
              enum:
                - certain
                - uncertain
                - null
            reason:
              type:
                - string
                - 'null'
          required:
            - level
            - reason
        questions:
          type: array
          items:
            type: string
          description: >-
            What Watchdog needs answered to decide the alert, mostly on
            uncertain alerts. Empty when nothing is open.
        impact_amount:
          type:
            - string
            - 'null'
          pattern: ^-?\d+(?:\.\d+)?$
        currency_code:
          type: string
        organization_currency:
          type: object
          properties:
            currency_code:
              type: string
              description: The organization's reporting currency from its settings.
            impact_amount:
              type:
                - string
                - 'null'
              pattern: ^-?\d+(?:\.\d+)?$
          required:
            - currency_code
            - impact_amount
          description: The impact converted with the rate stored on the alert.
        changed_since_check:
          type:
            - object
            - 'null'
          properties:
            agreement:
              type: boolean
              description: The agreement has a newer version than the one checked.
            invoice:
              type: boolean
              description: >-
                The invoice's evidence, such as its lines, amounts or documents,
                was edited or imported again.
          required:
            - agreement
            - invoice
          description: >-
            Whether the agreement or the invoice changed after the check that
            found this alert. A change does not make the alert wrong; check
            again to assess it against the new inputs. Null for older alerts
            that do not record what they assessed.
        invalidation:
          type:
            - object
            - 'null'
          properties:
            at:
              type: string
              format: date-time
            reason:
              type: string
              enum:
                - unmatched
          required:
            - at
            - reason
          description: >-
            Set when the alert no longer counts, for example because its invoice
            no longer matches the agreement. It keeps its verdict, credit and
            claim, and counts again if the invoice matches again.
        invoice:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
            invoice_number:
              type:
                - string
                - 'null'
            title:
              type:
                - string
                - 'null'
              description: The invoice's own title; its number is invoice_number.
            category:
              type: string
              enum:
                - invoice
                - credit_note
                - self_billed_invoice
            issued_date:
              type:
                - string
                - 'null'
              format: date
            due_date:
              type:
                - string
                - 'null'
              format: date
            currency_code:
              type:
                - string
                - 'null'
            total_amount_including_vat:
              type:
                - string
                - 'null'
              pattern: ^-?\d+(?:\.\d+)?$
          required:
            - id
            - invoice_number
            - title
            - category
            - issued_date
            - due_date
            - currency_code
            - total_amount_including_vat
        invoice_item:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
            line_number:
              type: integer
            product_code:
              type:
                - string
                - 'null'
            description:
              type:
                - string
                - 'null'
            unit:
              type:
                - string
                - 'null'
          required:
            - id
            - line_number
            - product_code
            - description
            - unit
          readOnly: true
          description: The current invoice line. Null when no line is linked.
        agreement:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
            title:
              type:
                - string
                - 'null'
            status:
              type: string
              enum:
                - draft
                - active
                - archived
            version:
              type: integer
              description: The current agreement version.
          required:
            - id
            - title
            - status
            - version
        supplier:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
            title:
              type:
                - string
                - 'null'
          required:
            - id
            - title
        recipient:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
            title:
              type:
                - string
                - 'null'
          required:
            - id
            - title
        topic:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
            title:
              type:
                - string
                - 'null'
            is_locked:
              type: boolean
          required:
            - id
            - title
            - is_locked
        claim:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
            title:
              type:
                - string
                - 'null'
            status:
              type: string
              enum:
                - pending
                - in_progress
                - completed
                - cancelled
          required:
            - id
            - title
            - status
          description: The claim this alert is currently attached to, if any.
        dismissal:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
              format: uuid
              description: Alerts dismissed together with the same reason share this ID.
            category:
              type:
                - string
                - 'null'
              enum:
                - wrong_alert
                - valid_not_actioning
                - already_handled
                - duplicate_covered
                - other
                - null
            note:
              type:
                - string
                - 'null'
            dismissed_at:
              type: string
              format: date-time
            dismissed_by:
              type:
                - object
                - 'null'
              properties:
                user:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type:
                        - string
                        - 'null'
                    deleted:
                      type: boolean
                      description: >-
                        The account was deleted. The name is kept, or null once
                        the account is anonymised.
                  required:
                    - id
                    - name
                    - deleted
                api_key:
                  type:
                    - object
                    - 'null'
                  properties:
                    id:
                      type: string
                      format: uuid
                    name:
                      type: string
                  required:
                    - id
                    - name
                  description: The API key used, retained after revocation.
              required:
                - user
                - api_key
              description: >-
                The person, and API key if one was used. Null when no person is
                recorded.
          required:
            - id
            - category
            - note
            - dismissed_at
            - dismissed_by
          description: >-
            Why the alert was dismissed, while its verdict is dismissed,
            credited or not. Dismiss it again with a different category or note
            to change the reason. Reopening or accepting clears it; the alert
            activity keeps the history.
        provenance:
          type: object
          properties:
            origin:
              type: string
              enum:
                - check
                - user
                - api_key
              description: >-
                Who created the alert: a compliance check, a person, or a person
                through an API key.
            created_by:
              type:
                - object
                - 'null'
              properties:
                user:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type:
                        - string
                        - 'null'
                    deleted:
                      type: boolean
                      description: >-
                        The account was deleted. The name is kept, or null once
                        the account is anonymised.
                  required:
                    - id
                    - name
                    - deleted
                api_key:
                  type:
                    - object
                    - 'null'
                  properties:
                    id:
                      type: string
                      format: uuid
                    name:
                      type: string
                  required:
                    - id
                    - name
                  description: The API key used, retained after revocation.
              required:
                - user
                - api_key
              description: >-
                The person, and API key if one was used. Null for alerts from
                checks.
            agreement_version:
              type:
                - integer
                - 'null'
              description: The agreement version assessed; compare with agreement.version.
            invoice_fingerprint:
              type:
                - string
                - 'null'
            retained_check:
              type:
                - object
                - 'null'
              properties:
                id:
                  type: string
                  format: uuid
              required:
                - id
              description: >-
                The compliance check that produced this alert. Null for older
                alerts.
          required:
            - origin
            - created_by
            - agreement_version
            - invoice_fingerprint
            - retained_check
        correction_relationships:
          type: array
          items:
            type: object
            properties:
              replacement_alert_id:
                type: string
                format: uuid
              replaced_alert_id:
                type: string
                format: uuid
            required:
              - replacement_alert_id
              - replaced_alert_id
          maxItems: 100
          description: Links between an added-item alert and the line alerts it replaces.
        correction_relationships_truncated:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - title
        - explanation
        - verdict
        - credit
        - correction_type
        - confidence
        - questions
        - impact_amount
        - currency_code
        - organization_currency
        - changed_since_check
        - invalidation
        - invoice
        - invoice_item
        - agreement
        - supplier
        - recipient
        - topic
        - claim
        - dismissal
        - provenance
        - correction_relationships
        - correction_relationships_truncated
        - created_at
        - updated_at
  securitySchemes:
    ApiKeyBearer:
      type: http
      scheme: bearer
      description: >-
        Personal API key sent as a bearer token, together with
        X-Organization-Id. The key must have at least the access level the
        endpoint requires (read, write or admin).

````

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