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

> Lists every non-deleted invoice belonging to the token organization, regardless of import source.

Results default to newest first. Use `sort` and `direction` to choose an allowlisted order. Pass `next_cursor` as `cursor` to continue; omitted sorting parameters are inherited from the cursor, while contradictory parameters return `400`.

Cursors are opaque and remain usable if the invoice at the preceding page boundary is deleted.

Each item is the same invoice resource returned by `GET /v1/invoices/{invoice_id}`. Open `invoice_url` in Watchdog for details and alert review.



## OpenAPI

````yaml https://api.watchdog.no/doc get /v1/invoices
openapi: 3.1.0
info:
  title: Watchdog API
  version: 0.0.0
  description: >-
    Watchdog public API. Server-to-server document upload and related
    operations.


    ## Authentication


    All `/v1/*` endpoints require a bearer token in the `Authorization` header
    (e.g. `Authorization: Bearer wdg_<your-token>`).


    **Generate a token:** sign in at [app.watchdog.no](https://app.watchdog.no),
    open **Settings → API keys**, and click **Create new key** (admins only).
    The plaintext token is shown **once** at creation and cannot be recovered —
    copy it into a secrets manager immediately. If lost, revoke and replace.


    Tokens carry one or more scopes: `invoices:write` for uploads and
    `invoices:read` for polling. New integration keys receive both
    automatically. The required scope per endpoint is listed under
    "Authorizations" below.
servers: []
security: []
paths:
  /v1/invoices:
    get:
      tags:
        - invoices
      summary: List invoices
      description: >-
        Lists every non-deleted invoice belonging to the token organization,
        regardless of import source.


        Results default to newest first. Use `sort` and `direction` to choose an
        allowlisted order. Pass `next_cursor` as `cursor` to continue; omitted
        sorting parameters are inherited from the cursor, while contradictory
        parameters return `400`.


        Cursors are opaque and remain usable if the invoice at the preceding
        page boundary is deleted.


        Each item is the same invoice resource returned by `GET
        /v1/invoices/{invoice_id}`. Open `invoice_url` in Watchdog for details
        and alert review.
      parameters:
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
            description: Maximum invoices to return. Defaults to 50 and cannot exceed 100.
            example: 50
          required: false
          description: Maximum invoices to return. Defaults to 50 and cannot exceed 100.
          name: limit
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 512
            description: >-
              Opaque continuation cursor from the preceding response. It retains
              the selected sort and direction.
            example: >-
              eyJ2IjoxLCJyZXNvdXJjZSI6Imludm9pY2VzIiwic29ydCI6ImNyZWF0ZWRfYXQiLCJkaXJlY3Rpb24iOiJkZXNjIiwic29ydF92YWx1ZSI6IjE3ODY0NjM5NjAwNjEwMDAiLCJpZCI6IjdhZDJjNTBkLTJjYzAtNDlhMC05YTljLTZmYTgxN2MxZmJjYiJ9
          required: false
          description: >-
            Opaque continuation cursor from the preceding response. It retains
            the selected sort and direction.
          name: cursor
          in: query
        - schema:
            type: string
            enum:
              - created_at
            default: created_at
            description: >-
              Field used to order invoices. Defaults to `created_at` for an
              initial request and is inherited from the cursor on continuation.
            example: created_at
          required: false
          description: >-
            Field used to order invoices. Defaults to `created_at` for an
            initial request and is inherited from the cursor on continuation.
          name: sort
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
            description: >-
              Sort direction. Defaults to `desc` for an initial request and is
              inherited from the cursor on continuation.
            example: desc
          required: false
          description: >-
            Sort direction. Defaults to `desc` for an initial request and is
            inherited from the cursor on continuation.
          name: direction
          in: query
      responses:
        '200':
          description: A page of invoices ordered by the selected field and invoice ID.
          headers:
            Cache-Control:
              schema:
                type: string
                example: no-store
              description: Prevents changing invoice states from being cached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceListResponse'
              example:
                invoices:
                  - invoice_id: 7ad2c50d-2cc0-49a0-9a9c-6fa817c1fbcb
                    invoice_number: '100234'
                    processing:
                      status: completed
                      classification: invoice
                      failure: null
                    alerts:
                      processing:
                        status: completed
                        skip_reason: null
                        failure: null
                      result: no_alerts_found
                      count: 0
                      resolution: null
                    invoice_url: >-
                      https://app.watchdog.no/org_3AFsEYath1408oAK0EkJikS8qp1/invoices/7ad2c50d-2cc0-49a0-9a9c-6fa817c1fbcb
                    created_at: '2026-08-12T07:44:20.000Z'
                next_cursor: null
        '400':
          description: The limit, sort, direction, or cursor is invalid.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ErrorBody_validation_error'
                  - $ref: '#/components/schemas/ErrorBody_invalid_request'
        '401':
          description: >-
            Authentication failed — missing, malformed, unknown, or revoked
            token. See `WWW-Authenticate` header per RFC 6750.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody_invalid_token'
        '403':
          description: >-
            Token is disabled (operator-controlled kill switch) or lacks the
            required scope.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ErrorBody_token_disabled'
                  - $ref: '#/components/schemas/ErrorBody_insufficient_scope'
        '429':
          description: >-
            Rate limit exceeded. Pre-auth IP cap is 300 req/min; per-token cap
            is 120 req/min. Response headers indicate when the caller may retry.
          headers:
            Retry-After:
              description: >-
                Seconds until the caller may retry. Only present on 429
                responses.
              schema:
                type: string
                example: '34'
            X-RateLimit-Limit:
              description: Maximum requests allowed in the current window.
              schema:
                type: string
                example: '300'
            X-RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: string
                example: '0'
            X-RateLimit-Reset:
              description: >-
                Unix timestamp in seconds when the current window resets. Divide
                by 1000 if you have a millisecond-precision clock.
              schema:
                type: string
                example: '1713793234'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody_rate_limit_exceeded'
        '500':
          description: Internal error listing invoices.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody_internal_error'
      security:
        - BearerAuth:
            - invoices:read
components:
  schemas:
    InvoiceListResponse:
      type: object
      properties:
        invoices:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceStatusResponse'
        next_cursor:
          type:
            - string
            - 'null'
          description: >-
            Opaque cursor for the next page, or `null` when no more invoices
            remain.
      required:
        - invoices
        - next_cursor
    ErrorBody_validation_error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_error
            message:
              type: string
            description:
              type: string
            request_id:
              type: string
          required:
            - code
            - message
            - request_id
      required:
        - error
    ErrorBody_invalid_request:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_request
            message:
              type: string
            description:
              type: string
            request_id:
              type: string
          required:
            - code
            - message
            - request_id
      required:
        - error
    ErrorBody_invalid_token:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_token
            message:
              type: string
            description:
              type: string
            request_id:
              type: string
          required:
            - code
            - message
            - request_id
      required:
        - error
    ErrorBody_token_disabled:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - token_disabled
            message:
              type: string
            description:
              type: string
            request_id:
              type: string
          required:
            - code
            - message
            - request_id
      required:
        - error
    ErrorBody_insufficient_scope:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - insufficient_scope
            message:
              type: string
            description:
              type: string
            request_id:
              type: string
          required:
            - code
            - message
            - request_id
      required:
        - error
    ErrorBody_rate_limit_exceeded:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - rate_limit_exceeded
            message:
              type: string
            description:
              type: string
            request_id:
              type: string
          required:
            - code
            - message
            - request_id
      required:
        - error
    ErrorBody_internal_error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - internal_error
            message:
              type: string
            description:
              type: string
            request_id:
              type: string
          required:
            - code
            - message
            - request_id
      required:
        - error
    InvoiceStatusResponse:
      type: object
      properties:
        invoice_id:
          type: string
          format: uuid
          description: Watchdog invoice identifier returned by the upload endpoint.
          example: 7ad2c50d-2cc0-49a0-9a9c-6fa817c1fbcb
        invoice_number:
          type:
            - string
            - 'null'
          description: >-
            Invoice number extracted from the document. May be `null` before
            extraction or when no number can be identified; it is not a unique
            identifier.
          example: '100234'
        processing:
          anyOf:
            - type: object
              properties:
                status:
                  type: string
                  enum:
                    - pending
                    - processing
                classification:
                  type: 'null'
                failure:
                  type: 'null'
              required:
                - status
                - classification
                - failure
            - type: object
              properties:
                status:
                  type: string
                  enum:
                    - completed
                classification:
                  type: string
                  enum:
                    - invoice
                    - credit_note
                    - self_billed_invoice
                    - not_invoice
                failure:
                  type: 'null'
              required:
                - status
                - classification
                - failure
            - type: object
              properties:
                status:
                  type: string
                  enum:
                    - failed
                classification:
                  type: 'null'
                failure:
                  type: object
                  properties:
                    code:
                      type: string
                      enum:
                        - invoice_processing_failed
                    message:
                      type: string
                      enum:
                        - Watchdog could not process this document.
                  required:
                    - code
                    - message
              required:
                - status
                - classification
                - failure
        alerts:
          anyOf:
            - type: object
              properties:
                processing:
                  type: object
                  properties:
                    status:
                      type: string
                      enum:
                        - pending
                        - processing
                    skip_reason:
                      type: 'null'
                    failure:
                      type: 'null'
                  required:
                    - status
                    - skip_reason
                    - failure
                result:
                  type: 'null'
                count:
                  type: 'null'
                resolution:
                  type: 'null'
              required:
                - processing
                - result
                - count
                - resolution
            - type: object
              properties:
                processing:
                  type: object
                  properties:
                    status:
                      type: string
                      enum:
                        - pending
                        - processing
                    skip_reason:
                      type: 'null'
                    failure:
                      type: 'null'
                  required:
                    - status
                    - skip_reason
                    - failure
                result:
                  type: string
                  enum:
                    - alerts_found
                count:
                  type: integer
                  exclusiveMinimum: 0
                resolution:
                  anyOf:
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - open
                        method:
                          type: 'null'
                      required:
                        - status
                        - method
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - resolved
                        method:
                          type: string
                          enum:
                            - credit_note
                      required:
                        - status
                        - method
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - resolved
                        method:
                          type: string
                          enum:
                            - manual_review
                      required:
                        - status
                        - method
              required:
                - processing
                - result
                - count
                - resolution
            - type: object
              properties:
                processing:
                  type: object
                  properties:
                    status:
                      type: string
                      enum:
                        - completed
                    skip_reason:
                      type: 'null'
                    failure:
                      type: 'null'
                  required:
                    - status
                    - skip_reason
                    - failure
                result:
                  type: string
                  enum:
                    - no_alerts_found
                count:
                  type: number
                  enum:
                    - 0
                resolution:
                  type: 'null'
              required:
                - processing
                - result
                - count
                - resolution
            - type: object
              properties:
                processing:
                  type: object
                  properties:
                    status:
                      type: string
                      enum:
                        - completed
                    skip_reason:
                      type: 'null'
                    failure:
                      type: 'null'
                  required:
                    - status
                    - skip_reason
                    - failure
                result:
                  type: string
                  enum:
                    - alerts_found
                count:
                  type: integer
                  exclusiveMinimum: 0
                resolution:
                  anyOf:
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - open
                        method:
                          type: 'null'
                      required:
                        - status
                        - method
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - resolved
                        method:
                          type: string
                          enum:
                            - credit_note
                      required:
                        - status
                        - method
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - resolved
                        method:
                          type: string
                          enum:
                            - manual_review
                      required:
                        - status
                        - method
              required:
                - processing
                - result
                - count
                - resolution
            - type: object
              properties:
                processing:
                  type: object
                  properties:
                    status:
                      type: string
                      enum:
                        - failed
                    skip_reason:
                      type: 'null'
                    failure:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - some_alert_checks_failed
                        message:
                          type: string
                          enum:
                            - Some agreement checks could not be completed.
                      required:
                        - code
                        - message
                  required:
                    - status
                    - skip_reason
                    - failure
                result:
                  type: 'null'
                count:
                  type: 'null'
                resolution:
                  type: 'null'
              required:
                - processing
                - result
                - count
                - resolution
            - type: object
              properties:
                processing:
                  type: object
                  properties:
                    status:
                      type: string
                      enum:
                        - failed
                    skip_reason:
                      type: 'null'
                    failure:
                      type: object
                      properties:
                        code:
                          type: string
                          enum:
                            - some_alert_checks_failed
                        message:
                          type: string
                          enum:
                            - Some agreement checks could not be completed.
                      required:
                        - code
                        - message
                  required:
                    - status
                    - skip_reason
                    - failure
                result:
                  type: string
                  enum:
                    - alerts_found
                count:
                  type: integer
                  exclusiveMinimum: 0
                resolution:
                  anyOf:
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - open
                        method:
                          type: 'null'
                      required:
                        - status
                        - method
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - resolved
                        method:
                          type: string
                          enum:
                            - credit_note
                      required:
                        - status
                        - method
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - resolved
                        method:
                          type: string
                          enum:
                            - manual_review
                      required:
                        - status
                        - method
              required:
                - processing
                - result
                - count
                - resolution
            - type: object
              properties:
                processing:
                  type: object
                  properties:
                    status:
                      type: string
                      enum:
                        - skipped
                    skip_reason:
                      type: string
                      enum:
                        - not_an_invoice
                        - invoice_processing_failed
                        - credit_note
                        - no_applicable_agreements
                        - credit_note_matched
                    failure:
                      type: 'null'
                  required:
                    - status
                    - skip_reason
                    - failure
                result:
                  type: 'null'
                count:
                  type: 'null'
                resolution:
                  type: 'null'
              required:
                - processing
                - result
                - count
                - resolution
          description: >-
            Aggregate alert-assessment summary across all applicable agreements.
            `count` preserves detected, non-superseded alerts even after review;
            `resolution` indicates whether they remain blocking. Individual
            alerts and agreement-level results are not exposed; use
            `invoice_url` to inspect them in Watchdog.
        invoice_url:
          type: string
          format: uri
          description: Absolute URL for reviewing the invoice and its alerts in Watchdog.
          example: >-
            https://app.watchdog.no/org_3AFsEYath1408oAK0EkJikS8qp1/invoices/7ad2c50d-2cc0-49a0-9a9c-6fa817c1fbcb
        created_at:
          type: string
          format: date-time
          description: When the invoice resource was created.
          example: '2026-08-12T07:44:20.000Z'
      required:
        - invoice_id
        - invoice_number
        - processing
        - alerts
        - invoice_url
        - created_at
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from Settings → API Keys. Plaintext is shown once at creation
        and cannot be recovered. Header: `Authorization: Bearer wdg_<token>`.

````