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

# List what was received and needs attention

> Lists what the organization received that did not become a checked invoice, newest first: Peppol, email and accounting-system imports that failed and will not retry themselves, received documents that are not invoices, invoices whose background runs did not finish after their retries, accounting connections that stopped bringing invoices in, Tripletex integrations whose sending stopped because the sign-in expired, and payment reminders for invoices not in Watchdog. Each member sees what concerns the imports and invoices they can see; connections only an admin can fix show to admins. Each kind shows its 100 newest items. An item leaves the list when it is resolved (the import retried or removed, a not_an_invoice file attached to an invoice, the invoice's area run again, the connection renewed or signed in to again, the reminder linked) or marked as handled with markNeedsAttentionHandled; handled=true lists those. Members who turn it on in their notification settings also get a daily email of what is new here.



## OpenAPI

````yaml /openapi.json get /v1/intake/needs-attention
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/intake/needs-attention:
    get:
      tags:
        - Invoice imports
        - Invoices
      summary: List what was received and needs attention
      description: >-
        Lists what the organization received that did not become a checked
        invoice, newest first: Peppol, email and accounting-system imports that
        failed and will not retry themselves, received documents that are not
        invoices, invoices whose background runs did not finish after their
        retries, accounting connections that stopped bringing invoices in,
        Tripletex integrations whose sending stopped because the sign-in
        expired, and payment reminders for invoices not in Watchdog. Each member
        sees what concerns the imports and invoices they can see; connections
        only an admin can fix show to admins. Each kind shows its 100 newest
        items. An item leaves the list when it is resolved (the import retried
        or removed, a not_an_invoice file attached to an invoice, the invoice's
        area run again, the connection renewed or signed in to again, the
        reminder linked) or marked as handled with markNeedsAttentionHandled;
        handled=true lists those. Members who turn it on in their notification
        settings also get a daily email of what is new here.
      operationId: listNeedsAttention
      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.
        - schema:
            type: boolean
            default: false
            description: true lists the items marked as handled instead of the open ones.
          required: false
          description: true lists the items marked as handled instead of the open ones.
          name: handled
          in: query
      responses:
        '200':
          description: What needs attention.
          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/NeedsAttention'
        '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:
              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
              schema:
                $ref: '#/components/schemas/Error_validation_error'
        '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:
              example:
                error:
                  code: invalid_token
                  message: The bearer token is missing or invalid.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_invalid_token'
        '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:
              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
              schema:
                $ref: >-
                  #/components/schemas/Error_forbidden_token_disabled_organization_required_insufficient_role_mfa_required
        '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:
              example:
                error:
                  code: rate_limit_exceeded
                  message: >-
                    Too many requests. Wait for the Retry-After delay before
                    retrying.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_rate_limit_exceeded'
        '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:
              example:
                error:
                  code: internal_error
                  message: >-
                    Unexpected server failure. Include the request ID when
                    contacting support.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_internal_error'
        '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:
              example:
                error:
                  code: service_unavailable
                  message: >-
                    Temporarily unavailable. Retry after the Retry-After delay,
                    when provided.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_service_unavailable'
      security:
        - ApiKeyBearer: []
components:
  schemas:
    NeedsAttention:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/NeedsAttentionItem'
        truncated:
          type: boolean
          description: True when a kind has more items than the 100 newest shown here.
      required:
        - data
        - truncated
    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_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
    NeedsAttentionItem:
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - import_failed
                - not_an_invoice
              description: >-
                import_failed: an import failed and will not retry itself,
                either received over Peppol or email or synced from an
                accounting connection. not_an_invoice: a document received over
                Peppol or email was read as something other than an invoice.
            subject_id:
              type: string
              format: uuid
              description: >-
                The occurrence the item is about: the import attempt, the
                background run or the connection. A later failure is a new
                occurrence and a new item.
            occurred_at:
              type: string
              format: date-time
            handled:
              type:
                - object
                - 'null'
              properties:
                at:
                  type: string
                  format: date-time
                by:
                  type:
                    - object
                    - 'null'
                  properties:
                    user_id:
                      type: string
                    name:
                      type:
                        - string
                        - 'null'
                  required:
                    - user_id
                    - name
              required:
                - at
                - by
              description: Who marked the item as handled, and when; null while it is open.
            import_id:
              type: string
              format: uuid
            channel:
              type: string
              enum:
                - peppol
                - email
                - integration
              description: >-
                How the document arrived: received over Peppol or email, or
                synced from an accounting connection.
            integration_name:
              type:
                - string
                - 'null'
              description: >-
                The accounting connection a synced import came from; null for
                Peppol and email.
            file_name:
              type:
                - string
                - 'null'
            document_id:
              type:
                - string
                - 'null'
              format: uuid
              description: >-
                The file file_name names. For not_an_invoice, the import's next
                file not yet on an invoice, to attach with
                attachInvoiceDocument: files sent along travel in the same
                import, and the item resolves once every one is on an invoice.
                Null once the file is gone.
            reason:
              type:
                - string
                - 'null'
              description: Why the import failed, as the import's failure says.
            failure_code:
              type:
                - string
                - 'null'
              description: >-
                The import's failure code (getInvoiceImport failure.code):
                creditor_unknown asks a person to choose the supplier
                (chooseInvoiceImportLetterCreditor).
            cause:
              type: string
              enum:
                - not_an_invoice
                - creditor_unknown
                - several_invoices
                - file_too_large
                - company_archived
                - unreadable
              description: >-
                Why it did not become an invoice, in the terms a person acts on:
                not_an_invoice (read as something else; read it as an invoice or
                attach its files to one), creditor_unknown (choose the
                supplier), several_invoices (split the file and send it again),
                file_too_large (send a smaller file), company_archived
                (unarchive the company, then retry), unreadable (Watchdog could
                not read it; only Watchdog can fix it).
            owner:
              type: string
              enum:
                - organization
                - watchdog
              description: >-
                Whose move is next: the organization, or Watchdog (cause
                unreadable), which is notified of every such failure.
            invoice:
              type: object
              properties:
                supplier_name:
                  type:
                    - string
                    - 'null'
                invoice_number:
                  type:
                    - string
                    - 'null'
                total:
                  type:
                    - string
                    - 'null'
                  description: Including VAT, as a decimal string.
                currency:
                  type:
                    - string
                    - 'null'
                due_date:
                  type:
                    - string
                    - 'null'
                  format: date
              required:
                - supplier_name
                - invoice_number
                - total
                - currency
                - due_date
              description: >-
                The invoice as its source names it, where it does: a synced
                import's record in the accounting system. Null fields are
                unknown.
            suggested_invoice:
              type:
                - object
                - 'null'
              properties:
                id:
                  type: string
                  format: uuid
                invoice_number:
                  type:
                    - string
                    - 'null'
                supplier_name:
                  type:
                    - string
                    - 'null'
                category:
                  type: string
                  enum:
                    - invoice
                    - credit_note
                    - self_billed_invoice
                    - reminder
                    - collection_notice
                total:
                  type:
                    - string
                    - 'null'
                  description: Including VAT, as a decimal string.
                currency:
                  type:
                    - string
                    - 'null'
                issued_date:
                  type:
                    - string
                    - 'null'
                  format: date
                sent_for_approval:
                  type: boolean
                  description: >-
                    The invoice is sent for approval, so attaching a file to it
                    is refused until it is reopened.
              required:
                - id
                - invoice_number
                - supplier_name
                - category
                - total
                - currency
                - issued_date
                - sent_for_approval
              description: >-
                For not_an_invoice received by email: the invoice the rest of
                that email became, when it became exactly one you can see; the
                invoice the file most likely belongs to. Null otherwise.
            reported:
              type:
                - object
                - 'null'
              properties:
                at:
                  type: string
                  format: date-time
                by:
                  type:
                    - object
                    - 'null'
                  properties:
                    user_id:
                      type: string
                    name:
                      type:
                        - string
                        - 'null'
                  required:
                    - user_id
                    - name
              required:
                - at
                - by
              description: >-
                Who reported the item to Watchdog support with
                reportNeedsAttention, and when; null until someone does.
          required:
            - kind
            - subject_id
            - occurred_at
            - handled
            - import_id
            - channel
            - integration_name
            - file_name
            - document_id
            - reason
            - failure_code
            - cause
            - owner
            - invoice
            - suggested_invoice
            - reported
        - type: object
          properties:
            kind:
              type: string
              enum:
                - background_run_failed
              description: >-
                One of the invoice's background runs did not finish after its
                retries, or failed in a way a retry cannot fix. Retry it with
                retryWorkflowRun (subject_id is the run).
            subject_id:
              type: string
              format: uuid
              description: >-
                The occurrence the item is about: the import attempt, the
                background run or the connection. A later failure is a new
                occurrence and a new item.
            occurred_at:
              type: string
              format: date-time
            handled:
              type:
                - object
                - 'null'
              properties:
                at:
                  type: string
                  format: date-time
                by:
                  type:
                    - object
                    - 'null'
                  properties:
                    user_id:
                      type: string
                    name:
                      type:
                        - string
                        - 'null'
                  required:
                    - user_id
                    - name
              required:
                - at
                - by
              description: Who marked the item as handled, and when; null while it is open.
            invoice_id:
              type: string
              format: uuid
            invoice_number:
              type:
                - string
                - 'null'
            supplier_name:
              type:
                - string
                - 'null'
            area:
              type: string
              enum:
                - agreements
                - credit_notes
                - purchase_orders
            failed_steps:
              type: array
              items:
                type: string
                enum:
                  - smart_match
                  - initial_checks
                  - match
                  - recover
                  - allocate
                  - match_order
                  - allocate_lines
              description: The run's steps that failed.
          required:
            - kind
            - subject_id
            - occurred_at
            - handled
            - invoice_id
            - invoice_number
            - supplier_name
            - area
            - failed_steps
        - type: object
          properties:
            kind:
              type: string
              enum:
                - connection_stopped
              description: An accounting connection stopped bringing invoices in.
            subject_id:
              type: string
              format: uuid
              description: >-
                The occurrence the item is about: the import attempt, the
                background run or the connection. A later failure is a new
                occurrence and a new item.
            occurred_at:
              type: string
              format: date-time
            handled:
              type:
                - object
                - 'null'
              properties:
                at:
                  type: string
                  format: date-time
                by:
                  type:
                    - object
                    - 'null'
                  properties:
                    user_id:
                      type: string
                    name:
                      type:
                        - string
                        - 'null'
                  required:
                    - user_id
                    - name
              required:
                - at
                - by
              description: Who marked the item as handled, and when; null while it is open.
            integration_id:
              type: string
              format: uuid
            integration_name:
              type: string
            integration_type:
              type: string
            status:
              type: string
              enum:
                - invalid_credentials
                - permission_denied
          required:
            - kind
            - subject_id
            - occurred_at
            - handled
            - integration_id
            - integration_name
            - integration_type
            - status
        - type: object
          properties:
            kind:
              type: string
              enum:
                - sending_stopped
              description: >-
                Sending invoices to Tripletex stopped: the Tripletex sign-in on
                an integration with invoices_write on has expired. Someone signs
                in to Tripletex on the integration again (POST
                /v1/integrations/authorizations with provider tripletex and
                integration_id).
            subject_id:
              type: string
              format: uuid
              description: >-
                The occurrence the item is about: the import attempt, the
                background run or the connection. A later failure is a new
                occurrence and a new item.
            occurred_at:
              type: string
              format: date-time
            handled:
              type:
                - object
                - 'null'
              properties:
                at:
                  type: string
                  format: date-time
                by:
                  type:
                    - object
                    - 'null'
                  properties:
                    user_id:
                      type: string
                    name:
                      type:
                        - string
                        - 'null'
                  required:
                    - user_id
                    - name
              required:
                - at
                - by
              description: Who marked the item as handled, and when; null while it is open.
            integration_id:
              type: string
              format: uuid
            integration_name:
              type: string
            integration_type:
              type: string
            person_name:
              type: string
              description: The Tripletex user invoices were sent as.
          required:
            - kind
            - subject_id
            - occurred_at
            - handled
            - integration_id
            - integration_name
            - integration_type
            - person_name
  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.