# Update KYC settings

`PUT /kyc-settings`

> This is a subset of the full specification, limited to the `PUT /kyc-settings` operation.
>
> You can find the full specification here: /_bundle/docs/dev-docs/api/index.yaml

```yaml
openapi: 3.1.1
info:
  version: latest
  title: Core APIs
  contact:
    name: Rebilly API Support
    url: https://www.rebilly.com/contact/
    email: integrations@rebilly.com
  license:
    name: Rebilly
    url: https://www.rebilly.com/api-license/
  termsOfService: https://www.rebilly.com/terms-of-use/
  x-logo:
    url: https://rebilly-core.redoc.ly/rb_apiLogo.svg
    backgroundColor: '#0044d4'
  description: This is a subset of the full specification, limited to the `PUT /kyc-settings` operation. Components more than 3 `$ref` hops away are not included.
  x-metadata:
    description: The most common APIs used to automate common workflows.
    redocly_category: API Reference
servers:
  - url: https://api-sandbox.rebilly.com/organizations/{organizationId}
    description: Sandbox server
    variables:
      organizationId:
        default: '{organizationId}'
        description: |-
          Unique organization identifier.
          An organization is an entity that represents a company.
          For more information, see [Obtain an organization ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
  - url: https://api.rebilly.com/organizations/{organizationId}
    description: Live server
    variables:
      organizationId:
        default: '{organizationId}'
        description: |-
          Unique organization identifier.
          An organization is an entity that represents a company.
          For more information, see [Obtain an organization ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
security:
  - SecretApiKey: []
  - JWT: []
tags:
  - name: KYC documents
    description: |-
      Use Know Your Customer (KYC) documents to verify your customers identity.
      The KYC document operations generate a signed link to the Rebilly [KYC document gatherer](https://www.rebilly.com/docs/kyc-and-aml/kyc-document-gatherer/).

      Document types:
        - `identity-proof`: Validates a customer's identity.
        - `address-proof`: Validates a customer's address.
        - `purchase-proof`: Validates a customer's purchase.
        - `funds-proof`: Validates that a customer has funds.
        - `credit-file-proof`: Verifies that there is an existing credit file with two sources that match the customer's name, DOB, and address.

      Rebilly parses and analyzes the documents and accepts or rejects them according to a configurable scoring algorithm.
      When all document types in a KYC request are accepted, the status is fulfilled, and the [KYC request fulfilled webhook](https://www.rebilly.com/docs/dev-docs/api/kyc-documents/kyc-request-fulfilled/) is sent.

      ### Credit file proof

      The `credit-file-proof` KYC document request type is only available in the API,
      this option is not available in the [KYC document gatherer](https://www.rebilly.com/docs/kyc-and-aml/kyc-document-gatherer/).
      This request verifies that there is an existing credit file with two sources that match the person's name, date of birth, and address.

      In Canada, to meet FINTRAC requirements, the `credit-file-proof` KYC document request verifies the customer's name, address, and date of birth with a credit agency.

      If `credit-file-proof` is requested in combination with `identity-proof` and `address-proof`,
      `credit-file-proof` is attempted first.
      If `credit-file-proof` validates the identity and address,
      the KYC request is considered fulfilled.
      If the request is not fulfilled,
      redirect your customer to the KYC document gatherer to collect their KYC documents.
x-tagGroups:
  - name: Risk
    tags:
      - KYC documents
paths:
  /kyc-settings:
    put:
      x-products:
        - Core
      tags:
        - KYC documents
      summary: Update KYC settings
      operationId: PutKycSettings
      x-sdk-operation-name: updateKycSettings
      description: Updates KYC settings.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KycSettings'
        description: Settings for KYC analysis.
        required: true
      responses:
        '200':
          description: KYC settings updated.
          headers:
            Rate-Limit-Limit:
              $ref: '#/components/headers/Rate-Limit-Limit'
            Rate-Limit-Remaining:
              $ref: '#/components/headers/Rate-Limit-Remaining'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KycSettings'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  securitySchemes:
    JWT:
      description: |-
        JWT is a short lifetime token that can be assigned a specific expiration time.

        Usage format: `Bearer <JWT>`.
      type: http
      scheme: bearer
      bearerFormat: JWT
    SecretApiKey:
      description: |-
        Never share your secret keys.
        Keep them guarded and secure.

        Use your secret API key only to make requests from the server side.
        To authenticate, provide your secret key in the request header.
      name: REB-APIKEY
      type: apiKey
      in: header
  headers:
    Rate-Limit-Limit:
      description: |-
        Maximum number of requests available at one time for this rate limit.
        For more information, see [Rate limits](#section/Rate-limits).
      schema:
        type: integer
      example: 500
    Rate-Limit-Remaining:
      description: |-
        Number of requests still available for this rate limit.
        For more information, see [Rate limits](#section/Rate-limits).
      schema:
        type: integer
      example: 499
    Rate-Limit-Retry-After:
      description: Number of seconds to wait before retrying the request.
      schema:
        type: integer
      example: 1
  schemas:
    BaseProblem:
      type: object
      additionalProperties: true
      minProperties: 1
      description: RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object.
      properties:
        type:
          type: string
          description: |-
            Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
            It should provide human-readable documentation for the problem type.
            When this member is not present, its value is assumed to be "about:blank".
          format: uri
        title:
          type: string
          description: |-
            Short, human-readable summary of the problem type.
            Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.
        detail:
          type: string
          description: Human-readable explanation that is specific to this occurrence of the problem.
        instance:
          type: string
          description: |-
            URI reference that identifies the specific occurrence of the problem.
            It may or may not yield further information if dereferenced.
    Unauthorized:
      allOf:
        - title: Unauthorized
        - type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
              minimum: 401
              maximum: 401
        - $ref: '#/components/schemas/BaseProblem'
    OrganizationId:
      type: string
      description: |-
        Unique organization identifier.
        An organization is an entity that represents a company.
        For more information, see [Obtain an organization ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
      maxLength: 50
      example: org_0YVDM8RC7GDADADSBSMW124JA8
    Forbidden:
      allOf:
        - title: Forbidden
        - type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
              minimum: 403
              maximum: 403
            error:
              type: string
              description: |-
                Message that describes why the request is forbidden.
                Most responses use a descriptive message, such as `Not allowed to change security settings`.
                If the organization requires multi-factor authentication (MFA) and MFA verification has not been completed for the session, this value is `mfa_required`.
                If MFA verification has not been completed for the session and the operation requires a confirmed session, this value is `mfa_required_for_caller`.
                This includes turning on `requireMfa` and resetting MFA for a user.
                If the organization restricts access to a list of IP addresses and the request comes from an IP address that is not in the list, this value is `ip_not_allowed`.
            organizationId:
              description: |-
                ID of the organization that requires MFA or does not allow the IP address of the request.
                This property is present only if `error` is `mfa_required` or `ip_not_allowed`.
                The organization is the organization of the request or another organization that the request acts on.
              $ref: '#/components/schemas/OrganizationId'
        - $ref: '#/components/schemas/BaseProblem'
    NotFound:
      allOf:
        - type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
              minimum: 404
              maximum: 404
        - $ref: '#/components/schemas/BaseProblem'
    InvalidFields:
      type: array
      description: Invalid field details.
      items:
        type: object
        properties:
          field:
            type: string
            description: |-
              Name of the field.
              Dot notation is used for nested object field names.
          message:
            description: Message field.
            type: string
      example:
        - field: field1
          message: field1 is invalid
        - field: subObject.field2
          message: field2 is invalid
        - field: subObject.field2
          message: another error in the field2
    ValidationError:
      allOf:
        - title: Validation error
        - type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
              minimum: 422
              maximum: 422
        - $ref: '#/components/schemas/BaseProblem'
        - type: object
          properties:
            invalidFields:
              $ref: '#/components/schemas/InvalidFields'
    TooManyRequests:
      type: object
      additionalProperties: true
      minProperties: 1
      description: RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object.
      properties:
        type:
          type: string
          description: |-
            Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
            It should provide human-readable documentation for the problem type.
            When this member is not present, its value is assumed to be "about:blank".
          format: uri
          example: about:blank
        title:
          type: string
          description: |-
            Short, human-readable summary of the problem type.
            Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.
          example: Rate Limit Exceeded
        status:
          type: integer
          description: HTTP status code.
          minimum: 429
          maximum: 429
        detail:
          type: string
          description: Human-readable explanation that is specific to this occurrence of the problem.
          example: A request cannot be executed because the user has sent too many requests within a certain period of time
        instance:
          type: string
          description: |-
            URI reference that identifies the specific occurrence of the problem.
            It may or may not yield further information if dereferenced.
    KycSettingsIdentity:
      type: object
      description: Identity proof settings.
      properties:
        weights:
          type: object
          description: |-
            Property weights that are used for the KYC document verification process.

            All KYC documents start the verification process with a score of 100.
            If a check fails, the score is reduced by the corresponding weight.
            For example, if the `firstName` check weight is set to `5`, and the check fails,
            the KYC document score becomes `95`.
          properties:
            containsImage:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the document does not include an image that contains a face.
            isIdentityDocument:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the document does not resemble an ID.
            isPublishedOnline:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if an exact match of the document is not found online.
            firstName:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the customer's first name is not matched.
            lastName:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the customer's last name is not matched.
            expirationDate:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if an expiration date is not detected on the document.
            dateOfBirth:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if a date of birth is not detected on the document, or if the date of birth detected on the document is not matched.
            issueDate:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if an issue date is not detected on the document.
            hasMinimalAge:
              type: integer
              minimum: 0
              maximum: 100
              description: |-
                Weight added if the document does not verify the minimal age limit.
                Minimal age is 21+ the for USA and 18+ for all other countries.
            hasMatchingFaceProof:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if an identity document does not have matching face proof.
            nationality:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if a nationality is not detected on the document.
            documentSubtype:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the document is not one of the recognized document subtypes.
            isTampered:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the document has been tampered with.
            isPhotocopy:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the document is detected as a photocopy.
            mrzChecksum:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added when MRZ check digits fail validation.
            documentNumber:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if a document number is not detected on the document.
            issuanceCountry:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the country that issued the document is not detected.
            issuanceRegion:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the region, state, province, or territory that issued the document is not detected.
        thresholds:
          type: object
          description: Pass and fail threshold definition for the document verification process.
          properties:
            rejectBelow:
              type: integer
              minimum: 0
              maximum: 100
              description: Overall score by which an identity proof document fails the verification process.
            acceptAbove:
              type: integer
              minimum: 0
              maximum: 100
              description: Overall score by which an identity proof document passes the verification process.
        minimumAgeSettings:
          type: object
          description: Minimum age settings for identity proof documents.
          properties:
            defaultMinimumAge:
              type: integer
              minimum: 1
              maximum: 100
              description: |-
                Default minimum age requirement for identity proof documents.
                This is used when no location-specific override is configured.
              default: 18
            locationOverrides:
              type: array
              description: |-
                Location-specific minimum age.
                Each item specifies a minimum age for a specific location.
                For country-wide rules, omit the state field.
                For state-specific rules, include the state field.
              items:
                type: object
                required:
                  - country
                  - minimumAge
                properties:
                  country:
                    type: string
                    description: Country code in ISO 3166 alpha-2 format.
                    pattern: ^[A-Z]{2}$
                    example: US
                  state:
                    type: string
                    description: Name or code of the state or region.
                    maxLength: 45
                    example: AZ
                  minimumAge:
                    type: integer
                    description: Minimum age requirement for this location.
                    minimum: 1
                    maximum: 100
                    example: 21
              example:
                - country: US
                  minimumAge: 21
                - country: US
                  state: AL
                  minimumAge: 19
        faceProofSettings:
          type: object
          description: Quality requirements for the face proof image of an identity proof document.
          properties:
            minimumBrightness:
              type: integer
              minimum: 0
              maximum: 100
              default: 40
              description: |-
                Minimum brightness of the lighting in the detected face area of the face proof image.
                The brightness scale ranges from `0` to `100`.
                A higher value indicates brighter lighting.
                If the detected brightness is below this value,
                the `hasMatchingFaceProof` check fails with the `face_match_low_brightness` reason.
                Use `0` to disable the brightness requirement.
    KycSettingsAddress:
      type: object
      description: Address proof settings.
      properties:
        weights:
          type: object
          description: |-
            Property weights that are used for the KYC document verification process.

            All KYC documents start the verification process with a score of 100.
            If a check fails, the score is reduced by the corresponding weight.
            For example, if the `firstName` check weight is set to `5`, and the check fails,
            the KYC document score becomes `95`.
          properties:
            firstName:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the customer's first name is not matched.
            lastName:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the customer's last name is not matched.
            line1:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the customer's address is not matched.
            city:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the customer's city is not matched.
            region:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the customer's region is not matched.
            postalCode:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the customer's postal code is not matched.
            date:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if a date is not detected on the document.
            phone:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if a phone number is not detected on the document.
            documentSubtype:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the document is not one of the recognized document subtypes.
            isTampered:
              type: integer
              minimum: 0
              maximum: 100
              description: Weight added if the document has been tampered with.
        thresholds:
          type: object
          description: Pass and fail threshold definition for the document verification process.
          properties:
            rejectBelow:
              type: integer
              minimum: 0
              maximum: 100
              description: Overall score by which an identity proof document fails the verification process.
            acceptAbove:
              type: integer
              minimum: 0
              maximum: 100
              description: Overall score by which an identity proof document passes the verification process.
    ScopedKycSettingsProofBlock:
      type: object
      description: Settings for a type of KYC document.
      properties:
        prohibitedSubtypes:
          $ref: '#/components/schemas/KycProhibitedSubtypes'
      additionalProperties: false
    ScopedKycSettingsWebsiteOverride:
      type: object
      required:
        - websiteIds
      additionalProperties: false
      description: |-
        Document subtype restrictions that override the organization-level restrictions for a group of websites.
        Website IDs must identify websites associated with the organization.
        Each website ID can appear in only one override.
        Proof types are `identityProof`, `addressProof`, `fundsProof`, and `purchaseProof`.
        This object does not include `credit-file-proof` because it has no subtypes.
        For each proof type, `prohibitedSubtypes` overrides the organization value.
        If `prohibitedSubtypes` is omitted, the proof type inherits the organization value.
        Use an empty `prohibitedSubtypes` object to accept all subtypes for the websites.
      properties:
        websiteIds:
          type: array
          minItems: 1
          maxItems: 50
          uniqueItems: true
          description: IDs of websites where the override applies.
          items:
            $ref: '#/components/schemas/WebsiteId'
        identityProof:
          $ref: '#/components/schemas/ScopedKycSettingsProofBlock'
        addressProof:
          $ref: '#/components/schemas/ScopedKycSettingsProofBlock'
        fundsProof:
          $ref: '#/components/schemas/ScopedKycSettingsProofBlock'
        purchaseProof:
          $ref: '#/components/schemas/ScopedKycSettingsProofBlock'
    ScopedKycSettings:
      type: object
      additionalProperties: false
      description: |-
        Document subtype restrictions for an organization and the websites associated with it.
        Proof type keys are `identityProof`, `addressProof`, `fundsProof`, and `purchaseProof`.
        This object does not include `credit-file-proof` because it has no subtypes.
        Restrictions at the organization level apply by default.
        A website overrides the organization restrictions for a proof type when `prohibitedSubtypes` is specified.
      properties:
        identityProof:
          $ref: '#/components/schemas/ScopedKycSettingsProofBlock'
        addressProof:
          $ref: '#/components/schemas/ScopedKycSettingsProofBlock'
        fundsProof:
          $ref: '#/components/schemas/ScopedKycSettingsProofBlock'
        purchaseProof:
          $ref: '#/components/schemas/ScopedKycSettingsProofBlock'
        websiteOverrides:
          type: array
          maxItems: 50
          description: |-
            Document subtype restrictions that override subtype restrictions for selected websites.
            Each website ID can appear in only one override.
          items:
            $ref: '#/components/schemas/ScopedKycSettingsWebsiteOverride'
      example:
        identityProof:
          prohibitedSubtypes:
            driver-license: {}
        addressProof:
          prohibitedSubtypes:
            income-statement: {}
        websiteOverrides:
          - websiteIds:
              - web_abc
            identityProof:
              prohibitedSubtypes:
                public-health-card:
                  when:
                    faceProofRequired: false
                birth-certificate: {}
    KycSettings:
      type: object
      description: Settings for KYC score calculation.
      properties:
        identityProof:
          $ref: '#/components/schemas/KycSettingsIdentity'
        addressProof:
          $ref: '#/components/schemas/KycSettingsAddress'
        scopedKycSettings:
          description: |-
            Document subtype restrictions for the organization and its websites.
            When updating KYC settings, this object replaces the existing scoped KYC settings.
            If this field is omitted, the existing scoped KYC settings do not change.
            Use `null` to remove all scoped KYC settings.
          oneOf:
            - $ref: '#/components/schemas/ScopedKycSettings'
            - type: 'null'
        uiVersion:
          description: Version of the KYC document gatherer UI.
          type:
            - string
            - 'null'
          enum:
            - '1'
            - '2'
          default: '1'
          x-enumDescriptions:
            '1': Classic design.
            '2': Modern design, optimized for the best user experience on both mobile and desktop devices.
  responses:
    Unauthorized:
      description: |-
        Unauthorized access.
        Invalid credentials used.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Unauthorized'
    Forbidden:
      description: |-
        Access forbidden.
        If the organization requires multi-factor authentication (MFA) and the session has not passed MFA, `error` is `mfa_required`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Forbidden'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFound'
    ValidationError:
      description: Invalid data sent.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    TooManyRequests:
      description: Request rate limit exceeded.
      headers:
        Rate-Limit-Limit:
          $ref: '#/components/headers/Rate-Limit-Limit'
        Rate-Limit-Remaining:
          description: |-
            Number of requests still available for this rate limit.
            For more information, see [Rate limits](#section/Rate-limits).
          schema:
            type: integer
          example: 0
        Rate-Limit-Retry-After:
          $ref: '#/components/headers/Rate-Limit-Retry-After'
        Retry-After:
          description: Number of seconds to wait before retrying the request.
          schema:
            type: integer
          example: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TooManyRequests'
```
