# Retrieve KYC requests

`GET /kyc-requests`

> This is a subset of the full specification, limited to the `GET /kyc-requests` 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 `GET /kyc-requests` operation.
  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-requests:
    get:
      x-products:
        - Core
      tags:
        - KYC documents
      summary: Retrieve KYC requests
      operationId: GetKycRequestCollection
      x-sdk-operation-name: getAll
      description: Retrieves a list of KYC requests.
      parameters:
        - $ref: '#/components/parameters/collectionLimit'
        - $ref: '#/components/parameters/collectionOffset'
        - $ref: '#/components/parameters/collectionFilter'
        - $ref: '#/components/parameters/collectionSort'
        - $ref: '#/components/parameters/collectionExpand'
      responses:
        '200':
          description: List of KYC requests retrieved.
          headers:
            Pagination-Total:
              $ref: '#/components/headers/Pagination-Total'
            Pagination-Limit:
              $ref: '#/components/headers/Pagination-Limit'
            Pagination-Offset:
              $ref: '#/components/headers/Pagination-Offset'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/KycRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
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
  parameters:
    collectionLimit:
      name: limit
      in: query
      description: |-
        Limit the number of collection items to be returned.
        Use `0` to return an empty collection and still receive the count of matching items in `Pagination-Total`.
      schema:
        type: integer
        minimum: 0
        maximum: 1000
    collectionOffset:
      name: offset
      in: query
      description: Specifies the starting point within the collection of items to be returned.
      schema:
        type: integer
        minimum: 0
        maximum: 1000
    collectionSort:
      name: sort
      in: query
      description: |-
        Sorts and orders the collection of items. To sort in descending
        order, prefix with `-`. Multiple fields can be sorted by separating each with `,`.
      style: form
      explode: false
      schema:
        type: array
        items:
          type: string
    collectionFilter:
      name: filter
      in: query
      description: |-
        Criteria for filtering collection items.
        This field requires a special format.
        Use `,` to specify multiple allowed values.
        Use `;` to specify multiple fields.

        For more information, see [Search filters](https://www.rebilly.com/docs/dev-docs/search-filters).
      schema:
        type: string
    collectionExpand:
      name: expand
      in: query
      description: |-
        Expands a request to include embedded objects within the `_embedded`
        property of the response. This field accepts a comma-separated list of objects.

        For more information, see
        [Embedded resources](https://www.rebilly.com/docs/dev-docs/expand-embedded-resources).
      schema:
        type: string
  headers:
    Pagination-Total:
      description: |-
        Total number of items that match the request.
        The value is independent of `limit`, including when `limit` is `0`.
      schema:
        type: integer
      example: 332
    Pagination-Limit:
      description: Maximum number of items per page.
      schema:
        type: integer
      example: 100
    Pagination-Offset:
      description: |-
        Specifies the starting point within the
        collection of resource results. For example, a request with
        `limit=20` retrieves and displays the first 20 results on a page. A
        following request with `limit=20` and `offset=20`, retrieves the next
        page of 20 results.
      schema:
        type: integer
      example: 2
  schemas:
    CreatedTime:
      type: string
      description: |-
        Date and time when the resource is created.
        This value is set automatically when the resource is created.
      format: date-time
      readOnly: true
      x-sortable: true
      x-label: Creation Time
    UpdatedTime:
      type: string
      description: |-
        Date and time when the resource is updated.
        This value is set automatically when the resource is updated.
      format: date-time
      readOnly: true
      x-sortable: true
      x-label: Last Update Time
    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'
    CustomerId:
      type: string
      description: ID of the customer resource.
      maxLength: 50
      example: cus_0YV7DDSDD1C8DA64KHH2W33CPF
      x-basic: true
    KycDocumentTypes:
      type: string
      enum:
        - identity-proof
        - address-proof
        - funds-proof
        - purchase-proof
        - credit-file-proof
    KycDocumentSubtypes:
      type:
        - string
        - 'null'
      enum:
        - passport
        - id-card
        - driver-license
        - birth-certificate
        - utility-bill
        - rental-receipt
        - lease-agreement
        - copy-credit-card
        - credit-card-statement
        - bank-statement
        - inheritance-documentation
        - tax-return
        - salary-slip
        - sale-of-assets
        - public-health-card
        - proof-of-age-card
        - reverse-of-id
        - public-service
        - ewallet-holder-details
        - ewallet-transaction-statement
        - marriage-certificate
        - firearms-license
        - insurance-letter
        - income-statement
        - debtors-letter
        - other
        - null
    KycRequestDocument:
      type: object
      required:
        - type
      properties:
        type:
          description: Type of document to request from the customer.
          $ref: '#/components/schemas/KycDocumentTypes'
        subtypes:
          description: Permitted document subtype.
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/KycDocumentSubtypes'
        maxAttempts:
          description: |-
            Total number of allowed document upload attempts.
            Use `0` to allow unlimited upload attempts.
          type: integer
          default: 3
          minimum: 0
          maximum: 100
        faceProofRequired:
          description: Specifies if the customer must upload a photo of their face (selfie) that matches a provided KYC document.
          type: boolean
        faceLivenessRequired:
          description: |-
            Specifies if the customer must use the face liveness feature when uploading a selfie.
            For more information, see [Facial recognition and identity verification](https://www.rebilly.com/docs/kyc-and-aml/kyc#facial-recognition-identity-verification).
          type: boolean
    KycDocumentMatchLevels:
      description: Document verification level.
      type: integer
      enum:
        - 1
        - 2
        - 3
      default: 2
      x-enumDescriptions:
        '1': Moderate verification requirements. This option is used for sale transactions.
        '2': Strict verification requirements. This option is used for credit transactions.
        '3': Basic verification requirements. This option is used when a high level of verification is not required.
    KycSubtypeRestrictions:
      type: object
      additionalProperties: false
      description: |-
        Document subtypes that are prohibited for `identityProof`, `addressProof`, `fundsProof`, and `purchaseProof`.
        This object does not include `credit-file-proof` because it has no subtypes.
      properties:
        identityProof:
          type: array
          description: Prohibited subtypes of proof of identity.
          items:
            type: string
            allOf:
              - $ref: '#/components/schemas/KycDocumentSubtypes'
        addressProof:
          type: array
          description: Prohibited subtypes of proof of address.
          items:
            type: string
            allOf:
              - $ref: '#/components/schemas/KycDocumentSubtypes'
        fundsProof:
          type: array
          description: Prohibited subtypes of proof of funds.
          items:
            type: string
            allOf:
              - $ref: '#/components/schemas/KycDocumentSubtypes'
        purchaseProof:
          type: array
          description: Prohibited subtypes of proof of purchase.
          items:
            type: string
            allOf:
              - $ref: '#/components/schemas/KycDocumentSubtypes'
      example:
        identityProof:
          - driver-license
          - public-health-card
    KycRequest:
      type: object
      description: KYC request information.
      required:
        - customerId
        - documents
      properties:
        id:
          type: string
          readOnly: true
          description: ID of the KYC request.
          maxLength: 50
          example: kyc_req_0YV7JMJ3DBCGRBR7K9D4HVGPP5
        customerId:
          $ref: '#/components/schemas/CustomerId'
        documents:
          type: array
          description: Documents to request from the customer.
          minItems: 1
          items:
            $ref: '#/components/schemas/KycRequestDocument'
        status:
          description: Status of the request.
          type: string
          readOnly: true
          enum:
            - gathering
            - attempted
            - partial
            - pending-review
            - fulfilled
            - failed
            - abandoned
            - expired
          x-enumDescriptions:
            gathering: |-
              No documents have been provided yet.
              This is a temporary state.
            attempted: |-
              At least one document has been provided but none were assigned the `accepted` status.
              This is a temporary state.
            partial: |-
              At least one requested document has the `accepted` status,
              but not all requested documents have been assigned the `accepted` status.
              This is a temporary state.
            pending-review: |-
              At least one requested document has the `pending` status,
              and no requested documents have been assigned the `accepted` status.
              This is a temporary state, until the document is reviewed,
              or another `accepted` document is provided.
            fulfilled: |-
              All requested documents are provided and have been assigned the `accepted` status.
              This is a permanent state.
            failed: |-
              At least one requested document has exhausted all attempts,
              and has not been assigned a `accepted`, `pending`, or `in-progress` status.
              This is a permanent state.
            abandoned: |-
              One or more documents provided but the request expired.
              This is a permanent state.
            expired: |-
              No documents were provided and the request expired.
              This is a permanent state.
        redirectUrl:
          description: |-
            URL where the customer is redirected when a KYC document upload is complete.
            When the customer is redirected,
            Rebilly appends an `info` query parameter that has one of the following values:
              - `back`: Customer clicked the `back to website` link.
              - `token_expired`: Customer's token expired.
              - `success`: Customer uploaded KYC documents that have been analyzed.
              - `manual`: Customer uploaded KYC documents that require a manual review.
                This is because the analyzer rejected the documents or could not process them.
              - `partial`: Some of the customer's KYC documents have been analyzed,
                but other documents have not.
                For example, this may occur when a proof of address document is analyzed but proof of ID is not.

            Example: `https://example.com?info=success`.
          type:
            - string
            - 'null'
          format: uri
        reason:
          description: Reason for uploading.
          example: spend limit
          type:
            - string
            - 'null'
        matchLevel:
          $ref: '#/components/schemas/KycDocumentMatchLevels'
        revision:
          description: |-
            Number of times the KYC request data has been modified.

            Use this value when analyzing webhook data to determine if a change must take precedence over the current representation.
          type: integer
          readOnly: true
        subtypeRestrictions:
          description: Document subtypes that are prohibited for this KYC request.
          readOnly: true
          $ref: '#/components/schemas/KycSubtypeRestrictions'
        expirationTime:
          description: |-
            Date and time when the request expires.
            The default value is one hour in the future.
          type: string
          format: date-time
        createdTime:
          $ref: '#/components/schemas/CreatedTime'
        updatedTime:
          $ref: '#/components/schemas/UpdatedTime'
        _links:
          type: array
          description: Related links.
          readOnly: true
          items:
            type: object
            properties:
              href:
                description: Link URL.
                type: string
              rel:
                description: Type of link.
                type: string
                enum:
                  - self
                  - documents
                  - gatherer
        _embedded:
          type: object
          description: Embedded objects that are requested by the `expand` query parameter.
          readOnly: true
          properties:
            documents:
              type: array
  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'
```
