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

# Update main approval setup

> Updates the main approval setup for an organization. The approval workflow must already be active (created via POST) before it can be updated. The `approvalId` path parameter must match the id of the existing approval setup for the organization. The `organizationId` path parameter supports both the Findity id and the partner-side `externalId`.




## OpenAPI

````yaml /openapi/findity-admin-api.json put /organizations/{organizationId}/approval/{approvalId}
openapi: 3.1.0
info:
  title: Findity Admin API
  description: Findity Admin API
  version: 1.0.0
servers:
  - url: https://stage-api.findity.com/api/v1/admin
  - url: https://api.findity.com/api/v1/admin
security:
  - bearerAuth: []
paths:
  /organizations/{organizationId}/approval/{approvalId}:
    put:
      tags:
        - Approval
      summary: Update main approval setup
      description: >
        Updates the main approval setup for an organization. The approval
        workflow must already be active (created via POST) before it can be
        updated. The `approvalId` path parameter must match the id of the
        existing approval setup for the organization. The `organizationId` path
        parameter supports both the Findity id and the partner-side
        `externalId`.
      operationId: adminUpdateMainApprovalSetup
      parameters:
        - $ref: '#/components/parameters/organizationIdOrExternalIdInPath'
        - $ref: '#/components/parameters/approvalIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalRequestOptional'
            example:
              numberOfRequiredApprovals: 1
              defaultApprover:
                id: ff8080819e01726d019e0172af210527
      responses:
        '200':
          description: Approval setup successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Approval'
              examples:
                Approval setup updated:
                  value:
                    id: ff8080819e01726d019e0172adb90350
                    numberOfRequiredApprovals: 3
                    requiresApproval: true
                    defaultApprover:
                      firstName: firstName
                      lastName: lastName
                      id: ff8080819e01726d019e0172af210527
                      email: firstName.lastName@test.com
                      externalId: personIdFromExternalSystem
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400Error'
              examples:
                Approval workflow has not been activated yet — use POST to create it:
                  value:
                    result: error
                    code: APPROVAL_WORKFLOW_NOT_ACTIVE
                    description: >-
                      Approval flow must be first activated and setup via POST
                      method
                Provided approvalId does not match the existing approval setup for this organization:
                  value:
                    result: error
                    code: MISMATCH_APPROVAL_SETUP_ID
                    description: >-
                      Provided approvalId does not match the existing approval
                      setup id for this organization
                Number of approvals is missing:
                  value:
                    result: error
                    code: MISSING_NUMBER_OF_APPROVALS
                    description: Number of approvals must be provided
                Number of approvals is lower than 1:
                  value:
                    result: error
                    code: INVALID_VALUE_FOR_NUMBER_OF_APPROVALS
                    description: Number of approvals has to have minimum value of 1
                Default approver id/externalId is missing:
                  value:
                    result: error
                    code: MISSING_DEFAULT_APPROVER_ID
                    description: Default approver id/externalId has to be provided
        '404':
          description: Not found error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Error'
              examples:
                Organization not found:
                  value:
                    result: error
                    code: ORGANIZATION_NOT_FOUND
                    description: Organization not found
                No active license found for approval for organization:
                  value:
                    result: error
                    code: LICENSE_APPROVAL_NOT_FOUND
                    description: Active license for approval flow not found
components:
  parameters:
    organizationIdOrExternalIdInPath:
      in: path
      name: organizationId
      required: true
      description: >-
        Unique identifier of the organization. String in UUID without dashes
        (32-character hex string) if access is done via values from Findity
        system otherwise, id of external system can be used
      schema:
        type: string
      examples:
        Findity unique id:
          value: 05b8daba9ba14a49846fe77883248cf0
        External system unique id:
          value: a31a7372-3397-3924-ffcd-b7b4795e42eb
    approvalIdPath:
      in: path
      name: approvalId
      required: true
      description: >-
        Unique identifier of the approval setup. String in UUID without dashes
        (32-character hex string).
      schema:
        $ref: '#/components/schemas/Uuid'
      example: ff8080819e01726d019e0172adb90350
  schemas:
    ApprovalRequestOptional:
      type: object
      properties:
        numberOfRequiredApprovals:
          type: integer
          minimum: 1
          maximum: 3
          description: >
            Number of sequential approvals an expense report must receive before
            it can be submitted. Only applicable when requiresApproval is true.
            Must be between 1 and 3.
        defaultApprover:
          type: object
          description: >
            The person designated as the default approver when no other approver
            is assigned to a submitter. Required when requiresApproval is true.
            Identify the person by providing either their Findity id or their
            externalId. In  case that id is provided, externalId will be
            disregarded.
          properties:
            id:
              allOf:
                - $ref: '#/components/schemas/Uuid'
              description: >
                Findity unique identifier of the person to set as default
                approver. Provide either id or externalId — id takes precedence
                if both are given.
            externalId:
              type: string
              maxLength: 255
              description: >
                External system identifier of the person to set as default
                approver. Used when the caller identifies persons by their
                external system id. Ignored if id is also provided.
    Approval:
      type: object
      required:
        - id
        - requiresApproval
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/Uuid'
          readOnly: true
        requiresApproval:
          type: boolean
          description: >
            Indicates whether the organization requires approval for expense
            reports. true = approval is required; false = no approval is
            required.
        numberOfRequiredApprovals:
          type: integer
          minimum: 1
          maximum: 3
          description: >
            Number of sequential approvals an expense report must receive before
            it can proceed. Optional; only applicable when requiresApproval is
            true.
        defaultApprover:
          type: object
          description: >-
            One person has to be set as default approver. Required only when
            requiresApproval is true.
          required:
            - id
          properties:
            id:
              allOf:
                - $ref: '#/components/schemas/Uuid'
              readOnly: true
            firstName:
              type: string
              description: First name of person who has been set as default approver
              maxLength: 255
            lastName:
              type: string
              description: Last name of person who has been set as default approver
              maxLength: 255
            email:
              type: string
              description: e-mail of person who has been set as default approver
              maxLength: 255
            externalId:
              type: string
              description: id from external systemdefined for this person
              maxLength: 255
    400Error:
      type: object
      properties:
        result:
          type: string
        code:
          type: string
        description:
          type: string
    404Error:
      type: object
      properties:
        result:
          type: string
        code:
          type: string
        description:
          type: string
      example:
        result: error
        code: ORGANIZATION_NOT_FOUND
        description: 'Failed to get organization for id: {orgId}'
    Uuid:
      type: string
      pattern: ^[0-9a-fA-F]{32}$
      description: UUID without dashes (32-character hex string)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````