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

# Invite organization members

> Invites up to 50 addresses with the same role, teams and access limit, and reports each address that was not invited and why; the others are sent. When settings.allowed_invite_domains is nonempty, only addresses on those exact domains are invited. Existing members and pending invitations are unaffected by policy changes. `team_ids` places the people in those teams and `access_limit` sets their own limit when they accept. A member invited to the AP team must see every invoice: with a limit of their own or another team with one, the request returns 409 `ap_team_member_restricted` and nothing is sent.



## OpenAPI

````yaml /openapi.json post /v1/invitations
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/invitations:
    post:
      tags:
        - Invitations
        - Settings
      summary: Invite organization members
      description: >-
        Invites up to 50 addresses with the same role, teams and access limit,
        and reports each address that was not invited and why; the others are
        sent. When settings.allowed_invite_domains is nonempty, only addresses
        on those exact domains are invited. Existing members and pending
        invitations are unaffected by policy changes. `team_ids` places the
        people in those teams and `access_limit` sets their own limit when they
        accept. A member invited to the AP team must see every invoice: with a
        limit of their own or another team with one, the request returns 409
        `ap_team_member_restricted` and nothing is sent.
      operationId: createOrganizationInvitation
      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.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                emails:
                  type: array
                  items:
                    type: string
                    maxLength: 254
                    format: email
                  minItems: 1
                  maxItems: 50
                  description: >-
                    The addresses to invite. An address given twice, in any
                    case, is invited once.
                role:
                  type: string
                  enum:
                    - admin
                    - member
                team_ids:
                  type: array
                  items:
                    type: string
                    format: uuid
                  maxItems: 100
                  description: >-
                    Teams the person joins when they accept, before their first
                    request. To change them, revoke the invitation and send a
                    new one.
                access_limit:
                  anyOf:
                    - $ref: '#/components/schemas/AccessLimitInput'
                    - type: 'null'
                  description: >-
                    The access limit the person gets when they accept. Omitted
                    or null: none.
              required:
                - emails
                - role
              additionalProperties: false
      responses:
        '200':
          description: >-
            The invitations sent by email and the addresses not invited. Not
            idempotent: after an uncertain response, list invitations and send
            again only the addresses still to invite.
          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/OrganizationInvitationsSent'
        '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: >-
            `ap_team_member_restricted`: the people would join the AP team with
            an access limit; nothing was sent. `conflict`: the account provider
            could not complete the request; some invitations may already have
            been sent, so list invitations 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: >-
                    `ap_team_member_restricted`: the people would join the AP
                    team with an access limit; nothing was sent. `conflict`: the
                    account provider could not complete the request; some
                    invitations may already have been sent, so list invitations
                    before retrying.
                  request_id: req_example
              schema:
                $ref: '#/components/schemas/Error_conflict_ap_team_member_restricted'
        '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:
    AccessLimitInput:
      type: object
      properties:
        companies:
          type: object
          properties:
            mode:
              type: string
              enum:
                - all
                - only
            ids:
              type: array
              items:
                type: string
                format: uuid
              maxItems: 1000
              default: []
          default:
            mode: all
            ids: []
          required:
            - mode
          additionalProperties: false
        suppliers:
          type: object
          properties:
            mode:
              type: string
              enum:
                - all
                - only
                - except
            ids:
              type: array
              items:
                type: string
                format: uuid
              maxItems: 1000
              default: []
          default:
            mode: all
            ids: []
          required:
            - mode
          additionalProperties: false
        recipients:
          type: object
          properties:
            mode:
              type: string
              enum:
                - all
                - only
            ids:
              type: array
              items:
                type: string
                format: uuid
              maxItems: 1000
              default: []
          default:
            mode: all
            ids: []
          required:
            - mode
          additionalProperties: false
        approver_only:
          type: boolean
      additionalProperties: false
      description: >-
        What the member or team may see. Every part must hold: `companies`
        (`all`, including companies added later, or `only` the listed ones),
        `suppliers` (`all`, `only` the listed ones, or every supplier `except`
        the listed ones), `recipients` (`all`, or `only` the listed ones) and
        `approver_only` (when true, only invoices and purchase orders the member
        approves, named or through a team; credit notes and reminders follow
        their invoice). Omitted parts are `all`, and `approver_only` defaults to
        false. A limit that allows everything is stored as no limit. A member
        sees their own limit within what any of their limited teams allows;
        Admins always see everything.
    OrganizationInvitationsSent:
      type: object
      properties:
        sent:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationInvitation'
          description: The invitations sent, in the order asked.
        failed:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
                format: email
              code:
                type: string
                enum:
                  - invite_domain_not_allowed
                  - address_not_allowed
                  - already_member
                  - already_invited
                  - member_limit_reached
                  - rate_limited
            required:
              - email
              - code
          description: >-
            The addresses not invited, in the order asked.
            `invite_domain_not_allowed`: the domain is not in
            settings.allowed_invite_domains. `address_not_allowed`: the Watchdog
            sign-in does not accept the address. `already_member`: they are a
            member. `already_invited`: they have a pending invitation; revoke it
            to send another. `member_limit_reached`: members and pending
            invitations fill the member limit. `rate_limited`: too many
            invitations were sent recently; try again later.
      required:
        - sent
        - failed
    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_ap_team_member_restricted:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - conflict
                - ap_team_member_restricted
            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
    OrganizationInvitation:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 255
        email:
          type: string
          format: email
        role:
          type: string
          enum:
            - admin
            - member
            - unsupported
        status:
          type:
            - string
            - 'null'
          enum:
            - pending
            - accepted
            - revoked
            - expired
            - null
        teams:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              name:
                type: string
            required:
              - id
              - name
          description: >-
            Teams the person joins when they accept. Teams deleted since are
            left out.
        access_limit:
          anyOf:
            - $ref: '#/components/schemas/AccessLimit'
            - type: 'null'
          description: The access limit the person gets when they accept; null for none.
        created_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
      required:
        - id
        - email
        - role
        - status
        - teams
        - access_limit
        - created_at
        - expires_at
    AccessLimit:
      type: object
      properties:
        companies:
          type: object
          properties:
            mode:
              type: string
              enum:
                - all
                - only
            items:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  name:
                    type:
                      - string
                      - 'null'
                    description: Null when the company, supplier or recipient is gone.
                required:
                  - id
                  - name
          required:
            - mode
            - items
        suppliers:
          type: object
          properties:
            mode:
              type: string
              enum:
                - all
                - only
                - except
            items:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  name:
                    type:
                      - string
                      - 'null'
                    description: Null when the company, supplier or recipient is gone.
                required:
                  - id
                  - name
          required:
            - mode
            - items
        recipients:
          type: object
          properties:
            mode:
              type: string
              enum:
                - all
                - only
            items:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  name:
                    type:
                      - string
                      - 'null'
                    description: Null when the company, supplier or recipient is gone.
                required:
                  - id
                  - name
          required:
            - mode
            - items
        approver_only:
          type: boolean
          description: >-
            Only invoices and purchase orders the member approves, named or
            through a team.
      required:
        - companies
        - suppliers
        - recipients
        - approver_only
  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.