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

# Count active invoices in each lifecycle phase and status

> Counts the invoices in Inbox, Approval and Payment (lifecycle.phase), and each active lifecycle.status, under the same filters and access as listInvoices, ignoring phase and lifecycle_statuses so every phase is counted. Done invoices are not counted. Calculates no monetary totals. Searches matching more than 1,000 invoices must be narrowed.



## OpenAPI

````yaml /openapi.json get /v1/invoices/lifecycle-counts
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/invoices/lifecycle-counts:
    get:
      tags:
        - Invoices
      summary: Count active invoices in each lifecycle phase and status
      description: >-
        Counts the invoices in Inbox, Approval and Payment (lifecycle.phase),
        and each active lifecycle.status, under the same filters and access as
        listInvoices, ignoring phase and lifecycle_statuses so every phase is
        counted. Done invoices are not counted. Calculates no monetary totals.
        Searches matching more than 1,000 invoices must be narrowed.
      operationId: getInvoiceLifecycleCounts
      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: fields
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
          style: form
          explode: false
          description: >-
            Return only these fields; use dots for nested fields, such as
            statuses.reading. Fields: active, inbox, approval, payment,
            statuses.
        - schema:
            type: array
            items:
              type: string
          required: false
          style: form
          explode: false
          name: view_ids
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 200
            description: >-
              Invoice number, title, party name or a reference, ignoring case;
              eight or more digits, or a VAT number with its country prefix,
              also match an organization or VAT number. Under three characters
              match the start of the invoice number.
          required: false
          description: >-
            Invoice number, title, party name or a reference, ignoring case;
            eight or more digits, or a VAT number with its country prefix, also
            match an organization or VAT number. Under three characters match
            the start of the invoice number.
          name: search
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 200
            description: Ignoring case; under three characters match its start.
          required: false
          description: Ignoring case; under three characters match its start.
          name: invoice_number
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          style: form
          explode: false
          name: supplier_ids
          in: query
        - schema:
            type: array
            items:
              type: string
              format: uuid
            minItems: 1
            maxItems: 1000
          required: false
          style: form
          explode: false
          name: company_ids
          in: query
        - schema:
            type: boolean
            description: >-
              true: invoices waiting for a person to choose their company
              (company_id null; setInvoiceCompany); false: those with one. Only
              members with access to every company see them.
          required: false
          description: >-
            true: invoices waiting for a person to choose their company
            (company_id null; setInvoiceCompany); false: those with one. Only
            members with access to every company see them.
          name: without_company
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          style: form
          explode: false
          name: recipient_ids
          in: query
        - schema:
            type: array
            items:
              type: string
              enum:
                - invoice
                - credit_note
                - self_billed_invoice
                - reminder
                - collection_notice
          required: false
          style: form
          explode: false
          name: categories
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          style: form
          explode: false
          name: currency_codes
          in: query
        - schema:
            type: array
            items:
              type: string
              enum:
                - not_checked
                - checking
                - has_issues
                - clean
                - credited
            description: >-
              checking: a check is running; has_issues: open alerts; clean:
              checked, no open alerts; credited: covered by credit notes.
          required: false
          description: >-
            checking: a check is running; has_issues: open alerts; clean:
            checked, no open alerts; credited: covered by credit notes.
          style: form
          explode: false
          name: alert_statuses
          in: query
        - schema:
            type: array
            items:
              type: string
              enum:
                - high
                - mid
                - low
                - unknown
            description: Extraction confidence.
          required: false
          description: Extraction confidence.
          style: form
          explode: false
          name: confidence_levels
          in: query
        - schema:
            type: array
            items:
              type: string
              enum:
                - not_checkable
                - checking
                - not_checked
                - completed
                - incomplete
            description: >-
              completed: every matched agreement checked; incomplete: a check
              missing or failed; not_checkable: credit notes, and invoices fully
              reversed or without a document.
          required: false
          description: >-
            completed: every matched agreement checked; incomplete: a check
            missing or failed; not_checkable: credit notes, and invoices fully
            reversed or without a document.
          style: form
          explode: false
          name: check_statuses
          in: query
        - schema:
            type: boolean
            description: >-
              Invoices linked to a credit note, and credit notes linked to an
              invoice.
          required: false
          description: >-
            Invoices linked to a credit note, and credit notes linked to an
            invoice.
          name: has_recorded_match
          in: query
        - schema:
            type: string
            enum:
              - invoice
              - selected_agreements
            default: invoice
            description: >-
              invoice covers all of the invoice's checks and alerts;
              selected_agreements covers only the agreements in agreement_ids
              (required).
          required: false
          description: >-
            invoice covers all of the invoice's checks and alerts;
            selected_agreements covers only the agreements in agreement_ids
            (required).
          name: alert_scope
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          required: false
          name: issued_from
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          required: false
          name: issued_through
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          required: false
          name: due_from
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          required: false
          name: due_through
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: >-
              Received (created_at) on or after this day, in the organization's
              time zone.
          required: false
          description: >-
            Received (created_at) on or after this day, in the organization's
            time zone.
          name: created_from
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: As created_from, on or before.
          required: false
          description: As created_from, on or before.
          name: created_through
          in: query
        - schema:
            type: boolean
            description: The amounts add up (amounts.valid).
          required: false
          description: The amounts add up (amounts.valid).
          name: financially_valid
          in: query
        - schema:
            type: boolean
            description: A person has confirmed the extracted data.
          required: false
          description: A person has confirmed the extracted data.
          name: extraction_confirmed
          in: query
        - schema:
            type: boolean
          required: false
          name: review_recommended
          in: query
        - schema:
            type: array
            items:
              type: string
              format: uuid
            description: Invoices matched to any of these agreements.
          required: false
          description: Invoices matched to any of these agreements.
          style: form
          explode: false
          name: agreement_ids
          in: query
        - schema:
            type: boolean
            description: Matched to at least one agreement.
          required: false
          description: Matched to at least one agreement.
          name: has_agreement_match
          in: query
        - schema:
            type: boolean
            description: Alerts pending or accepted and not credited, even while checking.
          required: false
          description: Alerts pending or accepted and not credited, even while checking.
          name: has_open_alerts
          in: query
        - schema:
            type: boolean
            default: false
            description: true lists only soft-deleted invoices.
          required: false
          description: true lists only soft-deleted invoices.
          name: deleted
          in: query
        - schema:
            type: string
            enum:
              - inbox
              - needs_approval
              - on_hold
              - approved
              - rejected
            description: Superseded by phase and lifecycle_statuses.
          required: false
          description: Superseded by phase and lifecycle_statuses.
          name: stage
          in: query
        - schema:
            type: boolean
          required: false
          name: overdue
          in: query
        - schema:
            type: string
            enum:
              - me
            description: 'me: invoices where the caller is one of the approvers.'
          required: false
          description: 'me: invoices where the caller is one of the approvers.'
          name: approver
          in: query
        - schema:
            type: array
            items:
              type: string
              minLength: 1
              maxLength: 255
            description: >-
              Approvers include any of these members, by name or through a team,
              before and after they approve; who must act now is actionable.
          required: false
          description: >-
            Approvers include any of these members, by name or through a team,
            before and after they approve; who must act now is actionable.
          style: form
          explode: false
          name: approver_user_ids
          in: query
        - schema:
            type: string
            enum:
              - inbox
              - approval
              - payment
              - done
            description: As lifecycle.phase.
          required: false
          description: As lifecycle.phase.
          name: phase
          in: query
        - schema:
            type: array
            items:
              type: string
              enum:
                - reading
                - missing_info
                - ready_for_approval
                - no_new_charges
                - sent_back
                - awaiting_approval
                - on_hold
                - not_ready_to_send
                - ready_to_send
                - send_failed
                - rejected_in_accounting
                - sent
                - awaiting_payment
                - paid
                - booked
                - closed
                - cancelled
            description: As lifecycle.status.
          required: false
          description: As lifecycle.status.
          style: form
          explode: false
          name: lifecycle_statuses
          in: query
        - schema:
            type: string
            enum:
              - me
            description: >-
              me: invoices whose next action is the caller's
              (lifecycle.next_action.mine).
          required: false
          description: >-
            me: invoices whose next action is the caller's
            (lifecycle.next_action.mine).
          name: actionable
          in: query
        - schema:
            type: array
            items:
              $ref: '#/components/schemas/TransferFailureCode'
            description: >-
              Last send to the accounting system failed with any of these
              (transfer.failure.code).
          required: false
          description: >-
            Last send to the accounting system failed with any of these
            (transfer.failure.code).
          style: form
          explode: false
          name: transfer_failures
          in: query
        - schema:
            type: boolean
            description: >-
              Sent to the accounting system, neither booked nor paid there, and
              rejected in its approval or waiting more than seven days.
          required: false
          description: >-
            Sent to the accounting system, neither booked nor paid there, and
            rejected in its approval or waiting more than seven days.
          name: transfer_stuck
          in: query
        - schema:
            type: string
            enum:
              - and
              - or
            default: and
            description: >-
              search, invoice_number, agreement_ids, created_from,
              created_through, review_recommended, deleted, stage, overdue,
              approver, approver_user_ids, phase, lifecycle_statuses,
              actionable, transfer_failures and transfer_stuck always apply.
          required: false
          description: >-
            search, invoice_number, agreement_ids, created_from,
            created_through, review_recommended, deleted, stage, overdue,
            approver, approver_user_ids, phase, lifecycle_statuses, actionable,
            transfer_failures and transfer_stuck always apply.
          name: join_operator
          in: query
        - schema:
            type: array
            items:
              type: string
              enum:
                - supplier_ids
                - recipient_ids
                - categories
                - currency_codes
                - confidence_levels
                - check_statuses
                - alert_statuses
                - agreement_ids
            description: List filters to invert.
          required: false
          description: List filters to invert.
          style: form
          explode: false
          name: not
          in: query
      responses:
        '200':
          description: >-
            Exact counts for each active phase and status, and all active
            invoices.
          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:
                active: 9
                inbox: 3
                approval: 4
                payment: 2
                statuses:
                  reading: 0
                  missing_info: 1
                  ready_for_approval: 2
                  no_new_charges: 0
                  sent_back: 0
                  awaiting_approval: 3
                  on_hold: 1
                  not_ready_to_send: 0
                  ready_to_send: 1
                  send_failed: 0
                  rejected_in_accounting: 0
                  sent: 0
                  awaiting_payment: 1
              schema:
                $ref: '#/components/schemas/InvoiceLifecycleCounts'
        '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
        '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:
              example:
                error:
                  code: not_found
                  message: The resource does not exist in the current organization.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_not_found'
        '409':
          description: >-
            One or more selected Views have invalid saved filter rules. Update
            the View filters 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.
          content:
            application/json:
              example:
                error:
                  code: conflict
                  message: >-
                    One or more selected Views have invalid saved filter rules.
                    Update the View filters before retrying.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_conflict'
        '422':
          description: >-
            More than 1,000 invoices match search or invoice_number. Narrow the
            search or use other filters.
          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: search_too_broad
                  message: >-
                    More than 1,000 invoices match search or invoice_number.
                    Narrow the search or use other filters.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_search_too_broad'
        '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:
    TransferFailureCode:
      type: string
      enum:
        - unsupported_category
        - no_connection
        - connection_disabled
        - invoice_incomplete
        - not_coded
        - coding_from_other_connection
        - amounts_mismatch
        - company_mismatch
        - supplier_not_in_erp
        - supplier_link_unavailable
        - supplier_ambiguous
        - supplier_same_name
        - currency_unsupported
        - nothing_to_post
        - too_many_lines
        - dimension_unsupported
        - rounding_account_missing
        - sign_in_missing
        - sign_in_expired
        - sender_permission_missing
        - supplier_invoice_flow_off
        - duplicate_in_erp
        - ambiguous
        - changed_after_transfer
        - not_supplier_invoice
        - registered_differs
        - not_bookable
        - permission_missing
        - credentials_rejected
        - rejected
        - documents_rejected
        - documents_missing
        - reply_unreadable
        - provider_changed
        - unavailable
        - transfer_error
    InvoiceLifecycleCounts:
      type: object
      properties:
        active:
          type: integer
          minimum: 0
          description: 'Selected invoices in Inbox, Approval or Payment: not yet done.'
        inbox:
          type: integer
          minimum: 0
          description: >-
            lifecycle.phase inbox: being read, missing info, ready for approval,
            or a letter with no new charges to complete.
        approval:
          type: integer
          minimum: 0
          description: 'lifecycle.phase approval: awaiting approval or on hold.'
        payment:
          type: integer
          minimum: 0
          description: >-
            lifecycle.phase payment: approved, on its way to the accounting
            system or waiting for payment there.
        statuses:
          type: object
          properties:
            reading:
              type: integer
              minimum: 0
            missing_info:
              type: integer
              minimum: 0
            ready_for_approval:
              type: integer
              minimum: 0
            no_new_charges:
              type: integer
              minimum: 0
            sent_back:
              type: integer
              minimum: 0
            awaiting_approval:
              type: integer
              minimum: 0
            on_hold:
              type: integer
              minimum: 0
            not_ready_to_send:
              type: integer
              minimum: 0
            ready_to_send:
              type: integer
              minimum: 0
            send_failed:
              type: integer
              minimum: 0
            rejected_in_accounting:
              type: integer
              minimum: 0
            sent:
              type: integer
              minimum: 0
            awaiting_payment:
              type: integer
              minimum: 0
          required:
            - reading
            - missing_info
            - ready_for_approval
            - no_new_charges
            - sent_back
            - awaiting_approval
            - on_hold
            - not_ready_to_send
            - ready_to_send
            - send_failed
            - rejected_in_accounting
            - sent
            - awaiting_payment
          description: >-
            The active invoices by lifecycle.status, as the list presents each
            one.
      required:
        - active
        - inbox
        - approval
        - payment
        - statuses
    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_search_too_broad:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - search_too_broad
            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
  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.